com.itextpdf.text.pdf.parser
Class LineSegment

java.lang.Object
  extended by com.itextpdf.text.pdf.parser.LineSegment

public class LineSegment
extends Object

Represents a line segment in a particular coordinate system. This class is immutable.

Since:
5.0.2

Constructor Summary
LineSegment(Vector startPoint, Vector endPoint)
          Creates a new line segment.
 
Method Summary
 Rectangle2D.Float getBoundingRectange()
          Computes the bounding rectangle for this line segment.
 Vector getEndPoint()
           
 float getLength()
           
 Vector getStartPoint()
           
 LineSegment transformBy(Matrix m)
          Transforms the segment by the specified matrix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineSegment

public LineSegment(Vector startPoint,
                   Vector endPoint)
Creates a new line segment.

Parameters:
startPoint - the start point of a line segment.
endPoint - the end point of a line segment.
Method Detail

getStartPoint

public Vector getStartPoint()
Returns:
the start point

getEndPoint

public Vector getEndPoint()
Returns:
the end point

getLength

public float getLength()
Returns:
the length of this line segment
Since:
5.0.2

getBoundingRectange

public Rectangle2D.Float getBoundingRectange()
Computes the bounding rectangle for this line segment. The rectangle has a rotation 0 degrees with respect to the coordinate system that the line system is in. For example, if a line segment is 5 unit long and sits at a 37 degree angle from horizontal, the bounding rectangle will have origin of the lower left hand end point of the segment, with width = 4 and height = 3.

Returns:
the bounding rectangle
Since:
5.0.2

transformBy

public LineSegment transformBy(Matrix m)
Transforms the segment by the specified matrix

Parameters:
m - the matrix for the transformation
Returns:
the transformed segment


Copyright © 2013. All Rights Reserved.