Class Line

  • All Implemented Interfaces:
    Shape

    public class Line
    extends Object
    implements Shape
    Represents a line.
    Since:
    5.5.6
    • Constructor Detail

      • Line

        public Line()
        Constructs a new zero-length line starting at zero.
      • Line

        public Line​(float x1,
                    float y1,
                    float x2,
                    float y2)
        Constructs a new line based on the given coordinates.
      • Line

        public Line​(Point2D p1,
                    Point2D p2)
        Constructs a new line based on the given coordinates.
    • Method Detail

      • getBasePoints

        public List<Point2D> getBasePoints()
        Description copied from interface: Shape
        Treat base points as the points which are enough to construct a shape. E.g. for a bezier curve they are control points, for a line segment - the start and the end points of the segment.
        Specified by:
        getBasePoints in interface Shape
        Returns:
        Ordered List consisting of shape's base points.