The Physiologist's Friend Simulation API

ch.unizh.ini.friend.graphics
Class ConvexPolygonIterator

java.lang.Object
  extended by ch.unizh.ini.friend.graphics.ConvexPolygonIterator
All Implemented Interfaces:
PathIterator

public class ConvexPolygonIterator
extends Object
implements PathIterator

ConvexPolygonIterator implements the PathIterator interface for ConvexPolygon. Changes on the corresponding instance of ConvexPolygon during the iteration are currently not supported!

Version:
$Revision: 1.3 $
Author:
Christof Marti

Field Summary
 
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
ConvexPolygonIterator(ConvexPolygon source)
          Constructor yielding an instance that iterates along the given polygon.
 
Method Summary
 int currentSegment(double[] values)
          Fills the array with coordinates and returns the type of the current segment.
 int currentSegment(float[] values)
          Fills the array with coordinates and returns the type of the current segment.
 int getWindingRule()
          Returns the winding rule for determining the interior of the path.
 boolean isDone()
          Returns true iff the end of the iteration is reached.
 void next()
          Moves the iterator to the next segment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConvexPolygonIterator

public ConvexPolygonIterator(ConvexPolygon source)
Constructor yielding an instance that iterates along the given polygon.

Parameters:
source - Instance of ConvexPolygon this iterator will use.
Method Detail

currentSegment

public int currentSegment(double[] values)
Fills the array with coordinates and returns the type of the current segment.

Specified by:
currentSegment in interface PathIterator
Parameters:
values - The array that will be filled with coordinates of the current segment.
Returns:
The type of the current segment.
See Also:
PathIterator

currentSegment

public int currentSegment(float[] values)
Fills the array with coordinates and returns the type of the current segment.

Specified by:
currentSegment in interface PathIterator
Parameters:
values - The array that will be filled with coordinates of the current segment.
Returns:
The type of the current segment.
See Also:
PathIterator

getWindingRule

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

Specified by:
getWindingRule in interface PathIterator
Returns:
The winding rule.
See Also:
PathIterator

isDone

public boolean isDone()
Returns true iff the end of the iteration is reached.

Specified by:
isDone in interface PathIterator
Returns:
True iff the end of the iteration is reached.

next

public void next()
Moves the iterator to the next segment.

Specified by:
next in interface PathIterator

http://www.ini.unizh.ch/~tobi/friend