Package | twaver |
Class | public class Element |
Inheritance | Element ![]() ![]() |
Implements | IElement |
Subclasses | Dummy, Link, Node |
Element extends from Data and extends layer and alarm state properties. Also element has the XML serialization ability.
Property | Defined By | ||
---|---|---|---|
alarmState : AlarmState [read-only]
Get alarm state object of this element. | Element | ||
![]() | children : ICollection [read-only]
Get all children data objects of this data object. | Data | |
![]() | childrenCount : int [read-only]
Get all children total count for this data. | Data | |
![]() | clientProperties : ICollection [read-only]
Get a ICollection that contians all client proerty name. | Data | |
elementUIClass : Class [read-only]
Get element ui class name. | Element | ||
![]() | hasChildren : Boolean [read-only]
Check whether this data has children objects. | Data | |
![]() | icon : String
Get icon value for this data. | Data | |
![]() | id : Object [read-only]
Get the ID value of this data. | Data | |
layerID : Object
Get layer ID of this element. | Element | ||
![]() | name : String
Get name of this data. | Data | |
![]() | parent : IData
Get parent data object. | Data | |
styleProperties : ICollection [read-only]
Get a ICollection that contians all style proerty name. | Element | ||
![]() | toolTip : String
Get the tooltip text of this data. | Data |
Method | Defined By | ||
---|---|---|---|
Element(id:Object = null)
Constructor
| Element | ||
![]() |
Add a child data object for this data. | Data | |
![]() | addPropertyChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add a property change listener to this data to monitoring property
change event. | Data | |
![]() | clearChildren():Boolean
Clear all children from this data. | Data | |
deserializeXML(serializer:XMLSerializer, xml:XML):void [override]
inheritDoc
| Element | ||
![]() | dispatchPropertyChangeEvent(property:String, oldValue:Object, newValue:Object):Boolean
Dispatch property change event to all installed listeners. | Data | |
![]() | getChildAt(index:int):IData
Get child as specified index location. | Data | |
![]() | 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 | ||
![]() | hasOwnProperty(name:String):Boolean
Whether this data has specified property. | Data | |
isAdjustedToBottom():Boolean
Check whether this element has been adjusted to bottom. | Element | ||
![]() | isDescendantOf(data:IData):Boolean
Check whether this data is a descendant of the specified data object. | Data | |
![]() | isParentOf(data:IData):Boolean
Check whether this data is the parent of specified data. | Data | |
![]() | isRelatedTo(data:IData):Boolean
Check whether this data has descendant relationship with the specified data. | Data | |
![]() | removeChild(child:IData):Boolean
Remove the specified child object. | Data | |
![]() | removePropertyChangeListener(listener:Function):void
Remove the specified property change listener. | Data | |
[override]
inheritDoc
| Element | ||
![]() |
Set client property for this data. | Data | |
setPropertyValue(property:String, value:Object):void [override]
Set an user defined property on this data. | Element | ||
Set a style for this element. | Element | ||
![]() | toChildren(matchFunction:Function = null):ICollection
Iterate children collection by given callback function. | Data | |
![]() | toString():String [override]
| Data |
Method | Defined By | ||
---|---|---|---|
![]() | 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 | ||
![]() | onChildAdded(child:IData, index:int):void
Called back when a child is added. | Data | |
![]() | onChildRemoved(child:IData, index:int):void
Called back when a child is removed. | Data | |
![]() | onChildrenCleared(children:Array):void
Called back when all children are cleared from this data. | Data | |
![]() | onClientChanged(styleProp:String, oldValue:*, newValue:*):void
Called when client property is changed. | Data | |
![]() |
Called back when data parent changed. | Data | |
![]() | 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 | ||
![]() |
Serialize given client property into the specified XML serializer. | Data | |
![]() |
Serialize given property into the specified
XML serializer. | Data | |
Serialize specified property into XML. | Element |
alarmState | property |
alarmState:AlarmState
[read-only] Get alarm state object of this element. Alarm state is used to store alarm information for this element.
public function get alarmState():AlarmState
See also
elementUIClass | property |
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.
public function get elementUIClass():Class
layerID | property |
layerID:Object
Get layer ID of this element. If null, element will in the default layer.
public function get layerID():Object
public function set layerID(value:Object):void
See also
styleProperties | property |
styleProperties:ICollection
[read-only] Get a ICollection that contians all style proerty name.
public function get styleProperties():ICollection
Element | () | Constructor |
public function Element(id:Object = null)
Constructor
Parametersid:Object (default = null ) — ID of this element.
|
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.
|
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.
|
* — the style value.
|
isAdjustedToBottom | () | method |
public function isAdjustedToBottom():Boolean
Check whether this element has been adjusted to bottom.
ReturnsBoolean — 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.
|
IStyle — this element itself.
|