Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.awt.geom

Interface PathIterator

java.lang.Object
|
+--java.awt.geom.PathIterator


public interface PathIterator

This interface provides a directed path over the boundary of a shape. The path can contain 1st through 3rd order Bezier curves (lines, and quadratic and cubic splines). A shape can have multiple disjoint paths via the MOVETO directive, and can close a circular path back to the previos MOVETO via the CLOSE directive.

Since:Authors:See Also:

Method Summary

intcurrentSegment(float[] coords)

Returns the coordinates of the next point(s), as well as the type of line segment.
intcurrentSegment(double[] coords)

Returns the coordinates of the next point(s), as well as the type of line segment.
intgetWindingRule()

Returns the winding rule to determine which points are inside this path.
booleanisDone()

Tests if the iterator is exhausted.
voidnext()

Advance to the next segment in the iteration.

Method Details

currentSegment

public int currentSegment(double[] coords)

Returns the coordinates of the next point(s), as well as the type of line segment. The input array must be at least a double[6], to accomodate up to three (x,y) point pairs (although if you know the iterator is flat, you can probably get by with a double[2]). If the returned type is SEG_MOVETO or SEG_LINETO, the first point in the array is modified; if the returned type is SEG_QUADTO, the first two points are modified; if the returned type is SEG_CUBICTO, all three points are modified; and if the returned type is SEG_CLOSE, the array is untouched.

Parameters:

Returns:

Throws:

See Also:


currentSegment

public int currentSegment(float[] coords)

Returns the coordinates of the next point(s), as well as the type of line segment. The input array must be at least a float[6], to accomodate up to three (x,y) point pairs (although if you know the iterator is flat, you can probably get by with a float[2]). If the returned type is SEG_MOVETO or SEG_LINETO, the first point in the array is modified; if the returned type is SEG_QUADTO, the first two points are modified; if the returned type is SEG_CUBICTO, all three points are modified; and if the returned type is SEG_CLOSE, the array is untouched.

Parameters:

Returns:

Throws:

See Also:


getWindingRule

public int getWindingRule()

Returns the winding rule to determine which points are inside this path.

Returns:

See Also:


isDone

public boolean isDone()

Tests if the iterator is exhausted. If this returns false, currentSegment and next may throw a NoSuchElementException (although this is not required).

Returns:


next

public void next()

Advance to the next segment in the iteration. It is not specified what this does if called when isDone() returns false.

Throws: