| Package | com.sibirjak.asdpc.core.managers |
| Class | public class ViewPropertyManager |
Often a child display object needs to be consistent to an ancector state. E.g. the rotation of the arrow icon of a ScrollBar button depends on the ScrollBar direction. A ViewPropertyManager simply stores property-value-pairs that can be easily received by a traversal of the parent chain of a child object. This way even custom programmatic skins, who not extend the core View class may obtain information about their parents.
in ScrollBar:
----------------------------------
setViewProperty(VIEW_PROPERTY_SCROLLBAR_DIRECTION, _direction);
...
_upButton.setViewProperty(VIEW_PROPERTY_SCROLLBAR_BUTTON, UP_BUTTON_NAME);
in ScrollButtonIconSkin:
----------------------------------
var direction : String = getViewProperty(ScrollBar.VIEW_PROPERTY_SCROLLBAR_DIRECTION);
...
var buttonName : String = getViewProperty(ScrollBar.VIEW_PROPERTY_SCROLLBAR_BUTTON);
...
if (direction == Direction.VERTICAL && buttonName == ScrollBar.DOWN_BUTTON_NAME) {
icon.rotation = 180;
}
or in CustomSkin:
----------------------------------
var direction : String = ViewPropertyManager.getViewProperty(this, ScrollBar.VIEW_PROPERTY_SCROLLBAR_DIRECTION);
...
var buttonName : String = ViewPropertyManager.getViewProperty(this, ScrollBar.VIEW_PROPERTY_SCROLLBAR_BUTTON);
...
if (direction == Direction.VERTICAL && buttonName == ScrollBar.DOWN_BUTTON_NAME) {
icon.rotation = 180;
}
| Method | Defined by | ||
|---|---|---|---|
|
ViewPropertyManager constructor.
| ViewPropertyManager | ||
|
getViewProperty(property:String):*
Gets a property value.
| ViewPropertyManager | ||
|
setViewProperty(property:String, value:*):void
Sets a property.
| ViewPropertyManager | ||
| ViewPropertyManager | () | constructor |
public function ViewPropertyManager(client:IViewPropertyManagerClient)ViewPropertyManager constructor.
Parametersclient:IViewPropertyManagerClient — The property hosting client.
|
| getViewProperty | () | method |
public final function getViewProperty(property:String):*Gets a property value.
Parametersproperty:String — The name of the property.
|
* — The value of the property.
|
| setViewProperty | () | method |
public final function setViewProperty(property:String, value:*):voidSets a property.
Properties can be used to enable state distinction by display descendants.
Parametersproperty:String — The name of the property.
|
|
value:* — The value of the property.
|