org.jhotdraw.geom
Class Polygon2D.PolygonPathIteratorFloat

java.lang.Object
  extended by org.jhotdraw.geom.Polygon2D.PolygonPathIteratorFloat
All Implemented Interfaces:
java.awt.geom.PathIterator
Enclosing class:
Polygon2D

static class Polygon2D.PolygonPathIteratorFloat
extends java.lang.Object
implements java.awt.geom.PathIterator


Field Summary
(package private)  int index
           
(package private)  Polygon2D.Float poly
           
(package private)  java.awt.geom.AffineTransform transform
           
 
Fields inherited from interface java.awt.geom.PathIterator
SEG_CLOSE, SEG_CUBICTO, SEG_LINETO, SEG_MOVETO, SEG_QUADTO, WIND_EVEN_ODD, WIND_NON_ZERO
 
Constructor Summary
Polygon2D.PolygonPathIteratorFloat(Polygon2D.Float pg, java.awt.geom.AffineTransform at)
           
 
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.
 int getWindingRule()
          Returns 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 forwards, along the primary direction of traversal, to the next segment of the path when 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
 

Field Detail

poly

Polygon2D.Float poly

transform

java.awt.geom.AffineTransform transform

index

int index
Constructor Detail

Polygon2D.PolygonPathIteratorFloat

public Polygon2D.PolygonPathIteratorFloat(Polygon2D.Float pg,
                                          java.awt.geom.AffineTransform at)
Method Detail

getWindingRule

public int getWindingRule()
Returns the winding rule for determining the interior of the path.

Specified by:
getWindingRule in interface java.awt.geom.PathIterator
Returns:
an integer representing the current winding rule.
See Also:
PathIterator.WIND_NON_ZERO

isDone

public boolean isDone()
Tests if there are more points to read.

Specified by:
isDone in interface java.awt.geom.PathIterator
Returns:
true if there are more points to read; false otherwise.

next

public void next()
Moves the iterator forwards, along the primary direction of traversal, to the next segment of the path when there are more points in that direction.

Specified by:
next in interface java.awt.geom.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 2 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.

Specified by:
currentSegment in interface java.awt.geom.PathIterator
Parameters:
coords - a float array that specifies the coordinates of the point(s)
Returns:
an integer representing the type and coordinates of the current path segment.
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 2 must be passed in and can 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 return one point, and SEG_CLOSE does not return any points.

Specified by:
currentSegment in interface java.awt.geom.PathIterator
Parameters:
coords - a double array that specifies the coordinates of the point(s)
Returns:
an integer representing the type and coordinates of the current path segment.
See Also:
PathIterator.SEG_MOVETO, PathIterator.SEG_LINETO, PathIterator.SEG_CLOSE