A simple implemenation of an
IMutablePortCollection
that is backed by a list.
count:uint [read-only]Implementation
public function get count():uint
protected var _nodeModel:INode
public function ListPortModel(nodeModel:INode, ports:List = null)
Constructor.
Parameters
| nodeModel:INode — A node as model (used for port creation).
|
| |
| ports:List (default = null) — The List implementation to use. If none is provided, a new ArrayList will be used.
|
public function add(port:IPort, pos:int = -1):void
Adds a port to the list at the given index.
Parameters
| port:IPort — The port to add.
|
| |
| pos:int (default = -1) — The index to add the port at. If -1, the port will be appended to the list.
|
public function addRelative(x:Number, y:Number, pos:int = -1):IPort
Create and add a new port with relative location x and y
at the specific list index pos
Parameters
| x:Number — The relative x coordinate of the new port
|
| |
| y:Number — The relative y coordinate of the new port
|
| |
| pos:int (default = -1) — The list index for the new port. If -1, the new port will be appended.
|
Returns
| IPort —
A newly created port at the given relative location
|
protected function createCenterAnchoredPort(x:Number, y:Number):DefaultPort
Creates a new port which will be at the given offset relative to the node's center.
Parameters
| x:Number — The x offset.
|
| |
| y:Number — The y offset.
|
Returns
public function getPort(index:uint):IPort
Gets the port at the given index.
Parameters
Returns
| IPort —
The port at the given index.
|
public function iterator():Iterator
Returns an Iterator over the ports in the list.
Returns
| Iterator —
An Iterator over the ports in the list.
|
public function removePort(port:IPort):void
Remove the specified port from the collection.
Parameters
| port:IPort — The port to be removed.
|
public function removePortAt(index:uint):void
Remove the port with the specified list index from the collection.
Parameters
| index:uint — The list index to be cleared.
|