APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.javafx.geom

public Class FlatteningPathIterator

extends Object
implements PathIterator
Class Inheritance
All Implemented Interfaces
com.sun.javafx.geom.PathIterator
Imports
java.util.NoSuchElementException

The FlatteningPathIterator 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.
Version
1.6 06/29/98

Field Summary

Modifier and TypeField and Description
pack-priv float
pack-priv float
pack-priv boolean
pack-priv static final int
pack-priv volatile float[]
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int[]
pack-priv int
pack-priv float
pack-priv float
pack-priv float
pack-priv PathIterator

Constructor Summary

AccessConstructor and Description
public
FlatteningPathIterator(PathIterator
the original unflattened path being iterated over
src
,
float
the maximum allowable distance between the control points and the flattened curve
flatness
)

Constructs a new FlatteningPathIterator object that flattens a path as it iterates over it.

public
FlatteningPathIterator(PathIterator
the original unflattened path being iterated over
src
,
float
the maximum allowable distance between the control points and the flattened curve
flatness
,
int
the maximum number of recursive subdivisions allowed for any curved segment
limit
)

Constructs a new FlatteningPathIterator object that flattens a path as it iterates over it.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the path segment type of the current path segment.
currentSegment
(float[]
an array that holds the data returned from this method
coords
)

Implements com.sun.javafx.geom.PathIterator.currentSegment.

Returns the coordinates and type of the current path segment in the iteration.

pack-priv void
public float

Returns:

the flatness of this FlatteningPathIterator.
getFlatness
()

Returns the flatness of this iterator.

public int

Returns:

the recursion limit of this FlatteningPathIterator.
getRecursionLimit
()

Returns the recursion limit of this iterator.

public int

Returns:

the winding rule of the original unflattened path being iterated over.
getWindingRule
()

Implements com.sun.javafx.geom.PathIterator.getWindingRule.

Returns the winding rule for determining the interior of the path.

public boolean

Returns:

true if all the segments have been read; false otherwise.
isDone
()

Implements com.sun.javafx.geom.PathIterator.isDone.

Tests if the iteration is complete.

public void
next()

Implements com.sun.javafx.geom.PathIterator.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.

private void
next(boolean doNext)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

curxback to summary
pack-priv float curx
curyback to summary
pack-priv float cury
doneback to summary
pack-priv boolean done
GROW_SIZEback to summary
pack-priv static final int GROW_SIZE
holdback to summary
pack-priv volatile float[] hold
holdEndback to summary
pack-priv int holdEnd
holdIndexback to summary
pack-priv int holdIndex
holdTypeback to summary
pack-priv int holdType
levelIndexback to summary
pack-priv int levelIndex
levelsback to summary
pack-priv int[] levels
limitback to summary
pack-priv int limit
movxback to summary
pack-priv float movx
movyback to summary
pack-priv float movy
squareflatback to summary
pack-priv float squareflat
srcback to summary
pack-priv PathIterator src

Constructor Detail

FlatteningPathIteratorback to summary
public FlatteningPathIterator(PathIterator src, float flatness)

Constructs a new FlatteningPathIterator object that flattens a path as it iterates over it. The iterator does not subdivide any curve read from the source iterator to more than 10 levels of subdivision which yields a maximum of 1024 line segments per curve.

Parameters
src:PathIterator

the original unflattened path being iterated over

flatness:float

the maximum allowable distance between the control points and the flattened curve

FlatteningPathIteratorback to summary
public FlatteningPathIterator(PathIterator src, float 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 therefore never generates more than a maximum of (2^limit) line segments per curve.

Parameters
src:PathIterator

the original unflattened path being iterated over

flatness:float

the maximum allowable distance between the control points and the flattened curve

limit:int

the maximum number of recursive subdivisions allowed for any curved segment

Exceptions
IllegalArgumentException:
if flatness or limit is less than zero

Method Detail

currentSegmentback to summary
public int currentSegment(float[] coords)

Implements com.sun.javafx.geom.PathIterator.currentSegment.

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 can 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 return one point, and SEG_CLOSE does not return any points.

Parameters
coords:float[]

an array that holds the data returned from this method

Returns:int

the path segment type of the current path segment.

Annotations
@Override
Exceptions
NoSuchElementException:
if there are no more elements in the flattening path to be returned.
See Also
PathIterator#SEG_MOVETO, PathIterator#SEG_LINETO, PathIterator#SEG_CLOSE
ensureHoldCapacityback to summary
pack-priv void ensureHoldCapacity(int want)
getFlatnessback to summary
public float getFlatness()

Returns the flatness of this iterator.

Returns:float

the flatness of this FlatteningPathIterator.

getRecursionLimitback to summary
public int getRecursionLimit()

Returns the recursion limit of this iterator.

Returns:int

the recursion limit of this FlatteningPathIterator.

getWindingRuleback to summary
public int getWindingRule()

Implements com.sun.javafx.geom.PathIterator.getWindingRule.

Returns the winding rule for determining the interior of the path.

Returns:int

the winding rule of the original unflattened path being iterated over.

Annotations
@Override
See Also
PathIterator#WIND_EVEN_ODD, PathIterator#WIND_NON_ZERO
isDoneback to summary
public boolean isDone()

Implements com.sun.javafx.geom.PathIterator.isDone.

Tests if the iteration is complete.

Returns:boolean

true if all the segments have been read; false otherwise.

Annotations
@Override
nextback to summary
public void next()

Implements com.sun.javafx.geom.PathIterator.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.

Annotations
@Override
nextback to summary
private void next(boolean doNext)