Packagecom.yworks.canvas.geom
Classpublic class ArrayControlPoints
InheritanceArrayControlPoints Inheritance Object
Implements IMutableControlPoints

An ArrayList based implementation of mutable IControlPoints.



Public Properties
 PropertyDefined By
  count : uint
[read-only] Returns the number of elements in this collection.
ArrayControlPoints
Public Methods
 MethodDefined By
  
Creates an instance from the given points iterator.
ArrayControlPoints
  
add(index:uint, x:Number, y:Number):IPoint
Adds a point to the list at the given index using the provided coordinates.
ArrayControlPoints
  
clear():void
Removes all points from this list.
ArrayControlPoints
  
Returns a mutable view of one of the point in this list.
ArrayControlPoints
  
getPointAt(index:uint):IPoint
Returns the i-th point in the list.
ArrayControlPoints
  
Returns an iterator over the points in the list.
ArrayControlPoints
  
remove(index:uint):void
Removes the point at the given index.
ArrayControlPoints
  
setLocation(index:uint, x:Number, y:Number):void
Sets the coordinates of a point in the list.
ArrayControlPoints
Protected Methods
 MethodDefined By
  
createPoint(x:Number, y:Number):IPoint
Factory method that creates a new point for the given coordinates.
ArrayControlPoints
Property Detail
countproperty
count:uint  [read-only]

Returns the number of elements in this collection.


Implementation
    public function get count():uint
Constructor Detail
ArrayControlPoints()Constructor
public function ArrayControlPoints(points:Iterator = null)

Creates an instance from the given points iterator.

Parameters
points:Iterator (default = null) — The points to include in the collection.
Method Detail
add()method
public function add(index:uint, x:Number, y:Number):IPoint

Adds a point to the list at the given index using the provided coordinates.

Parameters

index:uint — The index the point should be insterted at.
 
x:Number — The x coordinate of the newly created point.
 
y:Number — The y coordinate of the newly created point.

Returns
IPoint — The point created.
clear()method 
public function clear():void

Removes all points from this list.

createPoint()method 
protected function createPoint(x:Number, y:Number):IPoint

Factory method that creates a new point for the given coordinates.

Parameters

x:Number — The x coordinate of the point to create.
 
y:Number — The y coordinate of the point to create.

Returns
IPoint — A newly created point with the given coordinates.
getMutablePoint()method 
public function getMutablePoint(index:uint):IMutablePoint

Returns a mutable view of one of the point in this list.

Parameters

index:uint — The index of the point to return.

Returns
IMutablePoint — A IMutablePoint view of the point in the list.
getPointAt()method 
public function getPointAt(index:uint):IPoint

Returns the i-th point in the list.

Parameters

index:uint — The zero-based index of the item in this list

Returns
IPoint — The item for the given index
iterator()method 
public function iterator():Iterator

Returns an iterator over the points in the list.

Returns
Iterator
remove()method 
public function remove(index:uint):void

Removes the point at the given index.

Parameters

index:uint — The index of the point to remove.

setLocation()method 
public function setLocation(index:uint, x:Number, y:Number):void

Sets the coordinates of a point in the list.

Parameters

index:uint — The index of the point to set the coordinates.
 
x:Number — The new x coordinate.
 
y:Number — The new y coordinate.