This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DataBinding | |
{ | |
private var _data:IDataObject; | |
private var _renderer:IDataRenderer; | |
public function DataBinding(data:IDataObject, renderer:IDataRenderer) | |
{ | |
_data = data; | |
_renderer = renderer; | |
_data.onChangeState.add( onDataChangeState ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fsm | |
.configureState( StateNames.HAPPINESS ) | |
.withEntryGuards( OnlyIfHappy, OnlyIfSmiling ) | |
.withExitiGuards( OnlyIfAnxious ) | |
.withTargets( StateNames.SADNESS, StateNames.ECSTACY ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LATCH | |
// NB: if this Process is called in a State not declared as initiating a process, | |
// or as throwing an error, nothing will happen, but silently | |
// The CommandFlowMap will verify that each transition is valid, and all States have been declared. | |
commandFlowMap.configureProcess() | |
.onEvent( ProcessEventTypes.LATCH, ProcessEvent ) | |
.ifCurrentState( StateNames.LOCKED ) | |
.thenTransitionTo( StateNames.CLOSED, StateNames.OPENED, StateNames.LATCHED ) | |
.ifCurrentState( StateNames.CLOSED ) | |
.thenTransitionTo( StateNames.OPENED, StateNames.LATCHED ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<fsm:FSMDeclaration | |
xmlns:fx="http://ns.adobe.com/mxml/2009" | |
xmlns:fsm="fsm.*" | |
initial="{s1}"> | |
<fsm:states> | |
<fsm:State id="s1" transitions="{[t1,t2]}"> | |
<fsm:State id="s2"/> | |
<fsm:State id="s3"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<fsm:FSMDeclaration | |
xmlns:fx="http://ns.adobe.com/mxml/2009" | |
xmlns:fsm="fsm.*" | |
initial="{s1}"> | |
<fsm:states> | |
<fsm:State id="s1"> | |
<fsm:Transition ref="{t1}"/> | |
</fsm:State> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<s:Sequence id="s1"/> | |
<s:Move id="m1"/> | |
</s:Sequence> | |
<s:Sequence id="s2"/> | |
<s:children> | |
<s:Move id="m2"/> | |
</s:children> | |
</s:Sequence> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<fsm:FSMDeclaration | |
xmlns:fx="http://ns.adobe.com/mxml/2009" | |
xmlns:fsm="fsm.*" | |
initial="{s1}"> | |
<fsm:State id="s1"/> | |
<fsm:State id="s2"/> | |
</fsm:FSMDeclaration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<fsm:FSMDeclaration | |
xmlns:fx="http://ns.adobe.com/mxml/2009" | |
xmlns:fsm="fsm.*" | |
initial="{s1}"> | |
<fsm:State id="s1"/> | |
<fsm:State id="s2"/> | |
</fsm:FSMDeclaration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function FSMInjector( fsm:XML, commandMap:ICommandMap ){ | |
this.fsm = fsm; | |
this.commandMap = commandMap; | |
} | |
public function addClass( value:Class ):void{ | |
if( !validateIsCommand( value ) ) | |
throw new Error ("not a command") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyStrictSignal extends Signal{ | |
public function MyStrictSignal():void{ | |
super( String, int ); | |
} | |
public function dispatchValues( name:String, index:int ):void{ | |
dispatch( name, index ); | |
} | |
} |