Package | twaver |
Class | public class ElementBox |
Inheritance | ElementBox ![]() ![]() |
Implements | IStyle |
Element box has too many things need to manage. So it
delegates some tasks to some specific container to do it.
An instance of AlarmBox
is used to manage
all alarm objects for this element box; an instance of
SelectionModel
is used to manage the selection
states for all elements contained in this element box;
an instance of LayerBox
is used to manage
all layers for element box. You can visit all these
instances and invoke API on it to do the specific tasks.
Element box contains all element data and drives all connected graphical views like network, tree, table and other components. An element box can drive more than one components to share data for these views. These code can create an element box and connect to a network component:
var box:ElementBox = new ElementBox(); var node:Node = new Node(); box.add(node); //create network and connect to box. var network:Network = new Network(box); //or: var network:Network = new Network(); network.elementBox = box;
Property | Defined By | ||
---|---|---|---|
alarmBox : AlarmBox [read-only]
Get alarm box instance of this element box. | ElementBox | ||
alarmStatePropagator : AlarmStatePropagator [read-only]
Get alarm state propagator. | ElementBox | ||
![]() | clientProperties : ICollection [read-only]
Get a ICollection that contians all client proerty name. | DataBox | |
![]() | count : int [read-only]
Get total data counts contains in this data box. | DataBox | |
![]() | datas : ICollection [read-only]
Get collection of all data inside the data box. | DataBox | |
![]() | icon : String
Get icon value for this data. | DataBox | |
layerBox : LayerBox [read-only]
Get layer box instance of this element box. | ElementBox | ||
![]() | limit : int
Get the limit for this data box. | DataBox | |
![]() | name : String
Get name of this data. | DataBox | |
![]() | roots : ICollection [read-only]
Get all root data objects in this data box. | DataBox | |
![]() | selectionModel : SelectionModel [read-only]
Get selection model of this data box. | DataBox | |
styleProperties : ICollection [read-only]
Get a ICollection that contians all style proerty name. | ElementBox | ||
![]() | toolTip : String
Get the tooltip text of this data. | DataBox |
Method | Defined By | ||
---|---|---|---|
ElementBox(elemnetBoxName:String = ElementBox)
Constructor. | ElementBox | ||
[override]
Add a data into this data box at the specified index location. | ElementBox | ||
![]() | addDataBoxChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add a data box change listener into this data box to monitoring
the property change event. | DataBox | |
![]() | addDataPropertyChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add data property change listener to this data box. | DataBox | |
![]() | addHierarchyChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add a data hierarchical change listener on this data box. | DataBox | |
addIndexChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add an element index change listener. | ElementBox | ||
![]() | addPropertyChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add property change listener into this data box. | DataBox | |
![]() | clear():void
Clear all data objects. | DataBox | |
![]() |
Check whether contains specified data object in this data box. | DataBox | |
![]() | containsByID(id:Object):Boolean
Check whether contains data object with specified ID value. | DataBox | |
deserializeXML(serializer:XMLSerializer, xml:XML):void [override]
Deserialize given XML data to data objects. | ElementBox | ||
![]() | dispatchPropertyChangeEvent(property:String, oldValue:Object, newValue:Object):Boolean
Dispatch property change event to all installed property change listeners. | DataBox | |
![]() | forEach(callbackFunction:Function):void
Iterate all data inside this data box with the specified
call back function. | DataBox | |
![]() | forEachByBreadthFirst(callbackFunction:Function, data:IData = null):void
Iterate all inside data in "breadth-first" rule. | DataBox | |
![]() | forEachByDepthFirst(callbackFunction:Function, data:IData = null):void
Iterate all inside data in "depth-first" rule. | DataBox | |
forEachByLayer(callbackFunction:Function, layer:ILayer = null):void
Iterate all elements by specified call back function and layer. | ElementBox | ||
forEachByLayerReverse(callbackFunction:Function, layer:ILayer = null):void
Iterate elements in specified layer reversely by specified iterate call back function. | ElementBox | ||
![]() | getClient(clientProp:String):*
Get specified client property value. | DataBox | |
![]() | getDataByID(id:Object):IData
Get data object by specified data ID. | DataBox | |
getElementByID(elementID:Object):IElement
Get element by given element ID. | ElementBox | ||
getPropertyValue(property:String):Object [override]
Get specified property value from this data. | ElementBox | ||
![]() | getSiblingIndex(data:IData):int
Get the index of the specified data in all siblings. | DataBox | |
![]() |
Get sibling data collection for specified data instance. | DataBox | |
getStyle(styleProp:String, returnDefaultIfNull:Boolean = true):*
Get the specified style property value. | ElementBox | ||
![]() | hasOwnProperty(name:String):Boolean
Whether this data has specified property. | DataBox | |
![]() | isEmpty():Boolean
Whether this data box is empty (no data). | DataBox | |
![]() |
Move specified data on index lower. | DataBox | |
![]() | moveSelectionDown(sm:SelectionModel = null):void
Move all selected data to lower index location. | DataBox | |
![]() | moveSelectionToBottom(sm:SelectionModel = null):void
Move all selected data to the bottom index location. | DataBox | |
![]() | moveSelectionToTop(sm:SelectionModel = null):void
Move all selected data to the top index location. | DataBox | |
![]() | moveSelectionUp(sm:SelectionModel = null):void
Move all selected data to upper index location. | DataBox | |
![]() |
Move the specified data to the specified index location. | DataBox | |
![]() | moveToBottom(data:IData):void
Move specified data to the bottom index location. | DataBox | |
![]() |
Move specified data to the top index location. | DataBox | |
![]() |
Move specified data one index upper. | DataBox | |
![]() |
Remove specified data from this data box. | DataBox | |
![]() | removeByID(id:Object):void
Remove data by data ID. | DataBox | |
![]() | removeDataBoxChangeListener(listener:Function):void
Remove data box change listener from this data box. | DataBox | |
![]() | removeDataPropertyChangeListener(listener:Function):void
Remove specified data property change listener. | DataBox | |
![]() | removeFirst(count:int = 1):void
Remove the first specified count data objects from this data box. | DataBox | |
![]() | removeHierarchyChangeListener(listener:Function):void
Remove the specified hierarchical change listener from this data box. | DataBox | |
removeIndexChangeListener(listener:Function):void
Remove the specified index change listener from this element box. | ElementBox | ||
![]() | removePropertyChangeListener(listener:Function):void
Remove property change listener from this data box. | DataBox | |
![]() | removeSelection():void
Remove all selected data from this data box. | DataBox | |
resetBundleLinks():void
Reset BundleLinks, invoke it when Defaults.LINK_BUNDLE_AGENT_FUNCTION changed. | ElementBox | ||
[override]
Serialize all data contains in this data box into XML. | ElementBox | ||
![]() |
Set client property for this data. | DataBox | |
setPropertyValue(property:String, value:Object):void [override]
Set specified property name value on this data. | ElementBox | ||
Set a style for this element. | ElementBox | ||
![]() | toDatas(matchFunction:Function = null):ICollection
Create a new collection, put all data inside this collection,
and return this collection. | DataBox | |
![]() | toString():String [override]
| DataBox |
Method | Defined By | ||
---|---|---|---|
![]() | deserializeClient(serializer:XMLSerializer, clientXML:XML, clientProp:String):void
Deserialize client property from given XML data. | DataBox | |
![]() | deserializeProperty(serializer:XMLSerializer, propertyXML:XML, property:String):void
Deserialize specified property from the given XML data contains property value. | DataBox | |
deserializeStyle(serializer:XMLSerializer, styleXML:XML, styleProp:String):void
Deserialize style from given XML data. | ElementBox | ||
![]() | handleImageLoaded(e:ImageLoadEvent):void | DataBox | |
![]() | onClientChanged(styleProp:String, oldValue:*, newValue:*):void
Called when client property is changed. | DataBox | |
onDataPropertyChanged(data:IData, e:PropertyChangeEvent):void [override]
Called back when any data property is changed. | ElementBox | ||
![]() | onPropertyChanged(property:String, oldValue:Object, newValue:Object):void
Called back when a property of this data is changed. | DataBox | |
onStyleChanged(styleProp:String, oldValue:*, newValue:*):void
Called when style property is changed. | ElementBox | ||
![]() |
Serialize the specified client property into XML. | DataBox | |
![]() |
Serialize the specified property into XML. | DataBox | |
Serialize specified style property into XML. | ElementBox |
alarmBox | property |
alarmBox:AlarmBox
[read-only] Get alarm box instance of this element box. Alarm box is used to manage all alarm objects for this element box.
public function get alarmBox():AlarmBox
alarmStatePropagator | property |
alarmStatePropagator:AlarmStatePropagator
[read-only] Get alarm state propagator. The alarm sate propagator is used to propagate alarm state to the business related elements when alarm is occured. By default implementation, TWaver Flex will propagate alarm to the source element's parent, if has, until to null.
public function get alarmStatePropagator():AlarmStatePropagator
See also
layerBox | property |
layerBox:LayerBox
[read-only] Get layer box instance of this element box. Layer box is used to manage all layers for element box.
public function get layerBox():LayerBox
styleProperties | property |
styleProperties:ICollection
[read-only] Get a ICollection that contians all style proerty name.
public function get styleProperties():ICollection
ElementBox | () | Constructor |
public function ElementBox(elemnetBoxName:String = ElementBox)
Constructor. This will create an element box with given element box name.
ParameterselemnetBoxName:String (default = ElementBox ) — the element box name. This will
displays on tree component as the root node, if the root
node of the tree is visible.
|
add | () | method |
override public function add(data:IData, index:int = -1):void
Add a data into this data box at the specified index location.
Parameters
data:IData — the data object to be added
| |
index:int (default = -1 ) — the index location need to add
|
addIndexChangeListener | () | method |
public function addIndexChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add an element index change listener. It will be notified when any element index are changed.
Parameters
listener:Function — the listener to be added
| |
priority:int (default = 0 ) — listener priority
| |
useWeakReference:Boolean (default = false ) — whether use weak reference, default value is false.
|
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
Deserialize given XML data to data objects.
Parameters
serializer:XMLSerializer — XML serializer
| |
xml:XML — the XML data contains data objects.
|
forEachByLayer | () | method |
public function forEachByLayer(callbackFunction:Function, layer:ILayer = null):void
Iterate all elements by specified call back function and layer. If layer is null, then all elements will be iterated.
Parameters
callbackFunction:Function — the iterate call back function.
| |
layer:ILayer (default = null ) — the layer that elements to be iterated
|
forEachByLayerReverse | () | method |
public function forEachByLayerReverse(callbackFunction:Function, layer:ILayer = null):void
Iterate elements in specified layer reversely by specified iterate call back function.
Parameters
callbackFunction:Function — iterator.
| |
layer:ILayer (default = null ) — layer object indicate only elements inside will be iterated.
|
getElementByID | () | method |
public function getElementByID(elementID:Object):IElement
Get element by given element ID.
Parameters
elementID:Object — the element id to be get
|
IElement — the element object with specified ID.
|
getPropertyValue | () | method |
override public function getPropertyValue(property:String):Object
Get specified property value from this data. This can be a
client property, or regular property. For client property,
be ware use the Consts.PREFIX_CLIENT
prefix
to identify.
Parameters
property:String — the property name to get.
|
Object — the property value, if has
|
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.
|
onDataPropertyChanged | () | method |
override protected function onDataPropertyChanged(data:IData, e:PropertyChangeEvent):void
Called back when any data property is changed. This default implementation does not do anything. Subclasses can overwrite this method to do something when property changed.
Parameters
data:IData — the source data of the change.
| |
e:PropertyChangeEvent — the property change event contains all property change information.
|
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.
|
removeIndexChangeListener | () | method |
public function removeIndexChangeListener(listener:Function):void
Remove the specified index change listener from this element box.
Parameters
listener:Function — the index change listener to be removed
|
resetBundleLinks | () | method |
public function resetBundleLinks():void
Reset BundleLinks, invoke it when Defaults.LINK_BUNDLE_AGENT_FUNCTION changed.
serializeStyle | () | method |
protected function serializeStyle(serializer:XMLSerializer, stylePrope:String, newInstance:DataBox):void
Serialize specified style property into XML.
Parameters
serializer:XMLSerializer — XML serializer
| |
stylePrope:String — style property name to be serialized
| |
newInstance:DataBox — the new instance will be used during serialization
|
serializeXML | () | method |
override public function serializeXML(serializer:XMLSerializer, newInstance:DataBox):void
Serialize all data contains in this data box into XML.
Parameters
serializer:XMLSerializer — the XML serializer
| |
newInstance:DataBox — a new create data box instance with default values
which will be used to compare each property values of the data box
during the serialization.
|
setPropertyValue | () | method |
override public function setPropertyValue(property:String, value:Object):void
Set specified property name value on this data.
Parameters
property:String — the property name to be set.
| |
value:Object — the property value to be set.
|
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.
|