Packagecom.yworks.canvas.geom
Classpublic class ControlPoints
InheritanceControlPoints Inheritance Object
Implements IControlPoints, IMutableControlPoints

A array based implementation of mutable IControlPoints



Public Properties
 PropertyDefined By
  count : uint
[read-only] Returns the number of elements in this collection.
ControlPoints
Public Methods
 MethodDefined By
  
ControlPoints(initialCapacity:int = 0)
Creates a new ControlPoints instance with an initial capacity
ControlPoints
  
add(index:uint, x:Number, y:Number):IPoint
Adds a point to the list at the given index using the provided coordinates.
ControlPoints
  
clear():void
Removes all points from this list.
ControlPoints
  
Returns a mutable view of one of the point in this list.
ControlPoints
  
getPointAt(index:uint):IPoint
Returns the i-th point in the list.
ControlPoints
  
Returns an iterator over a set of elements.
ControlPoints
  
push(p:IPoint):void
Adds the point to the end of the list.
ControlPoints
  
remove(index:uint):void
Removes the point at the given index.
ControlPoints
  
setLocation(index:uint, x:Number, y:Number):void
Sets the coordinates of a point in the list.
ControlPoints
Property Detail
countproperty
count:uint  [read-only]

Returns the number of elements in this collection.


Implementation
    public function get count():uint
Constructor Detail
ControlPoints()Constructor
public function ControlPoints(initialCapacity:int = 0)

Creates a new ControlPoints instance with an initial capacity

Parameters
initialCapacity:int (default = 0) — the initial capacity of this instance
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.

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 a set of elements.

Returns
Iterator — an Iterator.
push()method 
public function push(p:IPoint):void

Adds the point to the end of the list.

Parameters

p:IPoint

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.