| Package | com.soma.control |
| Class | public class SomaController |
| Inheritance | SomaController FrontController |
Author: Romuald Quantin - www.soundstep.com
Information:
Blog page - SomaUI
How does it work - Soma Protest
Project Host - Google Code
Documentation - Soma ASDOC
Class version: 2.0
Actionscript version: 3.0
Copyright:
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied.
See the License for the specific language governing rights and
limitations under the License.
The Original Code is Soma.
The Initial Developer of the Original Code is Romuald Quantin.
Initial Developer are Copyright (C) 2008-2009 Soundstep. All Rights Reserved.
Usage:
SomaController is the internal controller used by the framework.
The command registered are:
See also
| Method | Defined by | ||
|---|---|---|---|
|
Creates a SomaController instance but makes no sense (static class)
| SomaController | ||
|
addCommand(commandName:String, commandRef:Class, useWeakReference:Boolean = true):void
[static]
Registers a ICommand class with the Front Controller, against an event name
and listens for events with that name.
| SomaController | ||
|
init():void
[static]
Initializes the controller and add the commands to the FrontController.
| SomaController | ||
|
removeCommand(commandName:String):void
[static]
Deregisters an ICommand class with the given event name from the Front Controller
| SomaController | ||
| Method | Defined by | ||
|---|---|---|---|
|
executeCommand(event:CairngormEvent):void
[static]
Executes the command
| SomaController | ||
|
getCommand(commandName:String):Class
[static]
Returns the command class registered with the command name.
| SomaController | ||
| SomaController | () | constructor |
public function SomaController()Creates a SomaController instance but makes no sense (static class)
| addCommand | () | method |
public static function addCommand(commandName:String, commandRef:Class, useWeakReference:Boolean = true):voidRegisters a ICommand class with the Front Controller, against an event name and listens for events with that name.
When an event is broadcast that matches commandName, the ICommand class referred to by commandRef receives control of the application, by having its execute() method invoked.
ParameterscommandName:String — The name of the event that will be broadcast by the
when a particular user gesture occurs, eg "login"
|
|
commandRef:Class — An ICommand Class reference upon which execute()
can be called when the Front Controller hears an event broadcast with
commandName. Typically, this argument is passed as "LoginCommand"
or similar.
|
|
useWeakReference:Boolean (default = true) — A Boolean indicating whether the controller
should added as a weak reference to the CairngormEventDispatcher,
meaning it will eligibile for garbage collection if it is unloaded from
the main application.
|
| executeCommand | () | method |
protected static function executeCommand(event:CairngormEvent):voidExecutes the command
Parametersevent:CairngormEvent |
| getCommand | () | method |
protected static function getCommand(commandName:String):ClassReturns the command class registered with the command name.
ParameterscommandName:String |
Class |
| init | () | method |
public static function init():voidInitializes the controller and add the commands to the FrontController.
| removeCommand | () | method |
public static function removeCommand(commandName:String):voidDeregisters an ICommand class with the given event name from the Front Controller
ParameterscommandName:String — The name of the event that will be broadcast by the
when a particular user gesture occurs, eg "login"
|