FileDocCategorySizeDatePackage
PathIterator.javaAPI DocAndroid 1.5 API5801Wed May 06 22:41:54 BST 2009java.awt.geom

PathIterator

public 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.

since
Android 1.0

Fields Summary
public static final int
WIND_EVEN_ODD
The 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_ZERO
The 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_MOVETO
The 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_LINETO
The 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_QUADTO
The 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_CUBICTO
The 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_CLOSE
The Constant SEG_CLOSE indicates that the previous point was the end of the shape's outline.
Constructors Summary
Methods Summary
public intcurrentSegment(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.

param
coords the array that the coordinates of the end point of the current segment are written into.
return
the flag that indicates how to follow the shape's outline from the previous point to the current one, chosen from the following constants: {@link PathIterator#SEG_MOVETO}, {@link PathIterator#SEG_LINETO}, {@link PathIterator#SEG_QUADTO}, {@link PathIterator#SEG_CUBICTO}, or {@link PathIterator#SEG_CLOSE}.

public intcurrentSegment(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.

param
coords the array that the coordinates of the end point of the current segment are written into.
return
the flag that indicates how to follow the shape's outline from the previous point to the current one, chosen from the following constants: {@link PathIterator#SEG_MOVETO}, {@link PathIterator#SEG_LINETO}, {@link PathIterator#SEG_QUADTO}, {@link PathIterator#SEG_CUBICTO}, or {@link PathIterator#SEG_CLOSE}.

public intgetWindingRule()
Gets the winding rule, either {@link PathIterator#WIND_EVEN_ODD} or {@link PathIterator#WIND_NON_ZERO}.

return
the winding rule.

public booleanisDone()
Checks if this PathIterator has been completely traversed.

return
true, if this PathIterator has been completely traversed.

public voidnext()
Tells this PathIterator to skip to the next segment.