public static class GeneralPath.PathCursor extends Object
GeneralPath
to iterate over the elements the path is made up of.GeneralPath.createCursor()
Modifier and Type | Method and Description |
---|---|
PathType |
getCurrent(double[] coordinates)
Places the coordinates for the current type into the given array.
|
PointD |
getCurrentEndPoint()
Gets the current end point of the last path element.
|
PathType |
getCurrentEndPoint(double[] coordinates)
Places the current end coordinates of the last path element into the array.
|
double |
getCurrentEndPointX()
Returns the current x coordinate of the last path element.
|
double |
getCurrentEndPointY()
Returns the current y coordinate of the last path element.
|
int |
getIndex()
Returns the current position of the cursor.
|
PathType |
getPathType()
Returns the type of the path at the position of the cursor.
|
boolean |
moveNext()
Advances the cursor to the next position if possible.
|
boolean |
movePrevious()
Moves the cursor to the previous position in the path.
|
void |
reset()
Reset the cursor to point to the beginning of the path.
|
boolean |
toLast()
Resets the cursor to point to the last element in the path.
|
public final PathType getCurrent(double[] coordinates)
The array needs to have a length of at least 6, since PathType.CUBIC_TO
needs six coordinates. If the path has
been flattened a length of two suffices.
getCurrentEndPoint(double[])
public final PointD getCurrentEndPoint()
public final PathType getCurrentEndPoint(double[] coordinates)
coordinates
- An array with length at least 2.public final double getCurrentEndPointX()
0
if the element is of type PathType.CLOSE
.public final double getCurrentEndPointY()
0
if the element is of type PathType.CLOSE
.public final int getIndex()
public final PathType getPathType()
public final boolean moveNext()
false
if the cursor has been moved beyond the end of the path.public final boolean movePrevious()
public final void reset()
public final boolean toLast()