Package | com.soma.core.interfaces |
Interface | public interface ISoma |
Implementors | Soma |
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
Interface used by the class that will extend the Soma class.See also
Property | Defined By | ||
---|---|---|---|
controller : SomaController [read-only]
Gets the commands manager instance. | ISoma | ||
injector : ISomaInjector [read-only]
Retrieves the injector instance that has been created by the framework from the injector Class registered. | ISoma | ||
injectorClass : Class [read-only]
Retrieves the injector Class registered to the framework. | ISoma | ||
mediators : SomaMediators [read-only]
Gets the mediator manager instance that has been created by the framework from the injector Class registered. | ISoma | ||
models : SomaModels [read-only]
Gets the model manager instance. | ISoma | ||
reflector : ISomaReflector [read-only]
Retrieves the refletor instance. | ISoma | ||
stage : Stage [read-only]
Get the stage that has been registered to the framework. | ISoma | ||
views : SomaViews [read-only]
Gets the view manager class. | ISoma | ||
wires : SomaWires [read-only]
Gets the wires manager instance. | ISoma |
Method | Defined By | ||
---|---|---|---|
addCommand(commandName:String, command:Class):void
Registers a command to the framework. | ISoma | ||
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. | ISoma | ||
Registers a model to the framework. | ISoma | ||
addView(viewName:String, view:Object):Object
Registers a view to the framework. | ISoma | ||
Registers a wire to the framework. | ISoma | ||
Creates a plugin instance. | ISoma | ||
Creates a plugin instance using the class name and the getDefinitionByName method. | ISoma | ||
dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow. | ISoma | ||
dispose():void
Destroys the SomaCore core classes and elements registered to the framework. | ISoma | ||
getCommand(commandName:String):Class
Retrieves the command class that has been registered with a command name. | ISoma | ||
getCommands():Array
Retrieves all the command names (event type) that have been registered to the framework. | ISoma | ||
Retrieves the last sequence command that has been instantiated in the framework. | ISoma | ||
Retrieves the model instance that has been registered using its name. | ISoma | ||
getModels():Dictionary
Retrieves all the model instances that have been registered to the framework. | ISoma | ||
getRunningSequencers():Array
Retrieves all the sequence command instances that are running. | ISoma | ||
getSequencer(event:Event):ISequenceCommand
Retrieves the sequence command instance using an event instance that has been created from this sequence command. | ISoma | ||
getView(viewName:String):Object
Retrieves the view instance that has been registered using its name. | ISoma | ||
getViews():Dictionary
Retrieves all the view instances that have been registered to the framework. | ISoma | ||
Retrieves the wire instance that has been registered using its name. | ISoma | ||
getWires():Dictionary
Retrieves all the wire instances that have been registered to the framework. | ISoma | ||
hasCommand(commandName:String):Boolean
Indicates wether a command has been registered to the framework. | ISoma | ||
hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event. | ISoma | ||
hasModel(modelName:String):Boolean
Indicates wether a model has been registered to the framework. | ISoma | ||
hasView(viewName:String):Boolean
Indicates wether a view has been registered to the framework. | ISoma | ||
hasWire(wireName:String):Boolean
Indicates wether a wire has been registered to the framework. | ISoma | ||
isPartOfASequence(event:Event):Boolean
Indicates wether an event has been instantiated from a ISequenceCommand class. | ISoma | ||
removeCommand(commandName:String):void
Removes a command from the framework. | ISoma | ||
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object. | ISoma | ||
removeModel(modelName:String):void
Removes a model from the framework and call the dispose method of this model. | ISoma | ||
removeView(viewName:String):void
Removes a view from the framework and call the (optional) dispose method of this view. | ISoma | ||
removeWire(wireName:String):void
Removes a wire from the framework and call the dispose method of this wire. | ISoma | ||
setup(stage:Stage = null, injectorClass:Class = null):void
Register elements that the frameworks needs to be ready, such as the stage and the optional injector class (default is SomaInjector). | ISoma | ||
stopAllSequencers():void
Stops all the sequence command instances that are running. | ISoma | ||
stopSequencer(sequencer:ISequenceCommand):Boolean
Stops a sequence command using the sequence command instance itself. | ISoma | ||
stopSequencerWithEvent(event:Event):Boolean
Stops a sequence command using an event instance that has been created from this sequence command. | ISoma | ||
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. | ISoma |
controller | property |
controller:SomaController
[read-only] Gets the commands manager instance.
public function get controller():SomaController
injector | property |
injector:ISomaInjector
[read-only] Retrieves the injector instance that has been created by the framework from the injector Class registered.
public function get injector():ISomaInjector
injectorClass | property |
injectorClass:Class
[read-only] Retrieves the injector Class registered to the framework.
public function get injectorClass():Class
mediators | property |
mediators:SomaMediators
[read-only] Gets the mediator manager instance that has been created by the framework from the injector Class registered.
public function get mediators():SomaMediators
models | property |
models:SomaModels
[read-only] Gets the model manager instance.
public function get models():SomaModels
reflector | property |
reflector:ISomaReflector
[read-only] Retrieves the refletor instance.
public function get reflector():ISomaReflector
stage | property |
stage:Stage
[read-only] Get the stage that has been registered to the framework.
public function get stage():Stage
views | property |
views:SomaViews
[read-only] Gets the view manager class.
public function get views():SomaViews
wires | property |
wires:SomaWires
[read-only] Gets the wires manager instance.
public function get wires():SomaWires
addCommand | () | method |
public function addCommand(commandName:String, command:Class):void
Registers a command to the framework.
Parameters
commandName:String — Event type that is used as a command name.
| |
command:Class — Class that will be executed when a command has been dispatched.
|
See also
addCommand(MyEvent.DOSOMETHING, MyCommand);
addEventListener | () | method |
public function 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.
Parameters
type:String — The type of event.
| |
listener:Function — The listener function that processes the event.
| |
useCapture:Boolean (default = false ) — Determines whether the listener works in the capture phase or the target and bubbling phases.
| |
priority:int (default = 0 ) — The priority level of the event listener.
| |
useWeakReference:Boolean (default = false ) — Determines whether the reference to the listener is strong or weak.
|
addModel | () | method |
public function addModel(modelName:String, model:IModel):IModel
Registers a model to the framework.
Parameters
modelName:String — Name of the model.
| |
model:IModel — Instance of the model.
|
IModel — The model instance.
|
See also
addModel(MyModel.NAME, new MyModel());
addView | () | method |
public function addView(viewName:String, view:Object):Object
Registers a view to the framework.
Parameters
viewName:String — Name of the view.
| |
view:Object — Instance of the view.
|
Object — The view instance.
|
See also
addView(MySprite.NAME, new MySprite());
addWire | () | method |
public function addWire(wireName:String, wire:IWire):IWire
Registers a wire to the framework.
Parameters
wireName:String — Name of the wire.
| |
wire:IWire — Instance of the wire.
|
IWire — The wire instance.
|
See also
addWire(MyWire.NAME, new MyWire());
createPlugin | () | method |
public function createPlugin(plugin:Class, pluginVO:ISomaPluginVO):ISomaPlugin
Creates a plugin instance.
Parameters
plugin:Class — Class of the plugin that will be instantiated.
| |
pluginVO:ISomaPluginVO — Value Object class of the plugin.
|
ISomaPlugin — An instance of the plugin.
|
var pluginVO:SomaDebuggerVO = new SomaDebuggerVO(this, SomaDebugger.NAME_DEFAULT, getCommands(), true, false); var debugger:SomaDebugger = createPlugin(SomaDebugger, pluginVO) as SomaDebugger;
createPluginFromClassName | () | method |
public function createPluginFromClassName(pluginClassName:String, pluginVO:ISomaPluginVO):ISomaPlugin
Creates a plugin instance using the class name and the getDefinitionByName method.
Parameters
pluginClassName:String — Class name of the plugin that will be instantiated.
| |
pluginVO:ISomaPluginVO — Value Object class of the plugin.
|
ISomaPlugin — An instance of the plugin.
|
var pluginVO:SomaDebuggerVO = new SomaDebuggerVO(this, SomaDebugger.NAME_DEFAULT, getCommands(), true, false); var debugger:SomaDebugger = createPluginFromClassName("com.soma.core.debugger.SomaDebugger", pluginVO) as SomaDebugger;
dispatchEvent | () | method |
public function dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow. The event target is the EventDispatcher object upon which dispatchEvent() is called.
Parameters
event:Event — The event object dispatched into the event flow.
|
Boolean — A value of true unless preventDefault() is called on the event, in which case it returns false.
|
dispose | () | method |
public function dispose():void
Destroys the SomaCore core classes and elements registered to the framework.
getCommand | () | method |
public function getCommand(commandName:String):Class
Retrieves the command class that has been registered with a command name.
Parameters
commandName:String — Event type that is used as a command name.
|
Class — A class.
|
See also
var commandClass:ICommand = getCommand(MyEvent.DOSOMETHING) as ICommand;
getCommands | () | method |
public function getCommands():Array
Retrieves all the command names (event type) that have been registered to the framework.
ReturnsArray — An Array of String (command name).
|
See also
var commands:Array = getCommands();
getLastSequencer | () | method |
public function getLastSequencer():ISequenceCommand
Retrieves the last sequence command that has been instantiated in the framework.
ReturnsISequenceCommand — An ISequenceCommand instance.
|
See also
var lastSequencer:ISequenceCommand = getLastSequencer();
getModel | () | method |
public function getModel(modelName:String):IModel
Retrieves the model instance that has been registered using its name.
Parameters
modelName:String — Name of the model.
|
IModel — A IModel instance.
|
See also
var myModel:MyModel = getModel(MyModel.NAME) as MyModel;
getModels | () | method |
public function getModels():Dictionary
Retrieves all the model instances that have been registered to the framework.
ReturnsDictionary — A Dictionary (the key of the Dictionary is the name used for the registration).
|
See also
var models:Dictionary = getModels();
getRunningSequencers | () | method |
public function getRunningSequencers():Array
Retrieves all the sequence command instances that are running.
ReturnsArray — An Array of ISequenceCommand instances.
|
See also
var sequencers:Array = getRunningSequencers();
getSequencer | () | method |
public function getSequencer(event:Event):ISequenceCommand
Retrieves the sequence command instance using an event instance that has been created from this sequence command.
Parameters
event:Event — Event instance.
|
ISequenceCommand — A sequencer (ISequenceCommand).
|
See also
var sequencer:ISequenceCommand = getSequencer(myEvent);
getView | () | method |
public function getView(viewName:String):Object
Retrieves the view instance that has been registered using its name.
Parameters
viewName:String — Name of the view.
|
Object — An Object instance.
|
See also
var mySprite:MySprite = getView(MySprite.NAME) as MySprite;
getViews | () | method |
public function getViews():Dictionary
Retrieves all the view instances that have been registered to the framework.
ReturnsDictionary — A Dictionary (the key of the Dictionary is the name used for the registration).
|
See also
var sprites:Dictionary = getViews();
getWire | () | method |
public function getWire(wireName:String):IWire
Retrieves the wire instance that has been registered using its name.
Parameters
wireName:String — Name of the wire.
|
IWire — A wire instance.
|
See also
var myWire:MyWire = getWire(MyWire.NAME) as MyWire;
getWires | () | method |
public function getWires():Dictionary
Retrieves all the wire instances that have been registered to the framework.
ReturnsDictionary — A Dictionary (the key of the Dictionary is the name used for the registration).
|
See also
var wires:Dictionary = getWires();
hasCommand | () | method |
public function hasCommand(commandName:String):Boolean
Indicates wether a command has been registered to the framework.
Parameters
commandName:String — Event type that is used as a command name.
|
Boolean — A Boolean.
|
See also
hasCommand(MyEvent.DOSOMETHING);
hasEventListener | () | method |
public function hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
Parameters
type:String — The type of event.
|
Boolean — A value of true if a listener of the specified type is registered; false otherwise.
|
hasModel | () | method |
public function hasModel(modelName:String):Boolean
Indicates wether a model has been registered to the framework.
Parameters
modelName:String — Name of the model.
|
Boolean — A Boolean.
|
See also
hasModel(MyModel.NAME);
hasView | () | method |
public function hasView(viewName:String):Boolean
Indicates wether a view has been registered to the framework.
Parameters
viewName:String — Name of the view.
|
Boolean — A Boolean.
|
See also
hasView(MySprite.NAME);
hasWire | () | method |
public function hasWire(wireName:String):Boolean
Indicates wether a wire has been registered to the framework.
Parameters
wireName:String — Name of the wire.
|
Boolean — A Boolean.
|
See also
hasWire(MyWire.NAME);
isPartOfASequence | () | method |
public function isPartOfASequence(event:Event):Boolean
Indicates wether an event has been instantiated from a ISequenceCommand class.
Parameters
event:Event |
Boolean — A Boolean.
|
See also
var inSequence:Boolean = isPartOfASequence(myEvent);
removeCommand | () | method |
public function removeCommand(commandName:String):void
Removes a command from the framework.
Parameters
commandName:String — Event type that is used as a command name.
|
See also
removeCommand(MyEvent.DOSOMETHING);
removeEventListener | () | method |
public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object. If there is no matching listener registered with the EventDispatcher object, a call to this method has no effect.
Parameters
type:String — The type of event.
| |
listener:Function — The listener object to remove.
| |
useCapture:Boolean (default = false ) — Specifies whether the listener was registered for the capture phase or the target and bubbling phases.
|
removeModel | () | method |
public function removeModel(modelName:String):void
Removes a model from the framework and call the dispose method of this model.
Parameters
modelName:String — Name of the model.
|
See also
removeModel(MyModel.NAME);
removeView | () | method |
public function removeView(viewName:String):void
Removes a view from the framework and call the (optional) dispose method of this view.
Parameters
viewName:String — Name of the view.
|
See also
removeView(MySprite.NAME);
removeWire | () | method |
public function removeWire(wireName:String):void
Removes a wire from the framework and call the dispose method of this wire.
Parameters
wireName:String — Name of the wire.
|
See also
removeWire(MyWire.NAME);
setup | () | method |
public function setup(stage:Stage = null, injectorClass:Class = null):void
Register elements that the frameworks needs to be ready, such as the stage and the optional injector class (default is SomaInjector).
Parameters
stage:Stage (default = null ) — The stage is used as a global EventDispatcher (as well as the Soma class), and is required to instantiate the framework.
| |
injectorClass:Class (default = null ) — Class that must extend ISomaInjector.
|
stopAllSequencers | () | method |
public function stopAllSequencers():void
Stops all the sequence command instances that are running.
See also
stopAllSequencers();
stopSequencer | () | method |
public function stopSequencer(sequencer:ISequenceCommand):Boolean
Stops a sequence command using the sequence command instance itself.
Parameters
sequencer:ISequenceCommand — The sequence command instance.
|
Boolean — A Boolean (true if the sequence command has been stopped).
|
See also
var success:Boolean = stopSequencer(mySequenceCommand);
stopSequencerWithEvent | () | method |
public function stopSequencerWithEvent(event:Event):Boolean
Stops a sequence command using an event instance that has been created from this sequence command.
Parameters
event:Event — Event instance.
|
Boolean — A Boolean (true if a sequence command has been stopped).
|
See also
var success:Boolean = stopSequencerWithEvent(myEvent);
willTrigger | () | method |
public function 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.
Parameters
type:String — The type of event.
|
Boolean — A value of true if a listener of the specified type will be triggered; false otherwise.
|