Packagecom.yworks.canvas.input
Classpublic class AbstractConcurrentInputMode
InheritanceAbstractConcurrentInputMode Inheritance AbstractInputMode Inheritance flash.events.EventDispatcher
Implements IConcurrentInputMode
Subclasses ContextMenuInputMode, DropInputMode, KeyboardInputMode, MouseHoverInputMode, MultiplexingInputMode, StateMachineInputMode, TextEditorInputMode

Abstract base class for an IInputMode that can be used concurrently with other IConcurrentInputMode implementations.



Public Properties
 PropertyDefined By
 Inheritedcanvas : 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
  enabled : 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
  preferredCursor : Cursor
Gets or sets the cursor this mode would like to have displayed in the CanvasComponent.
AbstractConcurrentInputMode
Public Methods
 MethodDefined By
  
cancel():void
[override] Releases the mutex if this input mode currently owns the mutex.
AbstractConcurrentInputMode
 Inherited
dispose():void
Disposes this input mode.
AbstractInputMode
 Inherited
Installs this mode into the canvas of the given context.
AbstractInputMode
  
stop():Boolean
[override] Returns true if this input mode doesn't own the mutex.
AbstractConcurrentInputMode
 Inherited
Uninstalls this mode from the canvas.
AbstractInputMode
Protected Methods
 MethodDefined By
  
canRequestMutex():Boolean
Determines whether this instance can request the InputMutex.
AbstractConcurrentInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
  
hasMutex():Boolean
Determines whether this instance owns the input mutex.
AbstractConcurrentInputMode
 Inherited
initialize():void
Performs one-time initialization of this instance.
AbstractInputMode
 Inherited
The implementation of the install() method: installs this mode into the canvas of the given context.
AbstractInputMode
 Inherited
invalidate():void
Convenience method for subclass implementations that invalidates the canvasComponent this mode is currently installed in.
AbstractInputMode
  
onDisabled():void
Called when the enabled property changes to false.
AbstractConcurrentInputMode
  
onEnabled():void
Called when the enabled property changes to true.
AbstractConcurrentInputMode
  
Called when this instance obtains the InputMutex.
AbstractConcurrentInputMode
  
Called when this instance released the InputMutex.
AbstractConcurrentInputMode
  
onPreferredCursorChanged(oldValue:Cursor, newValue:Cursor):void
Called when the preferredCursor property changes.
AbstractConcurrentInputMode
  
Releases the mutex that is currently owned by this instance.
AbstractConcurrentInputMode
  
Requests the InputMutex from the current controller.
AbstractConcurrentInputMode
 Inherited
Implementation of uninstall: Uninstalls this mode from the canvas.
AbstractInputMode
Events
 Event Summary Defined By
 InheritedDispatched after the input mode was installed.AbstractInputMode
 InheritedDispatched before the input mode will be installed.AbstractInputMode
  Dispatched 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
  PREFERRED_CURSOR_CHANGED : String = preferredCursorChanged
[static]
AbstractConcurrentInputMode
 InheritedUNINSTALLED : String = uninstalled
[static]
AbstractInputMode
 InheritedUNINSTALLING : String = uninstalling
[static]
AbstractInputMode
Property Detail
controllerproperty
controller:ConcurrencyController

Gets or injects the ConcurrencyController for this instance.


Implementation
    public function get controller():ConcurrencyController
    public function set controller(value:ConcurrencyController):void
enabledproperty 
enabled:Boolean

Gets or sets the enabled state of this input mode.

The controller will disable this mode if another mode acquires the input mutex. Also clients can use this property to disable or reenable this instance. A disabled instance should never try to acquire the input mutex. This will call the onEnabled or onDisabled methods respectively. A disabled mode cannot be enabled if another mode currently owns the input mutex.


Implementation
    public function get enabled():Boolean
    public function set enabled(value:Boolean):void
preferredCursorproperty 
preferredCursor:Cursor

Gets or sets the cursor this mode would like to have displayed in the CanvasComponent.

To indicate that this mode does not have any preferences implementations should return null. This will trigger the onPreferredCursorChanged method.


Implementation
    public function get preferredCursor():Cursor
    public function set preferredCursor(value:Cursor):void
Method Detail
cancel()method
override public function cancel():void

Releases the mutex if this input mode currently owns the mutex.

See also

canRequestMutex()method 
protected function canRequestMutex():Boolean

Determines whether this instance can request the InputMutex.

This will return true, iff the no controller has been injected or the controller allows requesting the mutex.

Returns
Boolean — Whether a call to requestMutex would currently succeed.
hasMutex()method 
protected function hasMutex():Boolean

Determines whether this instance owns the input mutex.

If no controller had been associated with this instance upon the call to requestMutex this method will return true, too.

Returns
Booleantrue if no controller is associated with this instance
onDisabled()method 
protected function onDisabled():void

Called when the enabled property changes to false.

This implementation sets the preferredCursor property to null.

onEnabled()method 
protected function onEnabled():void

Called when the enabled property changes to true.

onMutexObtained()method 
protected function onMutexObtained():void

Called when this instance obtains the InputMutex.

If no controller had been associated with this instance upon the call to requestMutex this method will be called, too.

onMutexReleased()method 
protected function onMutexReleased():void

Called when this instance released the InputMutex.

If no controller had been associated with this instance upon the call to requestMutex this method will be called, too.

onPreferredCursorChanged()method 
protected function onPreferredCursorChanged(oldValue:Cursor, newValue:Cursor):void

Called when the preferredCursor property changes.

Parameters

oldValue:Cursor
 
newValue:Cursor

releaseMutex()method 
protected function releaseMutex():void

Releases the mutex that is currently owned by this instance.

This will trigger the onMutexReleased method if this instance previously owned the mutex.

requestMutex()method 
protected function requestMutex():void

Requests the InputMutex from the current controller.

This implementation will call the OnMutexObtained method if the mutex has been successfully obtained or if there is no controller associated with this mode currently. If the mutex cannot be obtained this method will trigger an Error.


Throws
Error — If the mutex could not be obtained.
stop()method 
override public function stop():Boolean

Returns true if this input mode doesn't own the mutex.

Returns
Booleantrue iff this mode doesn't own the mutex and super.stop() returns true.

See also

Event Detail
preferredCursorChanged Event
Event Object Type: mx.events.PropertyChangeEvent
PropertyChangeEvent.type property = com.yworks.canvas.input.AbstractConcurrentInputMode.PREFERRED_CURSOR_CHANGED

Dispatched when the default cursor changed.

Constant Detail
PREFERRED_CURSOR_CHANGEDConstant
public static const PREFERRED_CURSOR_CHANGED:String = preferredCursorChanged