java.awt
Class Polygon.PolygonPathIterator
java.lang.Object
java.awt.Polygon.PolygonPathIterator
- All Implemented Interfaces:
- PathIterator
- Enclosing class:
- Polygon
- class Polygon.PolygonPathIterator
- extends Object
- implements PathIterator
Method Summary |
int |
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 |
getWindingRule()
Returns the winding rule for determining the interior of the
path. |
boolean |
isDone()
Tests if there are more points to read. |
void |
next()
Moves the iterator forwards, along the primary direction of
traversal, to the next segment of the path when there are
more points in that direction. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
poly
Polygon poly
transform
AffineTransform transform
index
int index
Polygon.PolygonPathIterator
public Polygon.PolygonPathIterator(Polygon pg,
AffineTransform at)
getWindingRule
public int getWindingRule()
- Returns the winding rule for determining the interior of the
path.
- Specified by:
getWindingRule
in interface PathIterator
- Returns:
- an integer representing the current winding rule.
- See Also:
PathIterator.WIND_NON_ZERO
isDone
public boolean isDone()
- Tests if there are more points to read.
- Specified by:
isDone
in interface PathIterator
- Returns:
true
if there are more points to read;
false
otherwise.
next
public void next()
- Moves the iterator forwards, along the primary direction of
traversal, to the next segment of the path when there are
more points in that direction.
- Specified by:
next
in interface PathIterator
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, or SEG_CLOSE.
A
float
array of length 2 must be passed in and
can be used to store the coordinates of the point(s).
Each point is stored as a pair of float
x, y
coordinates. SEG_MOVETO and SEG_LINETO types return one
point, and SEG_CLOSE does not return any points.
- Specified by:
currentSegment
in interface PathIterator
- Parameters:
coords
- a float
array that specifies the
coordinates of the point(s)
- Returns:
- an integer representing the type and coordinates of the
current path segment.
- See Also:
PathIterator.SEG_MOVETO
,
PathIterator.SEG_LINETO
,
PathIterator.SEG_CLOSE
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, or SEG_CLOSE.
A
double
array of length 2 must be passed in and
can 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 return one point,
and SEG_CLOSE does not return any points.
- Specified by:
currentSegment
in interface PathIterator
- Parameters:
coords
- a double
array that specifies the
coordinates of the point(s)
- Returns:
- an integer representing the type and coordinates of the
current path segment.
- See Also:
PathIterator.SEG_MOVETO
,
PathIterator.SEG_LINETO
,
PathIterator.SEG_CLOSE