Java Platform 1.2
Beta 4

Class java.awt.geom.FlatteningPathIterator

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

public class FlatteningPathIterator
extends Object
implements PathIterator
This class returns a flattened view of another PathIterator object. Other Shape classes can use this class to provide flattening behavior for their paths without having to perform the interpolation calculations themselves.


Constructor Summary
FlatteningPathIterator(PathIterator src, double flatness, int limit)
          Constructs a new FlatteningPathIterator object that flattens a path as it iterates over it.
FlatteningPathIterator(PathIterator src, double flatness)
          Constructs a new FlatteningPathIterator object that flattens a path as it iterates over it.
 
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.
 double getFlatness()
          Return the flatness of this iterator.
 int getRecursionLimit()
          Return the recursion limit of this iterator.
 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.
 
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
 

Constructor Detail

FlatteningPathIterator

public FlatteningPathIterator(PathIterator src,
                              double flatness)
Constructs a new FlatteningPathIterator object that flattens a path as it iterates over it. The iterator will not subdivide any curve read from the source iterator to more than 10 levels of subdivision which yeilds a maximum of 1024 line segments per curve.
Parameters:
src - the original unflattened path being iterated over
flatness - the maximum allowable distance between the control points and the flattened curve

FlatteningPathIterator

public FlatteningPathIterator(PathIterator src,
                              double flatness,
                              int limit)
Constructs a new FlatteningPathIterator object that flattens a path as it iterates over it. The limit parameter allows you to control the maximum number of recursive subdivisions that the iterator can make before it assumes that the curve is flat enough without measuring against the flatness parameter. The flattened iteration will thus never generate more than a maximum of (2^limit) line segments per curve.
Parameters:
src - the original unflattened path being iterated over
flatness - the maximum allowable distance between the control points and the flattened curve
limit - the maximum number of recursive subdivisions allowed for any curved segment
Method Detail

getFlatness

public double getFlatness()
Return the flatness of this iterator.

getRecursionLimit

public int getRecursionLimit()
Return the recursion limit of this iterator.

getWindingRule

public int getWindingRule()
Return the winding rule for determining the interior of the path.
Specified by:
getWindingRule in interface PathIterator
See Also:
PathIterator.WIND_EVEN_ODD, 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

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.
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 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, and SEG_CLOSE will not return any points.
Specified by:
currentSegment in interface PathIterator
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 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, and SEG_CLOSE will not return any points.
Specified by:
currentSegment in interface PathIterator
See Also:
PathIterator.SEG_MOVETO, PathIterator.SEG_LINETO, PathIterator.SEG_CLOSE

Java Platform 1.2
Beta 4

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.
This documentation was generated with a post-Beta4 version of Javadoc.