Package com.lowagie.text.pdf.internal
Class PolylineShapeIterator
java.lang.Object
com.lowagie.text.pdf.internal.PolylineShapeIterator
- All Implemented Interfaces:
PathIterator
PathIterator for PolylineShape. This class was originally written by wil - amristar.com.au and integrated into iText
by Bruno.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AffineTransform
an affine transformation to be performed on the polyline.protected int
the index of the current segment in the iterator.protected PolylineShape
The polyline over which we are going to iterate.Fields inherited from interface java.awt.geom.PathIterator
SEG_CLOSE, SEG_CUBICTO, SEG_LINETO, SEG_MOVETO, SEG_QUADTO, WIND_EVEN_ODD, WIND_NON_ZERO
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a PolylineShapeIterator. -
Method Summary
Modifier and TypeMethodDescriptionint
currentSegment
(double[] coords) Returns the coordinates and type of the current path segment in the iteration.int
currentSegment
(float[] coords) Returns the coordinates and type of the current path segment in the iteration.int
Return the winding rule for determining the insideness of the path.boolean
isDone()
Tests if there are more points to read.void
next()
Moves the iterator to the next segment of the path forwards along the primary direction of traversal as long as there are more points in that direction.
-
Field Details
-
poly
The polyline over which we are going to iterate. -
affine
an affine transformation to be performed on the polyline. -
index
protected int indexthe index of the current segment in the iterator.
-
-
Constructor Details
-
PolylineShapeIterator
PolylineShapeIterator(PolylineShape l, AffineTransform at) Creates a PolylineShapeIterator.
-
-
Method Details
-
currentSegment
public int currentSegment(double[] coords) Returns the coordinates and type of the current path segment in the iteration. The return value is the path segment type: SEG_MOVETO, SEG_LINETO, SEG_QUADTO, SEG_CUBICTO, or SEG_CLOSE. A double array of length 6 must be passed in and may be used to store the coordinates of the point(s). Each point is stored as a pair of double x,y coordinates. SEG_MOVETO and SEG_LINETO types will return one point, SEG_QUADTO will return two points, SEG_CUBICTO will return 3 points and SEG_CLOSE will not return any points.- Specified by:
currentSegment
in interfacePathIterator
- See Also:
-
currentSegment
public int currentSegment(float[] coords) Returns the coordinates and type of the current path segment in the iteration. The return value is the path segment type: SEG_MOVETO, SEG_LINETO, SEG_QUADTO, SEG_CUBICTO, or SEG_CLOSE. A double array of length 6 must be passed in and may be used to store the coordinates of the point(s). Each point is stored as a pair of double x,y coordinates. SEG_MOVETO and SEG_LINETO types will return one point, SEG_QUADTO will return two points, SEG_CUBICTO will return 3 points and SEG_CLOSE will not return any points.- Specified by:
currentSegment
in interfacePathIterator
- See Also:
-
getWindingRule
public int getWindingRule()Return the winding rule for determining the insideness of the path.- Specified by:
getWindingRule
in interfacePathIterator
- See Also:
-
isDone
public boolean isDone()Tests if there are more points to read.- Specified by:
isDone
in interfacePathIterator
- Returns:
- true if there are more points to read
- See Also:
-
next
public void next()Moves the iterator to the next segment of the path forwards along the primary direction of traversal as long as there are more points in that direction.- Specified by:
next
in interfacePathIterator
- See Also:
-