Packagecom.yworks.canvas.input
Classpublic class MultiplexingInputMode
InheritanceMultiplexingInputMode Inheritance AbstractConcurrentInputMode Inheritance AbstractInputMode Inheritance flash.events.EventDispatcher
Subclasses MainInputMode, TableEditorInputMode

A composite IInputMode implementation that additionally can deal with IConcurrentInputMode instances.

Instances of this class can install and uninstall multiple IInputModes. Modes added using the add(IInputMode) methods will be active at all times while IConcurrentInputModes 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

getMutexOwner()
add()
addConcurrent()


Public Properties
 PropertyDefined By
 Inheritedcanvas : CanvasComponent
[read-only] The canvas instance this mode is currently installed in or null
AbstractInputMode
 Inheritedcontroller : 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
 Inheritedenabled : Boolean
Gets or sets the enabled state of this input mode.
AbstractConcurrentInputMode
 InheritedinputModeContext : IInputModeContext
[read-only] The context instance this mode is currently installed in or null if this instance is not installed.
AbstractInputMode
 Inheritedinstalled : 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
 InheritedpreferredCursor : Cursor
Gets or sets the cursor this mode would like to have displayed in the CanvasComponent.
AbstractConcurrentInputMode
Protected Properties
 PropertyDefined By
  childController : ConcurrencyController
[read-only] The ConcurrencyController that is used to manage the concurrency of the child input modes.
MultiplexingInputMode
Public Methods
 MethodDefined 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
  
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
 Inherited
dispose():void
Disposes this input mode.
AbstractInputMode
  
Finds the IConcurrentInputMode that currently owns the mutex or null.
MultiplexingInputMode
 Inherited
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
 Inherited
Uninstalls this mode from the canvas.
AbstractInputMode
Protected Methods
 MethodDefined By
 Inherited
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
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
hasMutex():Boolean
Determines whether this instance owns the input mutex.
AbstractConcurrentInputMode
 Inherited
initialize():void
Performs one-time initialization of this instance.
AbstractInputMode
  
[override]
MultiplexingInputMode
 Inherited
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
 Inherited
Called when this instance obtains the InputMutex.
AbstractConcurrentInputMode
 Inherited
Called when this instance released the InputMutex.
AbstractConcurrentInputMode
 Inherited
onPreferredCursorChanged(oldValue:Cursor, newValue:Cursor):void
Called when the preferredCursor property changes.
AbstractConcurrentInputMode
 Inherited
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
 Inherited
Requests the InputMutex from the current controller.
AbstractConcurrentInputMode
  
[override]
MultiplexingInputMode
Events
 Event Summary Defined By
 InheritedDispatched after the input mode was installed.AbstractInputMode
 InheritedDispatched before the input mode will be installed.AbstractInputMode
 InheritedDispatched when the default cursor changed.AbstractConcurrentInputMode
 InheritedDispatched after the input mode was uninstalled.AbstractInputMode
 InheritedDispatched before the input mode will be uninstalled.AbstractInputMode
Public Constants
 ConstantDefined By
 InheritedINSTALLED : String = installed
[static]
AbstractInputMode
 InheritedINSTALLING : String = installing
[static]
AbstractInputMode
 InheritedPREFERRED_CURSOR_CHANGED : String = preferredCursorChanged
[static]
AbstractConcurrentInputMode
 InheritedUNINSTALLED : String = uninstalled
[static]
AbstractInputMode
 InheritedUNINSTALLING : String = uninstalling
[static]
AbstractInputMode
Property Detail
childControllerproperty
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.


Implementation
    protected function get childController():ConcurrencyController

See also

defaultCursorproperty 
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.


Implementation
    public function get defaultCursor():Cursor
    public function set defaultCursor(value:Cursor):void
Constructor Detail
MultiplexingInputMode()Constructor
public function MultiplexingInputMode()

Creates an instance with no initial modes.

Method Detail
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

Returns
Object — An implementation of the given type, or null

See also

createChildInputModeContext()
com.yworks.support.ILookup
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.

Returns
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.

Returns
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.

Returns
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.

Returns
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.

Returns
List
stop()method 
override public function stop():Boolean

Tries to stop all modes.

Returns
Boolean
uninstallCore()method 
override protected function uninstallCore(context:IInputModeContext):void

Parameters

context:IInputModeContext