Package | com.yworks.canvas.drawing |
Class | public class PathCursor |
Inheritance | PathCursor Object |
GeneralPath
to iterate over the elements
the path is made up of.
After creation or after calling reset()
, the current position is before
the first element.
One has to call next()
or toFirst()
before
accessing the current element.
Property | Defined By | ||
---|---|---|---|
index : int [read-only]
Returns the current position of the cursor. | PathCursor |
Method | Defined By | ||
---|---|---|---|
PathCursor(path:GeneralPath) | PathCursor | ||
getCurrent(coordinates:Array):uint
Places the coordinates for the current type into the given array. | PathCursor | ||
getCurrentEndPoint(coordinates:Array):uint
Places the current end coordinates of the last path element into the array. | PathCursor | ||
getCurrentEndPointX():Number
Returns the current x coordinate of the last path element. | PathCursor | ||
getCurrentEndPointY():Number
Returns the current y coordinate of the last path element. | PathCursor | ||
getPathType():uint
Returns the type of the path at the position of the cursor. | PathCursor | ||
next():Boolean
Advances the cursor to the next position if possible. | PathCursor | ||
previous():Boolean
Moves the cursor to the previous position in the path. | PathCursor | ||
reset():void
Reset the cursor to point to the beginning of the path. | PathCursor | ||
toFirst():Boolean
Sets the cursor to point to the first element in the path. | PathCursor | ||
toLast():Boolean
Sets the cursor to point to the last element in the path. | PathCursor |
index | property |
index:int
[read-only] Returns the current position of the cursor.
public function get index():int
PathCursor | () | Constructor |
getCurrent | () | method |
public function getCurrent(coordinates:Array):uint
Places the coordinates for the current type into the given array.
Parameters
coordinates:Array |
uint — The current PathType of the path element.
|
getCurrentEndPoint | () | method |
public function getCurrentEndPoint(coordinates:Array):uint
Places the current end coordinates of the last path element into the array.
Parameters
coordinates:Array |
uint — The PathType of the current element.
|
getCurrentEndPointX | () | method |
public function getCurrentEndPointX():Number
Returns the current x coordinate of the last path element.
ReturnsNumber — The x coordinate or 0 if the element is of type PathType.CLOSE .
|
getCurrentEndPointY | () | method |
public function getCurrentEndPointY():Number
Returns the current y coordinate of the last path element.
ReturnsNumber — The y coordinate or 0 if the element is of type PathType.CLOSE .
|
getPathType | () | method |
public function getPathType():uint
Returns the type of the path at the position of the cursor.
Returnsuint — The current PathType
|
next | () | method |
public function next():Boolean
Advances the cursor to the next position if possible.
ReturnsBoolean — Whether the cursor has been moved successfully. false if the cursor
has been moved beyond the end of the path.
|
previous | () | method |
public function previous():Boolean
Moves the cursor to the previous position in the path.
If the cursor is already at the first element it will remain there.
ReturnsBoolean — Whether the move was successful.
|
reset | () | method |
public function reset():void
Reset the cursor to point to the beginning of the path.
This moves the current position before the first element. One has to call
next()
before accessing the current element.
toFirst | () | method |
public function toFirst():Boolean
Sets the cursor to point to the first element in the path.
ReturnsBoolean — Whether the cursor has been moved successfully.
|
toLast | () | method |
public function toLast():Boolean
Sets the cursor to point to the last element in the path.
ReturnsBoolean — Whether the cursor has been moved successfully.
|