Packagecom.gestureworks.cml.managers
Classpublic class StateManager
InheritanceStateManager Inheritance Object

Manages the storage and loading of object states through the RenderKit or the State tag. Through the RenderKit, passing a state to the StateManager is done by assigning a stateId to a RenderData object. To register a state through a "State" tag, nest the tag inside the CML object node and assign attributes. If a stateId is not defined on a state tag, one is automatically generated. To load the object state, pass the stateId to the StateManager through the loadState function (StateManager.loadState("first state")).



Public Properties
 PropertyDefined By
  states : Array
[static] [read-only]
StateManager
Public Methods
 MethodDefined By
  
loadState(stateId:*):void
[static] Loads applicable objects with provided states by state id.
StateManager
  
registerObject(object:*, attr:State):void
[static] Registers object attributes for state management
StateManager
  
registerStateTag(object:*, cml:XMLList):void
[static] Register object attributes in State tag
StateManager
  
saveRenderState(stateData:XML, cmlObjects:XMLList):void
[static] Generates a nested dictionary of state data with the following structure: object placeholder-->state id-->property-->value.
StateManager
  
saveState(stateId:*):void
[static] Saves applicable objects with provided states by state id.
StateManager
  
stateIdObjects(stateId:String):Array
[static] Returns all objects with states associated with the provided state id
StateManager
  
stateIds(object:*):Array
[static] Returns registered state ids of the provided object
StateManager
Property Detail
statesproperty
states:Array  [read-only]


Implementation
    public static function get states():Array
Method Detail
loadState()method
public static function loadState(stateId:*):void

Loads applicable objects with provided states by state id.

Parameters

stateId:*

registerObject()method 
public static function registerObject(object:*, attr:State):void

Registers object attributes for state management

Parameters

object:* — The object to register
 
attr:State — Property to value Dictionary

registerStateTag()method 
public static function registerStateTag(object:*, cml:XMLList):void

Register object attributes in State tag

Parameters

object:*
 
cml:XMLList

saveRenderState()method 
public static function saveRenderState(stateData:XML, cmlObjects:XMLList):void

Generates a nested dictionary of state data with the following structure: object placeholder-->state id-->property-->value. The placeholder will be replaced by the resulting CML object after instantiaton.

Parameters

stateData:XML
 
cmlObjects:XMLList

saveState()method 
public static function saveState(stateId:*):void

Saves applicable objects with provided states by state id.

Parameters

stateId:*

stateIdObjects()method 
public static function stateIdObjects(stateId:String):Array

Returns all objects with states associated with the provided state id

Parameters

stateId:String

Returns
Array — An array of objects
stateIds()method 
public static function stateIds(object:*):Array

Returns registered state ids of the provided object

Parameters

object:* — The registered object

Returns
Array — An array of state ids