Packagetwaver
Classpublic class PropertyPropagator
InheritancePropertyPropagator Inheritance Object
Subclasses AlarmStatePropagator

Property propagator defines a mechanism when a property changed it can be propagated to other related data object. Of course you can define the propogation direction, what property changes should be propagated, whether a target data can be propagated etc.

Property propagator works with data box. You can specify a property name and property type so this propagator knows which property and what type property should be propagated when the property value is changed. By default the propagation will go parent or upper index direction. However you can overwrite method defined in this class and customize the default implementation.

A typical usage of property propagator is AlarmStatePropagator. It will propagate alarm state to parent element when an element alarm occured.

See also

twaver.AlarmStatePropagator


Public Properties
 PropertyDefined By
  dataBox : DataBox
[read-only] Get the connected data box.
PropertyPropagator
  enable : Boolean
Get current enable status of this propagator.
PropertyPropagator
  propertyName : String
[read-only] Get the property name that only this property changes the propagator will be triggered.
PropertyPropagator
  propertyType : String
[read-only] Get the property type that only properties with this type changes the propagator will be triggered.
PropertyPropagator
Protected Properties
 PropertyDefined By
  _isPropagating : Boolean = false
PropertyPropagator
Public Methods
 MethodDefined By
  
PropertyPropagator(dataBox:DataBox, propertyName:String, propertyType:String = accessor)
Constructor.
PropertyPropagator
Protected Methods
 MethodDefined By
  
Called when a data box has been changed.
PropertyPropagator
  
handleDataPropertyChange(e:PropertyChangeEvent):void
Called when a property of a data has been changed.
PropertyPropagator
  
propagate(data:IData):void
Propagate property change to the specified data.
PropertyPropagator
  
propagateToParent(child:IData, parent:IData):void
Called when need to propagate property change to specified data's parent.
PropertyPropagator
  
Propagate property change to the specified data's next level data.
PropertyPropagator
Property Detail
_isPropagatingproperty
protected var _isPropagating:Boolean = false

dataBoxproperty 
dataBox:DataBox  [read-only]

Get the connected data box.


Implementation
    public function get dataBox():DataBox
enableproperty 
enable:Boolean

Get current enable status of this propagator.


Implementation
    public function get enable():Boolean
    public function set enable(value:Boolean):void
propertyNameproperty 
propertyName:String  [read-only]

Get the property name that only this property changes the propagator will be triggered.


Implementation
    public function get propertyName():String
propertyTypeproperty 
propertyType:String  [read-only]

Get the property type that only properties with this type changes the propagator will be triggered.


Implementation
    public function get propertyType():String
Constructor Detail
PropertyPropagator()Constructor
public function PropertyPropagator(dataBox:DataBox, propertyName:String, propertyType:String = accessor)

Constructor.

Parameters
dataBox:DataBox — this is the data box this propagator work for. Data contains in this data box has property value changes, this propagator will be triggered.
 
propertyName:String — the property name that should be propagated.
 
propertyType:String (default = accessor) — the property type that should be propagated.
Method Detail
handleDataBoxChange()method
protected function handleDataBoxChange(e:DataBoxChangeEvent):void

Called when a data box has been changed. This default implementation will propagate the change. Overwrite this method to do customized propagate action.

Parameters

e:DataBoxChangeEvent — the data box change event contains information of that change.

handleDataPropertyChange()method 
protected function handleDataPropertyChange(e:PropertyChangeEvent):void

Called when a property of a data has been changed. This default implementation will propagate this change to parent data. Overwrite this method to do customized propagate action.

Parameters

e:PropertyChangeEvent — the property change event contains information of that change.

propagate()method 
protected function propagate(data:IData):void

Propagate property change to the specified data.

Parameters

data:IData — the target propagate data.

propagateToParent()method 
protected function propagateToParent(child:IData, parent:IData):void

Called when need to propagate property change to specified data's parent.

Parameters

child:IData — child data, the change source.
 
parent:IData — parent data, the propagation target.

propagateToTop()method 
protected function propagateToTop(data:IData):void

Propagate property change to the specified data's next level data. In this default implementation, the "next level data" means the parent data. You can overwrite this method to do your customized property propagation.

Parameters

data:IData — the data need to propagate.