Class Line

java.lang.Object
com.itextpdf.kernel.geom.Line
All Implemented Interfaces:
IShape

public class Line extends Object implements IShape
Represents a line.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Line()
    Constructs a new zero-length line starting at zero.
    Line(float x1, float y1, float x2, float y2)
    Constructs a new line based on the given coordinates.
    Line(Point p1, Point p2)
    Constructs a new line based on the given coordinates.
  • Method Summary

    Modifier and Type
    Method
    Description
    Treat base points as the points which are enough to construct a shape.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • 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.
      Parameters:
      x1 - x-coordinate of start point of this Line
      y1 - y-coordinate of start point of this Line
      x2 - x-coordinate of end point of this Line
      y2 - y-coordinate of end point of this Line
    • Line

      public Line (Point p1, Point p2)
      Constructs a new line based on the given coordinates.
      Parameters:
      p1 - start point of this Line
      p2 - end point of this Line
  • Method Details

    • getBasePoints

      public List<Point> getBasePoints()
      Description copied from interface: IShape
      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 IShape
      Returns:
      Ordered List consisting of shape's base points.