public CircularCloudLayouter(Point center) { if (center.X < 0 || center.Y < 0) { throw new ArgumentException("Coordinates of the center must be positive numbers"); } this.center = center; spiralGenerator = new SpiralGenerator(this.center); TagsCloud = new TagCloud(); }
public CircularCloudLayouter(ITagsCloud tagsCloud) { if (!tagsCloud.Rectangles.Any()) { throw new ArgumentException("Tags cloud could not be empty"); } var firstRectangle = tagsCloud.Rectangles.First(); var firstRectangleCenter = firstRectangle.GetRectangleCenter(); if (firstRectangleCenter.X < 0 || firstRectangleCenter.Y < 0) { throw new ArgumentException("Coordinates of the center must be positive numbers"); } this.center = firstRectangleCenter; this.TagsCloud = tagsCloud; spiralGenerator = new SpiralGenerator(this.center); }