Package | com.soma.core.controller |
Class | public class ParallelCommand |
Inheritance | ParallelCommand ![]() ![]() |
Implements | IParallelCommand |
Author: Romuald Quantin - www.soundstep.com
Resources: http://www.soundstep.com/downloads/somacore
Actionscript version: 3.0
Copyright: Mozilla Public License 1.1 (MPL 1.1) http://www.opensource.org/licenses/mozilla1.1.php
The ParallelCommand class is used to execute a list of commands at the same time.See also
Property | Defined By | ||
---|---|---|---|
commands : Array [read-only]
Retrieves the list of commands added as subcommands. | ParallelCommand | ||
![]() | injector : ISomaInjector [read-only] | Command | |
![]() | instance : ISoma [read-only]
Retrieves the instance of the framework. | Command | |
length : int [read-only]
Retrieves the number of commands added as subcommands. | ParallelCommand | ||
![]() | mediators : SomaMediators [read-only] | Command | |
![]() | stage : Stage [read-only]
Get the stage that has been registered to the framework. | Command |
Method | Defined By | ||
---|---|---|---|
Create an instance of the ParallelCommand class. | ParallelCommand | ||
![]() | addCommand(commandName:String, command:Class):void
Registers a command to the framework. | Command | |
![]() | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event. | Command | |
![]() |
Registers a model to the framework. | Command | |
![]() | addView(viewName:String, view:Object):Object
Registers a view to the framework. | Command | |
![]() |
Registers a wire to the framework. | Command | |
![]() | dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow. | Command | |
![]() | getCommand(commandName:String):Class
Retrieves the command class that has been registered with a command name. | Command | |
![]() | getCommands():Array
Retrieves all the command names (event type) that have been registered to the framework. | Command | |
![]() |
Retrieves the last sequence command that has been instantiated in the framework. | Command | |
![]() |
Retrieves the model instance that has been registered using its name. | Command | |
![]() | getModels():Dictionary
Retrieves all the model instances that have been registered to the framework. | Command | |
![]() | getRunningSequencers():Array
Retrieves all the sequence command instances that are running. | Command | |
![]() | getSequencer(event:Event):ISequenceCommand
Retrieves the sequence command instance using an event instance that has been created from this sequence command. | Command | |
![]() | getView(viewName:String):Object
Retrieves the view instance that has been registered using its name. | Command | |
![]() | getViews():Dictionary
Retrieves all the view instances that have been registered to the framework. | Command | |
![]() |
Retrieves the wire instance that has been registered using its name. | Command | |
![]() | getWires():Dictionary
Retrieves all the wire instances that have been registered to the framework. | Command | |
![]() | hasCommand(commandName:String):Boolean
Indicates wether a command has been registered to the framework. | Command | |
![]() | hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event. | Command | |
![]() | hasModel(modelName:String):Boolean
Indicates wether a model has been registered to the framework. | Command | |
![]() | hasView(viewName:String):Boolean
Indicates wether a view has been registered to the framework. | Command | |
![]() | hasWire(wireName:String):Boolean
Indicates wether a wire has been registered to the framework. | Command | |
![]() | isPartOfASequence(event:Event):Boolean
Indicates wether an event has been instantiated from a ISequenceCommand class. | Command | |
![]() | removeCommand(commandName:String):void
Removes a command from the framework. | Command | |
![]() | removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object. | Command | |
![]() | removeModel(modelName:String):void
Removes a model from the framework and call the dispose method of this model. | Command | |
![]() | removeView(viewName:String):void
Removes a view from the framework and call the (optional) dispose method of this view. | Command | |
![]() | removeWire(wireName:String):void
Removes a wire from the framework and call the dispose method of this wire. | Command | |
![]() | stopAllSequencers():void
Stops all the sequence command instances that are running. | Command | |
![]() | stopSequencer(sequencer:ISequenceCommand):Boolean
Stops a sequence command using the sequence command instance itself. | Command | |
![]() | stopSequencerWithEvent(event:Event):Boolean
Stops a sequence command using an event instance that has been created from this sequence command. | Command | |
![]() | willTrigger(type:String):Boolean
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type. | Command |
Method | Defined By | ||
---|---|---|---|
addSubCommand(event:Event):void
Add a command to the list of commands to execute in parallel. | ParallelCommand | ||
![]() | initialize():void
Method that you can optionally overwrite and that is called after the command has been registered with the framework. | Command | |
initializeSubCommands():void
Method that you can overwrite to add commands to the parallele command. | ParallelCommand |
commands | property |
commands:Array
[read-only] Retrieves the list of commands added as subcommands.
public function get commands():Array
length | property |
length:int
[read-only] Retrieves the number of commands added as subcommands.
public function get length():int
ParallelCommand | () | Constructor |
public function ParallelCommand()
Create an instance of the ParallelCommand class. Should not be directly instantiated, the framework will instantiate the class.
addSubCommand | () | method |
protected final function addSubCommand(event:Event):void
Add a command to the list of commands to execute in parallel.
Parameters
event:Event — Event instance (must be registered as a command previously).
|
See also
addSubCommand(new MyEvent(MyEvent.DO_SOMETHING));
initializeSubCommands | () | method |
protected function initializeSubCommands():void
Method that you can overwrite to add commands to the parallele command.
See also
addSubCommand(new MyEvent(MyEvent.DO_SOMETHING));
addCommand(MyEvent.DO_SOMETHING, CommandExample); addCommand(MyEvent.DO_SOMETHING_ELSE, CommandExample); addCommand(MyEvent.EXECUTE_PARALLEL_COMMAND, ParallelCommandExample); dispatchEvent(new MyEvent(MyEvent.EXECUTE_PARALLEL_COMMAND));
package { import com.soma.core.interfaces.IParallelCommand; import com.soma.core.controller.ParallelCommand; public class ParallelCommandExample extends ParallelCommand implements IParallelCommand { public function ParallelCommandExample() { } override protected function initializeSubCommands():void { addSubCommand(new MyEvent(MyEvent.DO_SOMETHING)); addSubCommand(new MyEvent(MyEvent.DO_SOMETHING_ELSE)); } } }