package drawing; import java.util.Collection; /** * The abstract class Shape represents a shape that can be drawn with the * ShapeTool */ abstract class Shape { /** * A default set of points that represents the basic characteristics of a * particular shape. */ Collection points; /** * The location of the top-left corner of the shape. */ Point position; /** * The width of the shape in pixels. */ int width; /** * The height of the shape in pixels. */ int height; /** * The thickness of of the shape's lines. */ double strokeSize; /** * The color of the shape's lines. */ format.Color color; } /** * The Triangle class, extending Shape, contains the ordinary characteristics * of a triangle. */ class Triangle extends Shape {} /** * The Circle class, extending Shape, contains the ordinary characteristics * of a circle. */ class Circle extends Shape {} /** * The Rectangle class, extending Shape, contains the ordinary characteristics * of a rectangle. */ class Rectangle extends Shape {} /** * The Line class, extending Shape, contains the ordinary characteristics * of a line. */ class Line extends Shape {} /** * The Star class, extending Shape, contains the ordinary characteristics * of a star. */ class Star extends Shape {}