Interface java.awt.geom.PathIterator
- Implementing Classes:
- FlatteningPathIterator
- public interface PathIterator
Field Summary
|
static byte
|
SEG_CLOSE
The point type that specifies that the preceding subpath should be
closed by appending a line segment back to the point corresponding
to the most recent SEG_MOVETO.
|
static byte
|
SEG_CUBICTO
The point type for the set of 3 points that specify a cubic
parametric curve to be drawn from the most recently specified
point.
|
static byte
|
SEG_LINETO
The point type for a point that specifies the end point of a
line to be drawn from the most recently specified point.
|
static byte
|
SEG_MOVETO
The point type for a point that specifies the starting location
for a new subpath.
|
static byte
|
SEG_QUADTO
The point type for the pair of points that specify a quadratic
parametric curve to be drawn from the most recently specified
point.
|
static byte
|
WIND_EVEN_ODD
An even-odd winding rule for determining the interior of
a path.
|
static byte
|
WIND_NON_ZERO
A non-zero winding rule for determining the interior of a
path.
|
Method Summary
|
int
|
currentSegment(float[] coords)
Returns the coordinates and type of the current path segment in
the iteration.
|
int
|
currentSegment(double[] coords)
Returns the coordinates and type of the current path segment in
the iteration.
|
int
|
getWindingRule()
Return 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 to the next segment of the path forwards
along the primary direction of traversal as long as there are
more points in that direction.
|
WIND_EVEN_ODD
public static final byte WIND_EVEN_ODD
- An even-odd winding rule for determining the interior of
a path.
WIND_NON_ZERO
public static final byte WIND_NON_ZERO
- A non-zero winding rule for determining the interior of a
path.
SEG_MOVETO
public static final byte SEG_MOVETO
- The point type for a point that specifies the starting location
for a new subpath.
SEG_LINETO
public static final byte SEG_LINETO
- The point type for a point that specifies the end point of a
line to be drawn from the most recently specified point.
SEG_QUADTO
public static final byte SEG_QUADTO
- The point type for the pair of points that specify a quadratic
parametric curve to be drawn from the most recently specified
point. The curve is interpolated by solving the parametric
control equation in the range
(t = [0..1])
using
the most recently specified (current) point (CP),
the first control point (P1),
and the final interpolated control point (P2).
The parametric control equation for this curve is:
P(t) = B(2,0)*CP + B(2,1)*P1 + B(2,2)*P2
0 <= t <= 1
B(n,m) = mth coefficient of nth degree Bernstein polynomial
= C(n,m) * t^(m) * (1 - t)^(n-m)
C(n,m) = Combinations of n things, taken m at a time
= n! / (m! * (n-m)!)
SEG_CUBICTO
public static final byte SEG_CUBICTO
- The point type for the set of 3 points that specify a cubic
parametric curve to be drawn from the most recently specified
point. The curve is interpolated by solving the parametric
control equation in the range
(t = [0..1])
using
the most recently specified (current) point (CP),
the first control point (P1),
the second control point (P2),
and the final interpolated control point (P3).
The parametric control equation for this curve is:
P(t) = B(3,0)*CP + B(3,1)*P1 + B(3,2)*P2 + B(3,3)*P3
0 <= t <= 1
B(n,m) = mth coefficient of nth degree Bernstein polynomial
= C(n,m) * t^(m) * (1 - t)^(n-m)
C(n,m) = Combinations of n things, taken m at a time
= n! / (m! * (n-m)!)
This form of curve is commonly known as a Bézier curve.
SEG_CLOSE
public static final byte SEG_CLOSE
- The point type that specifies that the preceding subpath should be
closed by appending a line segment back to the point corresponding
to the most recent SEG_MOVETO.
getWindingRule
public int getWindingRule()
- Return the winding rule for determining the interior of the
path.
- See Also:
- WIND_EVEN_ODD, WIND_NON_ZERO
isDone
public boolean isDone()
- Tests if there are more points to read.
- Returns:
- true if there are more points to read
next
public void next()
- Moves the iterator to the next segment of the path forwards
along the primary direction of traversal as long as there are
more points in that direction.
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, SEG_QUADTO, SEG_CUBICTO, or SEG_CLOSE.
A float array of length 6 must be passed in and may 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 will return one point,
SEG_QUADTO will return two points,
SEG_CUBICTO will return 3 points
and SEG_CLOSE will not return any points.
- See Also:
- SEG_MOVETO, SEG_LINETO, SEG_QUADTO, SEG_CUBICTO, 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, SEG_QUADTO, SEG_CUBICTO, or SEG_CLOSE.
A double array of length 6 must be passed in and may 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 will return one point,
SEG_QUADTO will return two points,
SEG_CUBICTO will return 3 points
and SEG_CLOSE will not return any points.
- See Also:
- SEG_MOVETO, SEG_LINETO, SEG_QUADTO, SEG_CUBICTO, SEG_CLOSE
Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.