PathIteratorpublic interface PathIterator The Interface PathIterator represents an iterator object that can be used to
traverse the outline of a {@link java.awt.Shape}. It returns points along the
boundary of the Shape which may be actual vertices (in the case of a shape
made of line segments) or may be points on a curved segment with the distance
between the points determined by a chosen flattening factor.
If the shape is closed, the outline is traversed in the counter-clockwise
direction. That means that moving forward along the boundary is to travel in
such a way that the interior of the shape is to the left of the outline path
and the exterior of the shape is to the right of the outline path. The
interior and exterior of the shape are determined by a winding rule.
|
Fields Summary |
---|
public static final int | WIND_EVEN_ODDThe Constant WIND_EVEN_ODD indicates the winding rule that says that a
point is outside the shape if any infinite ray from the point crosses the
outline of the shape an even number of times, otherwise it is inside. | public static final int | WIND_NON_ZEROThe Constant WIND_NON_ZERO indicates the winding rule that says that a
point is inside the shape if every infinite ray starting from that point
crosses the outline of the shape a non-zero number of times. | public static final int | SEG_MOVETOThe Constant SEG_MOVETO indicates that to follow the shape's outline from
the previous point to the current point, the cursor (traversal point)
should be placed directly on the current point. | public static final int | SEG_LINETOThe Constant SEG_LINETO indicates that to follow the shape's outline from
the previous point to the current point, the cursor (traversal point)
should follow a straight line. | public static final int | SEG_QUADTOThe Constant SEG_QUADTO indicates that to follow the shape's outline from
the previous point to the current point, the cursor (traversal point)
should follow a quadratic curve. | public static final int | SEG_CUBICTOThe Constant SEG_CUBICTO indicates that to follow the shape's outline
from the previous point to the current point, the cursor (traversal
point) should follow a cubic curve. | public static final int | SEG_CLOSEThe Constant SEG_CLOSE indicates that the previous point was the end of
the shape's outline. |
Methods Summary |
---|
public int | currentSegment(float[] coords)Gets the coordinates of the next vertex point along the shape's outline
and a flag that indicates what kind of segment to use in order to connect
the previous vertex point to the current vertex point to form the current
segment.
| public int | currentSegment(double[] coords)Gets the coordinates of the next vertex point along the shape's outline
and a flag that indicates what kind of segment to use in order to connect
the previous vertex point to the current vertex point to form the current
segment.
| public int | getWindingRule()Gets the winding rule, either {@link PathIterator#WIND_EVEN_ODD} or
{@link PathIterator#WIND_NON_ZERO}.
| public boolean | isDone()Checks if this PathIterator has been completely traversed.
| public void | next()Tells this PathIterator to skip to the next segment.
|
|