Packagetwaver
Classpublic class Node
InheritanceNode Inheritance Element Inheritance Data Inheritance flash.events.EventDispatcher
Subclasses Follower, RotatableNode

Node is the most often used element in TWaver Flex elements. Node is an abstract "node" on telecom network topology. Typically, node displays an image picture at a location with a label, alarm bubble, message text or icon attachments and more information. Node and its subclasses can be the terminal point of a link. Any network element or equipment on telecom network can be represented by a node, such as a server, PC, router, multiplexer, switch etc.
	 var node:Node = new Node();
	 node.image = "router2Icon";
	 node.name = "STB";
	 node.location = new Point(614, 122);
	 
	 //...
	 
	 box.add(node);
	 



Public Properties
 PropertyDefined By
  agentLinks : ICollection
[read-only] Get all agential links of this node.
Node
 InheritedalarmState : AlarmState
[read-only] Get alarm state object of this element.
Element
  centerLocation : Point
Get the location of this node's center point.
Node
 Inheritedchildren : ICollection
[read-only] Get all children data objects of this data object.
Data
 InheritedchildrenCount : int
[read-only] Get all children total count for this data.
Data
 InheritedclientProperties : ICollection
[read-only] Get a ICollection that contians all client proerty name.
Data
  elementUIClass : Class
[override] [read-only] Get element ui class name.
Node
  followers : ICollection
[read-only] Get all followers of this node with a collection.
Node
  fromAgentLinks : ICollection
[read-only] Get all agential from/start links of this node with a collection.
Node
  fromLinks : ICollection
[read-only] Get all links start from this node.
Node
 InheritedhasChildren : Boolean
[read-only] Check whether this data has children objects.
Data
  height : Number
Get node height value.
Node
 Inheritedicon : String
Get icon value for this data.
Data
 Inheritedid : Object
[read-only] Get the ID value of this data.
Data
  image : String
Get image url of this node.
Node
 InheritedlayerID : Object
Get layer ID of this element.
Element
  links : ICollection
[read-only] Get all connected links of this node with a collection.
Node
  location : Point
Get location of this node.
Node
  loopedLinks : ICollection
[read-only] Get all looped links on this node with a collection.
Node
 Inheritedname : String
Get name of this data.
Data
 Inheritedparent : IData
Get parent data object.
Data
  rect : Rectangle
[read-only] Get node bounds.
Node
  size : Size
[read-only] Get node size.
Node
 InheritedstyleProperties : ICollection
[read-only] Get a ICollection that contians all style proerty name.
Element
  toAgentLinks : ICollection
[read-only] Get all agential to/end links of this node with a collection.
Node
  toLinks : ICollection
[read-only] Get all to/end links end to this node.
Node
 InheritedtoolTip : String
Get the tooltip text of this data.
Data
  width : Number
Get node width.
Node
  x : Number
[read-only] Get x location of this node.
Node
  y : Number
[read-only] Get y location of this node.
Node
Public Methods
 MethodDefined By
  
Node(id:Object = null)
Constructor.
Node
 Inherited
addChild(child:IData, index:int = -1):Boolean
Add a child data object for this data.
Data
 Inherited
addPropertyChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add a property change listener to this data to monitoring property change event.
Data
 Inherited
clearChildren():Boolean
Clear all children from this data.
Data
 Inherited
deserializeXML(serializer:XMLSerializer, xml:XML):void
[override] inheritDoc
Element
 Inherited
dispatchPropertyChangeEvent(property:String, oldValue:Object, newValue:Object):Boolean
Dispatch property change event to all installed listeners.
Data
 Inherited
getChildAt(index:int):IData
Get child as specified index location.
Data
 Inherited
getClient(clientProp:String):*
Get specified client property value.
Data
 Inherited
getPropertyValue(property:String):Object
[override] Get an user defined property on this data.
Element
 Inherited
getStyle(styleProp:String, returnDefaultIfNull:Boolean = true):*
Get the specified style property value.
Element
  
hasAgentLinks():Boolean
Check whether this node has agential links.
Node
 Inherited
hasOwnProperty(name:String):Boolean
Whether this data has specified property.
Data
 Inherited
Check whether this element has been adjusted to bottom.
Element
 Inherited
isDescendantOf(data:IData):Boolean
Check whether this data is a descendant of the specified data object.
Data
 Inherited
isParentOf(data:IData):Boolean
Check whether this data is the parent of specified data.
Data
 Inherited
isRelatedTo(data:IData):Boolean
Check whether this data has descendant relationship with the specified data.
Data
 Inherited
removeChild(child:IData):Boolean
Remove the specified child object.
Data
 Inherited
removePropertyChangeListener(listener:Function):void
Remove the specified property change listener.
Data
  
serializeXML(serializer:XMLSerializer, newInstance:IData):void
[override] inheritDoc
Node
  
setCenterLocation(x:Number, y:Number):void
Set a new location for this node's center point.
Node
 Inherited
setClient(clientProp:String, newValue:*):IClient
Set client property for this data.
Data
  
setLocation(x:Number, y:Number):void
Set a new location for this node.
Node
 Inherited
setPropertyValue(property:String, value:Object):void
[override] Set an user defined property on this data.
Element
  
setSize(width:Number, height:Number):void
Set node size.
Node
 Inherited
setStyle(styleProp:String, newValue:*):IStyle
Set a style for this element.
Element
 Inherited
toChildren(matchFunction:Function = null):ICollection
Iterate children collection by given callback function.
Data
 Inherited
toString():String
[override]
Data
  
translate(dx:Number, dy:Number):void
Translate node location to specified offset.
Node
Protected Methods
 MethodDefined By
 Inherited
deserializeClient(serializer:XMLSerializer, clientXML:XML, clientProp:String):void
Deserialize client property from given XML data.
Data
 Inherited
deserializeProperty(serializer:XMLSerializer, propertyXML:XML, property:String):void
[override] inheritDoc
Element
 Inherited
deserializeStyle(serializer:XMLSerializer, styleXML:XML, styleProp:String):void
Deserialize style from given XML data.
Element
 Inherited
onChildAdded(child:IData, index:int):void
Called back when a child is added.
Data
 Inherited
onChildRemoved(child:IData, index:int):void
Called back when a child is removed.
Data
 Inherited
onChildrenCleared(children:Array):void
Called back when all children are cleared from this data.
Data
 Inherited
onClientChanged(styleProp:String, oldValue:*, newValue:*):void
Called when client property is changed.
Data
  
onParentChanged(oldParent:IData, newParent:IData):void
[override] Called back when data parent changed.
Node
  
onPropertyChanged(property:String, oldValue:Object, newValue:Object):void
[override] Called back when a property of this data is changed.
Node
 Inherited
onStyleChanged(styleProp:String, oldValue:*, newValue:*):void
Called when style property is changed.
Element
 Inherited
serializeClient(serializer:XMLSerializer, clientPrope:String, newInstance:IData):void
Serialize given client property into the specified XML serializer.
Data
 Inherited
serializeProperty(serializer:XMLSerializer, property:String, newInstance:IData):void
Serialize given property into the specified XML serializer.
Data
 Inherited
serializeStyle(serializer:XMLSerializer, stylePrope:String, newInstance:IData):void
Serialize specified property into XML.
Element
Property Detail
agentLinksproperty
agentLinks:ICollection  [read-only]

Get all agential links of this node.


Implementation
    public function get agentLinks():ICollection
centerLocationproperty 
centerLocation:Point

Get the location of this node's center point.


Implementation
    public function get centerLocation():Point
    public function set centerLocation(value:Point):void
elementUIClassproperty 
elementUIClass:Class  [read-only] [override]

Get element ui class name. UI class is used to paint/draw element on network canvas. TWaver Flex will create UI object for the element instance by this returned class name.


Implementation
    public function get elementUIClass():Class
followersproperty 
followers:ICollection  [read-only]

Get all followers of this node with a collection.


Implementation
    public function get followers():ICollection
fromAgentLinksproperty 
fromAgentLinks:ICollection  [read-only]

Get all agential from/start links of this node with a collection.


Implementation
    public function get fromAgentLinks():ICollection
fromLinksproperty 
fromLinks:ICollection  [read-only]

Get all links start from this node.


Implementation
    public function get fromLinks():ICollection
heightproperty 
height:Number

Get node height value.


Implementation
    public function get height():Number
    public function set height(value:Number):void
imageproperty 
image:String

Get image url of this node. This image will be cached by TWaver and displays on network canvas.


Implementation
    public function get image():String
    public function set image(value:String):void
linksproperty 
links:ICollection  [read-only]

Get all connected links of this node with a collection.


Implementation
    public function get links():ICollection
locationproperty 
location:Point

Get location of this node.


Implementation
    public function get location():Point
    public function set location(value:Point):void
loopedLinksproperty 
loopedLinks:ICollection  [read-only]

Get all looped links on this node with a collection.


Implementation
    public function get loopedLinks():ICollection
rectproperty 
rect:Rectangle  [read-only]

Get node bounds.


Implementation
    public function get rect():Rectangle
sizeproperty 
size:Size  [read-only]

Get node size.


Implementation
    public function get size():Size
toAgentLinksproperty 
toAgentLinks:ICollection  [read-only]

Get all agential to/end links of this node with a collection.


Implementation
    public function get toAgentLinks():ICollection
toLinksproperty 
toLinks:ICollection  [read-only]

Get all to/end links end to this node.


Implementation
    public function get toLinks():ICollection
widthproperty 
width:Number

Get node width.


Implementation
    public function get width():Number
    public function set width(value:Number):void
xproperty 
x:Number  [read-only]

Get x location of this node.


Implementation
    public function get x():Number
yproperty 
y:Number  [read-only]

Get y location of this node.


Implementation
    public function get y():Number
Constructor Detail
Node()Constructor
public function Node(id:Object = null)

Constructor.

Parameters
id:Object (default = null) — the node id used to indicate this node instance.
Method Detail
hasAgentLinks()method
public function hasAgentLinks():Boolean

Check whether this node has agential links.

Returns
Boolean — true if has agential links, false otherwise.
onParentChanged()method 
override protected function onParentChanged(oldParent:IData, newParent:IData):void

Called back when data parent changed. Subclasses could overwrite this method to do something when parent is changed.

Parameters

oldParent:IData — old parent before changed.
 
newParent:IData — new parent after changed.

onPropertyChanged()method 
override protected function onPropertyChanged(property:String, oldValue:Object, newValue:Object):void

Called back when a property of this data is changed.

Parameters

property:String — property name changed
 
oldValue:Object — old value before property change
 
newValue:Object — new value after property change

serializeXML()method 
override public function serializeXML(serializer:XMLSerializer, newInstance:IData):void

inheritDoc

Parameters

serializer:XMLSerializer
 
newInstance:IData

setCenterLocation()method 
public function setCenterLocation(x:Number, y:Number):void

Set a new location for this node's center point. Node on network canvas will be moved to this new location once this location has been changed. Please note that node location is the center point of this node. Use setLocation if you want use the left-top point as the node location.

Parameters

x:Number — the x value of node center location
 
y:Number — the y value of node center location

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

Set a new location for this node. Node on network canvas will be moved to this new location once this location has been changed. Please note that node location is the left-top point of this node. Use setCenterLocation if you want use the node center as the location.

Parameters

x:Number — the x value of location
 
y:Number — the y value of location

setSize()method 
public function setSize(width:Number, height:Number):void

Set node size.

Parameters

width:Number — node width
 
height:Number — node height

translate()method 
public function translate(dx:Number, dy:Number):void

Translate node location to specified offset. New location would be the old location+offset.

Parameters

dx:Number — location translation offset in x axis.
 
dy:Number — location translation offset in y axis.