Packagetwaver
Classpublic class Element
InheritanceElement Inheritance Data Inheritance flash.events.EventDispatcher
Implements IElement
Subclasses Dummy, Link, Node

This is the class defines a business object that managed by element box. Element is a simple plain class with properties and styles. All other business objects like node, link, dummy are all subclasses of this class.

Element extends from Data and extends layer and alarm state properties. Also element has the XML serialization ability.



Public Properties
 PropertyDefined By
  alarmState : AlarmState
[read-only] Get alarm state object of this element.
Element
 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
[read-only] Get element ui class name.
Element
 InheritedhasChildren : Boolean
[read-only] Check whether this data has children objects.
Data
 Inheritedicon : String
Get icon value for this data.
Data
 Inheritedid : Object
[read-only] Get the ID value of this data.
Data
  layerID : Object
Get layer ID of this element.
Element
 Inheritedname : String
Get name of this data.
Data
 Inheritedparent : IData
Get parent data object.
Data
  styleProperties : ICollection
[read-only] Get a ICollection that contians all style proerty name.
Element
 InheritedtoolTip : String
Get the tooltip text of this data.
Data
Public Methods
 MethodDefined By
  
Element(id:Object = null)
Constructor
Element
 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
  
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
  
getPropertyValue(property:String):Object
[override] Get an user defined property on this data.
Element
  
getStyle(styleProp:String, returnDefaultIfNull:Boolean = true):*
Get the specified style property value.
Element
 Inherited
hasOwnProperty(name:String):Boolean
Whether this data has specified property.
Data
  
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
Element
 Inherited
setClient(clientProp:String, newValue:*):IClient
Set client property for this data.
Data
  
setPropertyValue(property:String, value:Object):void
[override] Set an user defined property on this data.
Element
  
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
Protected Methods
 MethodDefined By
 Inherited
deserializeClient(serializer:XMLSerializer, clientXML:XML, clientProp:String):void
Deserialize client property from given XML data.
Data
  
deserializeProperty(serializer:XMLSerializer, propertyXML:XML, property:String):void
[override] inheritDoc
Element
  
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
 Inherited
onParentChanged(oldParent:IData, newParent:IData):void
Called back when data parent changed.
Data
 Inherited
onPropertyChanged(property:String, oldValue:Object, newValue:Object):void
Called back when a property of this data is changed.
Data
  
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
  
serializeStyle(serializer:XMLSerializer, stylePrope:String, newInstance:IData):void
Serialize specified property into XML.
Element
Property Detail
alarmStateproperty
alarmState:AlarmState  [read-only]

Get alarm state object of this element. Alarm state is used to store alarm information for this element.


Implementation
    public function get alarmState():AlarmState

See also

elementUIClassproperty 
elementUIClass:Class  [read-only]

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
layerIDproperty 
layerID:Object

Get layer ID of this element. If null, element will in the default layer.


Implementation
    public function get layerID():Object
    public function set layerID(value:Object):void

See also

stylePropertiesproperty 
styleProperties:ICollection  [read-only]

Get a ICollection that contians all style proerty name.


Implementation
    public function get styleProperties():ICollection
Constructor Detail
Element()Constructor
public function Element(id:Object = null)

Constructor

Parameters
id:Object (default = null) — ID of this element.
Method Detail
deserializeProperty()method
override protected function deserializeProperty(serializer:XMLSerializer, propertyXML:XML, property:String):void

inheritDoc

Parameters

serializer:XMLSerializer
 
propertyXML:XML
 
property:String

deserializeStyle()method 
protected function deserializeStyle(serializer:XMLSerializer, styleXML:XML, styleProp:String):void

Deserialize style from given XML data.

Parameters

serializer:XMLSerializer — the XML serializer.
 
styleXML:XML — the XML data contains style data.
 
styleProp:String — style property name.

deserializeXML()method 
override public function deserializeXML(serializer:XMLSerializer, xml:XML):void

inheritDoc

Parameters

serializer:XMLSerializer
 
xml:XML

getPropertyValue()method 
override public function getPropertyValue(property:String):Object

Get an user defined property on this data.

Parameters

property:String — the property name need to get.

Returns
Object — property value of specified property.
getStyle()method 
public function getStyle(styleProp:String, returnDefaultIfNull:Boolean = true):*

Get the specified style property value.

Parameters

styleProp:String — the style property name
 
returnDefaultIfNull:Boolean (default = true) — whether return default value if this style is null. default is true.

Returns
* — the style value.
isAdjustedToBottom()method 
public function isAdjustedToBottom():Boolean

Check whether this element has been adjusted to bottom.

Returns
Boolean — true if has been adjusted to bottom, false otherwise.
onStyleChanged()method 
protected function onStyleChanged(styleProp:String, oldValue:*, newValue:*):void

Called when style property is changed.

Parameters

styleProp:String — the style property name.
 
oldValue:* — the old value before change
 
newValue:* — the new value after change.

serializeStyle()method 
protected function serializeStyle(serializer:XMLSerializer, stylePrope:String, newInstance:IData):void

Serialize specified property into XML.

Parameters

serializer:XMLSerializer — the XML serializer.
 
stylePrope:String — the property name need to serialize
 
newInstance:IData — a new instance with default values which is needed during the serialization.

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

inheritDoc

Parameters

serializer:XMLSerializer
 
newInstance:IData

setPropertyValue()method 
override public function setPropertyValue(property:String, value:Object):void

Set an user defined property on this data. If property not exist, then create; otherwise, replace it.

Parameters

property:String — the property name to be set.
 
value:Object — the value of this property.

setStyle()method 
public function setStyle(styleProp:String, newValue:*):IStyle

Set a style for this element.

Parameters

styleProp:String — the style property name.
 
newValue:* — the style value.

Returns
IStyle — this element itself.