Package org.robolectric.shadows
Class CachedPathIteratorFactory.CachedPathIterator
java.lang.Object
org.robolectric.shadows.CachedPathIteratorFactory.CachedPathIterator
- All Implemented Interfaces:
PathIterator
- Enclosing class:
- CachedPathIteratorFactory
public class CachedPathIteratorFactory.CachedPathIterator extends Object implements PathIterator
Class that allows us to iterate over a path multiple times
-
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 -
Method Summary
Modifier and Type Method Description intcurrentSegment(double[] coords)intcurrentSegment(float[] coords)intcurrentSegment(float[] coords, float length)Returns the current segment up to certain length.voidgetCurrentSegmentEnd(float[] point)Returns the point where the current segment endsfloatgetCurrentSegmentLength()floatgetTotalLength()Returns the total length of the pathintgetWindingRule()booleanisDone()voidjumpToSegment(float length)Restarts the iterator and jumps all the segments of this path up to the length value.voidnext()
-
Method Details
-
getCurrentSegmentLength
public float getCurrentSegmentLength() -
getWindingRule
public int getWindingRule()- Specified by:
getWindingRulein interfacePathIterator
-
isDone
public boolean isDone()- Specified by:
isDonein interfacePathIterator
-
next
public void next()- Specified by:
nextin interfacePathIterator
-
currentSegment
public int currentSegment(float[] coords)- Specified by:
currentSegmentin interfacePathIterator
-
currentSegment
public int currentSegment(double[] coords)- Specified by:
currentSegmentin interfacePathIterator
-
getCurrentSegmentEnd
public void getCurrentSegmentEnd(float[] point)Returns the point where the current segment ends -
jumpToSegment
public void jumpToSegment(float length)Restarts the iterator and jumps all the segments of this path up to the length value. -
currentSegment
public int currentSegment(float[] coords, float length)Returns the current segment up to certain length. If the current segment is shorter than length, then the whole segment is returned. The segment coordinates are copied into the coords array.- Returns:
- the segment type
-
getTotalLength
public float getTotalLength()Returns the total length of the path
-