Packagetwaver
Classpublic class AlarmBox
InheritanceAlarmBox Inheritance DataBox Inheritance flash.events.EventDispatcher

This class is the alarm container used to manage all alarm objects in TWaver. As a important part of ElementBox, AlarmBox must stay with an ElementBox instance. You can consider AlarmBox as a sub-container of ElementBox managing all alarms ocurred on the elements of the ElementBox.

All ElementBox has an AlarmBox instance which is created when creating an ElementBox. To use AlarmBox, just create alarm objects and add into AlarmBox then the alarm will be displayed on the views connected to ElementBox. Here is an example:

	 var alarm:Alarm = new Alarm();
	 ...//set more alarm properties here.
	 box.alarmBox.add(alarm); 
	 

See also

twaver.Alarm
twaver.AlarmSeverity
twaver.AlarmState
twaver.ElementBox


Public Properties
 PropertyDefined By
  alarmElementMapping : IAlarmElementMapping
Get the alarm-elemen mapping object.
AlarmBox
 InheritedclientProperties : ICollection
[read-only] Get a ICollection that contians all client proerty name.
DataBox
 Inheritedcount : int
[read-only] Get total data counts contains in this data box.
DataBox
 Inheriteddatas : ICollection
[read-only] Get collection of all data inside the data box.
DataBox
  elementBox : ElementBox
[read-only] Get the element box this alarm box connect to.
AlarmBox
 Inheritedicon : String
Get icon value for this data.
DataBox
 Inheritedlimit : int
Get the limit for this data box.
DataBox
 Inheritedname : String
Get name of this data.
DataBox
  removeAlarmWhenAlarmIsCleared : Boolean
Indicates whether the alarm object will be removed from alarm box when this alarm severity/status is changed to "cleared".
AlarmBox
  removeAlarmWhenElementIsRemoved : Boolean
The flag value indicates that whether all alarms occured on an element need to be removed as well when the element is removed from the element box.
AlarmBox
 Inheritedroots : ICollection
[read-only] Get all root data objects in this data box.
DataBox
 InheritedselectionModel : SelectionModel
[read-only] Get selection model of this data box.
DataBox
 InheritedtoolTip : String
Get the tooltip text of this data.
DataBox
Public Methods
 MethodDefined By
  
AlarmBox(elementBox:ElementBox)
Constructor of AlarmBox.
AlarmBox
  
add(data:IData, index:int = -1):void
[override] Add a data into this data box at the specified index location.
AlarmBox
 Inherited
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
 Inherited
addDataPropertyChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add data property change listener to this data box.
DataBox
 Inherited
addHierarchyChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add a data hierarchical change listener on this data box.
DataBox
 Inherited
addPropertyChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add property change listener into this data box.
DataBox
 Inherited
clear():void
Clear all data objects.
DataBox
 Inherited
contains(data:IData):Boolean
Check whether contains specified data object in this data box.
DataBox
 Inherited
containsByID(id:Object):Boolean
Check whether contains data object with specified ID value.
DataBox
 Inherited
deserializeXML(serializer:XMLSerializer, xml:XML):void
Deserialize given XML data to data objects.
DataBox
 Inherited
dispatchPropertyChangeEvent(property:String, oldValue:Object, newValue:Object):Boolean
Dispatch property change event to all installed property change listeners.
DataBox
 Inherited
forEach(callbackFunction:Function):void
Iterate all data inside this data box with the specified call back function.
DataBox
 Inherited
forEachByBreadthFirst(callbackFunction:Function, data:IData = null):void
Iterate all inside data in "breadth-first" rule.
DataBox
 Inherited
forEachByDepthFirst(callbackFunction:Function, data:IData = null):void
Iterate all inside data in "depth-first" rule.
DataBox
  
getAlarmByID(alarmID:Object):IAlarm
Get an alarm object by the given alarm ID.
AlarmBox
 Inherited
getClient(clientProp:String):*
Get specified client property value.
DataBox
  
Get the corresponding alarms of the given element, that is, all alarms occured on this element object.
AlarmBox
  
Get all corresponding elements by given the alarm object.
AlarmBox
 Inherited
getDataByID(id:Object):IData
Get data object by specified data ID.
DataBox
 Inherited
getPropertyValue(property:String):Object
Get specified property value from this data.
DataBox
 Inherited
Get the index of the specified data in all siblings.
DataBox
 Inherited
Get sibling data collection for specified data instance.
DataBox
 Inherited
hasOwnProperty(name:String):Boolean
Whether this data has specified property.
DataBox
 Inherited
isEmpty():Boolean
Whether this data box is empty (no data).
DataBox
 Inherited
moveDown(data:IData):void
Move specified data on index lower.
DataBox
 Inherited
Move all selected data to lower index location.
DataBox
 Inherited
Move all selected data to the bottom index location.
DataBox
 Inherited
Move all selected data to the top index location.
DataBox
 Inherited
Move all selected data to upper index location.
DataBox
 Inherited
moveTo(data:IData, newIndex:int):void
Move the specified data to the specified index location.
DataBox
 Inherited
moveToBottom(data:IData):void
Move specified data to the bottom index location.
DataBox
 Inherited
moveToTop(data:IData):void
Move specified data to the top index location.
DataBox
 Inherited
moveUp(data:IData):void
Move specified data one index upper.
DataBox
 Inherited
remove(data:IData):void
Remove specified data from this data box.
DataBox
  
Remove all corresponding alarms of given element object.
AlarmBox
 Inherited
removeByID(id:Object):void
Remove data by data ID.
DataBox
 Inherited
removeDataBoxChangeListener(listener:Function):void
Remove data box change listener from this data box.
DataBox
 Inherited
removeDataPropertyChangeListener(listener:Function):void
Remove specified data property change listener.
DataBox
 Inherited
removeFirst(count:int = 1):void
Remove the first specified count data objects from this data box.
DataBox
 Inherited
removeHierarchyChangeListener(listener:Function):void
Remove the specified hierarchical change listener from this data box.
DataBox
 Inherited
removePropertyChangeListener(listener:Function):void
Remove property change listener from this data box.
DataBox
 Inherited
Remove all selected data from this data box.
DataBox
 Inherited
serializeXML(serializer:XMLSerializer, newInstance:DataBox):void
Serialize all data contains in this data box into XML.
DataBox
 Inherited
setClient(clientProp:String, newValue:*):IClient
Set client property for this data.
DataBox
 Inherited
setPropertyValue(property:String, value:Object):void
Set specified property name value on this data.
DataBox
 Inherited
toDatas(matchFunction:Function = null):ICollection
Create a new collection, put all data inside this collection, and return this collection.
DataBox
 Inherited
toString():String
[override]
DataBox
Protected Methods
 MethodDefined By
 Inherited
deserializeClient(serializer:XMLSerializer, clientXML:XML, clientProp:String):void
Deserialize client property from given XML data.
DataBox
 Inherited
deserializeProperty(serializer:XMLSerializer, propertyXML:XML, property:String):void
Deserialize specified property from the given XML data contains property value.
DataBox
 Inherited
DataBox
 Inherited
onClientChanged(styleProp:String, oldValue:*, newValue:*):void
Called when client property is changed.
DataBox
 Inherited
onDataPropertyChanged(data:IData, e:PropertyChangeEvent):void
Called back when any data property is changed.
DataBox
 Inherited
onPropertyChanged(property:String, oldValue:Object, newValue:Object):void
Called back when a property of this data is changed.
DataBox
 Inherited
serializeClient(serializer:XMLSerializer, clientPrope:String, newInstance:DataBox):void
Serialize the specified client property into XML.
DataBox
 Inherited
serializeProperty(serializer:XMLSerializer, property:String, newInstance:DataBox):void
Serialize the specified property into XML.
DataBox
Property Detail
alarmElementMappingproperty
alarmElementMapping:IAlarmElementMapping

Get the alarm-elemen mapping object. Alarm-element mapping object is used to map the relationship between elements and alarms. It will determines which alarm is occured on which element.


Implementation
    public function get alarmElementMapping():IAlarmElementMapping
    public function set alarmElementMapping(value:IAlarmElementMapping):void

See also

elementBoxproperty 
elementBox:ElementBox  [read-only]

Get the element box this alarm box connect to. Every alarm box will work with an element box which is specified by the constructor.


Implementation
    public function get elementBox():ElementBox
removeAlarmWhenAlarmIsClearedproperty 
removeAlarmWhenAlarmIsCleared:Boolean

Indicates whether the alarm object will be removed from alarm box when this alarm severity/status is changed to "cleared".


Implementation
    public function get removeAlarmWhenAlarmIsCleared():Boolean
    public function set removeAlarmWhenAlarmIsCleared(value:Boolean):void
removeAlarmWhenElementIsRemovedproperty 
removeAlarmWhenElementIsRemoved:Boolean

The flag value indicates that whether all alarms occured on an element need to be removed as well when the element is removed from the element box.


Implementation
    public function get removeAlarmWhenElementIsRemoved():Boolean
    public function set removeAlarmWhenElementIsRemoved(value:Boolean):void
Constructor Detail
AlarmBox()Constructor
public function AlarmBox(elementBox:ElementBox)

Constructor of AlarmBox. This alarm box will connect to the given ElementBox.

Parameters
elementBox:ElementBox
Method Detail
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

getAlarmByID()method 
public function getAlarmByID(alarmID:Object):IAlarm

Get an alarm object by the given alarm ID.

Parameters

alarmID:Object — the Alarm ID you want to get.

Returns
IAlarm — the alarm object with given ID.
getCorrespondingAlarms()method 
public function getCorrespondingAlarms(element:IElement):Array

Get the corresponding alarms of the given element, that is, all alarms occured on this element object.

Parameters

element:IElement — The element object

Returns
Array
getCorrespondingElements()method 
public function getCorrespondingElements(alarm:IAlarm):Array

Get all corresponding elements by given the alarm object. This is a wrapped method of alarmElementMapping.getCorrespondingElements(alarm) See more information about this method on classAlarmElementMapping.getCorrespondingElements

Parameters

alarm:IAlarm — alarm object

Returns
Array — all corresponding elements of this given alarm.
removeAlarmsByElement()method 
public function removeAlarmsByElement(element:IElement):void

Remove all corresponding alarms of given element object.

Parameters

element:IElement — an element object