Package | com.yworks.canvas.input |
Class | public class MultiplexingInputMode |
Inheritance | MultiplexingInputMode AbstractConcurrentInputMode AbstractInputMode flash.events.EventDispatcher |
Subclasses | MainInputMode, TableEditorInputMode |
IInputMode
implementation that additionally
can deal with IConcurrentInputMode
instances.
Instances of this class can install
and uninstall
multiple IInputMode
s.
Modes added using the add(IInputMode)
methods will be active at all
times while IConcurrentInputMode
s
added using the addConcurrent(IConcurrentInputMode)
methods will only be active as long as not one of them owns the InputMutex
.
By providing priorities to the different modes, the order of their installation can be influenced.
This class itself implements the IConcurrentInputMode
interface
so that hierarchies of instances of this class can easily be built.
This class will request the input mutex if one of its child modes requests the
mutex. Also, if the instance itself gets disabled,
it will stop or cancel the current owner of the mutex.
See also
Property | Defined By | ||
---|---|---|---|
canvas : CanvasComponent [read-only]
The canvas instance this mode is currently installed in or null
| AbstractInputMode | ||
controller : ConcurrencyController
Gets or injects the ConcurrencyController for this instance. | AbstractConcurrentInputMode | ||
defaultCursor : Cursor
The default cursor which is displayed if the active input mode
does not have a preferred cursor. | MultiplexingInputMode | ||
enabled : Boolean
Gets or sets the enabled state of this input mode. | AbstractConcurrentInputMode | ||
inputModeContext : IInputModeContext [read-only]
The context instance this mode is currently installed in or
null if this instance is not installed. | AbstractInputMode | ||
installed : Boolean [read-only]
Whether this mode is currently installed, i.e
if a call to the canvas property will yield a non-null result. | AbstractInputMode | ||
preferredCursor : Cursor
Gets or sets the cursor this mode would like to have displayed in the CanvasComponent. | AbstractConcurrentInputMode |
Property | Defined By | ||
---|---|---|---|
childController : ConcurrencyController [read-only]
The ConcurrencyController that is used to manage the concurrency of
the child input modes. | MultiplexingInputMode |
Method | Defined By | ||
---|---|---|---|
Creates an instance with no initial modes. | MultiplexingInputMode | ||
add(inputMode:IInputMode, priority:int = 0):void
Adds an input mode using the given priority to this compound mode. | MultiplexingInputMode | ||
addConcurrent(inputMode:IConcurrentInputMode, priority:int):void
Adds an input mode as a concurrent mode using the given priority to this compound mode. | MultiplexingInputMode | ||
adjustCursor():void
Adjusts the cursor of the CanvasControl according to the
current input mutex owner or the first mode in the list
that returns a non-null preferredCursor. | MultiplexingInputMode | ||
cancel():void [override]
Cancels all modes. | MultiplexingInputMode | ||
Callback that creates the IInputModeContext for the child modes of this mode. | MultiplexingInputMode | ||
dispose():void
Disposes this input mode. | AbstractInputMode | ||
Finds the IConcurrentInputMode that currently
owns the mutex or null.
| MultiplexingInputMode | ||
install(context:IInputModeContext):void
Installs this mode into the canvas of the given context. | AbstractInputMode | ||
remove(mode:IInputMode):void
Removes the given mode from this compound mode. | MultiplexingInputMode | ||
Returns a list of all modes managed by this instance in sorted order. | MultiplexingInputMode | ||
stop():Boolean [override]
Tries to stop all modes. | MultiplexingInputMode | ||
uninstall(context:IInputModeContext):void
Uninstalls this mode from the canvas. | AbstractInputMode |
Method | Defined By | ||
---|---|---|---|
canRequestMutex():Boolean
Determines whether this instance can request the InputMutex. | AbstractConcurrentInputMode | ||
childInputModeContextLookup(type:Class):Object
Callback lookup method that will be used by the child IInputModeContext
| MultiplexingInputMode | ||
Create the ConcurrencyController that is used to manage the concurrency of
the child input modes. | MultiplexingInputMode | ||
fireInstalled():void | AbstractInputMode | ||
fireInstalling():void | AbstractInputMode | ||
fireUninstalled():void | AbstractInputMode | ||
fireUninstalling():void | AbstractInputMode | ||
hasMutex():Boolean
Determines whether this instance owns the input mutex. | AbstractConcurrentInputMode | ||
initialize():void
Performs one-time initialization of this instance. | AbstractInputMode | ||
installCore(context:IInputModeContext):void [override]
| MultiplexingInputMode | ||
invalidate():void
Convenience method for subclass implementations that invalidates
the canvasComponent this mode is currently installed in. | AbstractInputMode | ||
onDisabled():void [override]
Called when the AbstractConcurrentInputMode.enabled property changes to
false. | MultiplexingInputMode | ||
onEnabled():void [override]
Called when the AbstractConcurrentInputMode.enabled property changes to true. | MultiplexingInputMode | ||
onMutexObtained():void
Called when this instance obtains the InputMutex. | AbstractConcurrentInputMode | ||
onMutexReleased():void
Called when this instance released the InputMutex. | AbstractConcurrentInputMode | ||
Called when the preferredCursor property changes. | AbstractConcurrentInputMode | ||
releaseMutex():void
Releases the mutex that is currently owned by this instance. | AbstractConcurrentInputMode | ||
Potentially replaces the reported by the current owner's preferredCursor property before it is
set on the canvas. | MultiplexingInputMode | ||
requestMutex():void
Requests the InputMutex from the current controller. | AbstractConcurrentInputMode | ||
uninstallCore(context:IInputModeContext):void [override] | MultiplexingInputMode |
childController | property |
childController:ConcurrencyController
[read-only]
The ConcurrencyController
that is used to manage the concurrency of
the child input modes.
On first access to this property, createChildConcurrencyController
is called to initialize the property.
protected function get childController():ConcurrencyController
See also
defaultCursor | property |
defaultCursor:Cursor
The default cursor which is displayed if the active input mode does not have a preferred cursor.
This is the cursor which will be displayed on the CanvasComponent
,
on which this mode is installed, by default.
If set to null
the system's default cursor is used.
The default value is null
.
public function get defaultCursor():Cursor
public function set defaultCursor(value:Cursor):void
MultiplexingInputMode | () | Constructor |
public function MultiplexingInputMode()
Creates an instance with no initial modes.
add | () | method |
public function add(inputMode:IInputMode, priority:int = 0):void
Adds an input mode using the given priority to this compound mode.
The priority will influence the order in which the modes will be installed into the canvas control. The lower the priority value, the earlier it will be installed. If two modes are installed using the same priority value, the first one will be installed earlier.
Parameters
inputMode:IInputMode — The mode to install using the given installation priority.
| |
priority:int (default = 0 ) — The priority to use for sorting the modes before installation.
|
addConcurrent | () | method |
public function addConcurrent(inputMode:IConcurrentInputMode, priority:int):void
Adds an input mode as a concurrent mode using the given priority to this compound mode.
Concurrent input modes will be managed by a ConcurrencyController
instance
owned by this instance.
The priority will influence the order in which the modes will
be installed into the
canvas control. The lower the priority value, the earlier it will be installed.
If two modes are installed using the same priority value, the first one will be
installed earlier.
Parameters
inputMode:IConcurrentInputMode — The mode to install using the given installation priority.
| |
priority:int — The priority to use for sorting the modes before installation.
|
adjustCursor | () | method |
public function adjustCursor():void
Adjusts the cursor of the CanvasControl according to the
current input mutex owner or the first mode in the list
that returns a non-null preferredCursor
.
This method will set the defaultCursor
as the current cursor if
no other IConcurrentInputMode.preferredCursor
has been specified.
Before the cursor is set on the control, the replaceCursor
method
is queried for a possible cursor replacement.
cancel | () | method |
override public function cancel():void
Cancels all modes.
childInputModeContextLookup | () | method |
protected function childInputModeContextLookup(type:Class):Object
Callback lookup method that will be used by the child IInputModeContext
Parameters
type:Class — The class to lookup
|
Object — An implementation of the given type, or null
|
See also
createChildConcurrencyController | () | method |
protected function createChildConcurrencyController():ConcurrencyController
Create the ConcurrencyController
that is used to manage the concurrency of
the child input modes.
A specialized ConcurrencyController
that correctly manages the
child input mode concurrency with regard to the parent input mode.
ConcurrencyController |
createChildInputModeContext | () | method |
public function createChildInputModeContext():IInputModeContext
Callback that creates the IInputModeContext
for the child modes of this mode.
This method is called during installation to create to create a new context for the child modes.
The inputModeContext
property is already set, when this method is called.
lookup
calls for the created context will be resolved by this instance's
childInputModeContextLookup
method.
IInputModeContext — A new instance that delegates to the parent's context.
|
See also
getMutexOwner | () | method |
public function getMutexOwner():IConcurrentInputMode
Finds the IConcurrentInputMode
that currently
owns the mutex or null.
IConcurrentInputMode — The IConcurrentInputMode that currently
owns the mutex or null.
|
installCore | () | method |
override protected function installCore(context:IInputModeContext):void
Parameters
context:IInputModeContext |
onDisabled | () | method |
override protected function onDisabled():void
Called when the AbstractConcurrentInputMode.enabled
property changes to
false
.
This implementation sets the AbstractConcurrentInputMode.preferredCursor
property
to null
and releases the mutex if the mutex is currently owned
by this instance. Also, all concurrent child modes will be disabled.
onEnabled | () | method |
override protected function onEnabled():void
Called when the AbstractConcurrentInputMode.enabled
property changes to true
.
This implementation reenabled previously disabled concurrent child modes.
remove | () | method |
public function remove(mode:IInputMode):void
Removes the given mode from this compound mode.
Parameters
mode:IInputMode |
replaceCursor | () | method |
protected function replaceCursor(cursor:Cursor):Cursor
Potentially replaces the reported by the current owner's preferredCursor
property before it is
set on the canvas.
This implementation directly returns the given cursor.
Parameters
cursor:Cursor — The cursor to adjust; may be null .
|
Cursor — The cursor to adjust; may be null .
|
See also
sortedModes | () | method |
public function sortedModes():List
Returns a list of all modes managed by this instance in sorted order.
ReturnsList |
stop | () | method |
override public function stop():Boolean
Tries to stop all modes.
ReturnsBoolean |
uninstallCore | () | method |
override protected function uninstallCore(context:IInputModeContext):void
Parameters
context:IInputModeContext |