com.itextpdf.text.pdf.parser
Class Subpath

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

public class Subpath
extends Object

As subpath is a part of a path comprising a sequence of connected segments.

Since:
5.5.6

Constructor Summary
Subpath()
           
Subpath(float startPointX, float startPointY)
          Constructs a new subpath starting at the given point.
Subpath(Point2D startPoint)
          Constructs a new subpath starting at the given point.
Subpath(Subpath subpath)
          Copy constuctor.
 
Method Summary
 void addSegment(Shape segment)
          Adds a segment to the subpath.
 Point2D getLastPoint()
           
 List<Point2D> getPiecewiseLinearApproximation()
           
 List<Shape> getSegments()
           
 Point2D getStartPoint()
           
 boolean isClosed()
          Returns a boolean value indicating whether the subpath must be closed or not.
 boolean isDegenerate()
          Returns a boolean indicating whether the subpath is degenerate or not.
 boolean isEmpty()
          Checks whether subpath is empty or not.
 boolean isSinglePointClosed()
           
 boolean isSinglePointOpen()
           
 void setClosed(boolean closed)
          See isClosed()
 void setStartPoint(float x, float y)
          Sets the start point of the subpath.
 void setStartPoint(Point2D startPoint)
          Sets the start point of the subpath.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Subpath

public Subpath()

Subpath

public Subpath(Subpath subpath)
Copy constuctor.

Parameters:
subpath -

Subpath

public Subpath(Point2D startPoint)
Constructs a new subpath starting at the given point.


Subpath

public Subpath(float startPointX,
               float startPointY)
Constructs a new subpath starting at the given point.

Method Detail

setStartPoint

public void setStartPoint(Point2D startPoint)
Sets the start point of the subpath.

Parameters:
startPoint -

setStartPoint

public void setStartPoint(float x,
                          float y)
Sets the start point of the subpath.

Parameters:
x -
y -

getStartPoint

public Point2D getStartPoint()
Returns:
The point this subpath starts at.

getLastPoint

public Point2D getLastPoint()
Returns:
The last point of the subpath.

addSegment

public void addSegment(Shape segment)
Adds a segment to the subpath. Note: each new segment shall start at the end of the previous segment.

Parameters:
segment - new segment.

getSegments

public List<Shape> getSegments()
Returns:
List comprising all the segments the subpath made on.

isEmpty

public boolean isEmpty()
Checks whether subpath is empty or not.

Returns:
true if the subpath is empty, false otherwise.

isSinglePointOpen

public boolean isSinglePointOpen()
Returns:
true if this subpath contains only one point and it is not closed, false otherwise

isSinglePointClosed

public boolean isSinglePointClosed()

isClosed

public boolean isClosed()
Returns a boolean value indicating whether the subpath must be closed or not. Ignore this value if the subpath is a rectangle because in this case it is already closed (of course if you paint the path using re operator)

Returns:
boolean value indicating whether the path must be closed or not.
Since:
5.5.6

setClosed

public void setClosed(boolean closed)
See isClosed()


isDegenerate

public boolean isDegenerate()
Returns a boolean indicating whether the subpath is degenerate or not. A degenerate subpath is the subpath consisting of a single-point closed path or of two or more points at the same coordinates.

Returns:
boolean value indicating whether the path is degenerate or not.
Since:
5.5.6

getPiecewiseLinearApproximation

public List<Point2D> getPiecewiseLinearApproximation()
Returns:
List containing points of piecewise linear approximation for this subpath.
Since:
5.5.6


Copyright © 2015. All Rights Reserved.