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

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.



Public Properties
 PropertyDefined By
 Inheritedcanvas : CanvasComponent
[read-only] The canvas instance this mode is currently installed in or null
AbstractInputMode
  defaultCursor : Cursor
The default cursor which is displayed if the active input mode does not have a preferred cursor.
MultiplexingInputMode
 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
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
  
childInputModeContextLookup(type:Class):Object
Callback lookup method that will be used by the child IInputModeContext
MultiplexingInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
initialize():void
Performs one-time initialization of this instance.
AbstractInputMode
  
[override] The implementation of the install() method: installs this mode into the canvas of the given context.
MultiplexingInputMode
 Inherited
invalidate():void
Convenience method for subclass implementations that invalidates the canvasComponent this mode is currently installed in.
AbstractInputMode
  
Potentially replaces the reported by the current owner's preferredCursor property before it is set on the canvas.
MultiplexingInputMode
  
[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 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
 InheritedUNINSTALLED : String = uninstalled
[static]
AbstractInputMode
 InheritedUNINSTALLING : String = uninstalling
[static]
AbstractInputMode
Property Detail
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 priorty 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.

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

The implementation of the install() method: installs this mode into the canvas of the given context.

Subclasses should override this method and call super.installCore(context), first. One-time initialization should be performed in the initialize method. The install method will call the initialize method the first time this mode gets installed.

Parameters

context:IInputModeContext — The context to use for installation.

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.

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