Packagecom.yworks.canvas.input
Classpublic class AbstractConcurrentInputMode
InheritanceAbstractConcurrentInputMode Inheritance AbstractInputMode Inheritance flash.events.EventDispatcher
ImplementsIConcurrentInputMode
SubclassesContextMenuInputMode, KeyboardInputMode, MouseHoverInputMode, StateMachineInputMode, TextEditorInputMode

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



Public Properties
 PropertyDefined by
 Inheritedcanvas : CanvasComponent
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
The context instance this mode is currently installed in or null if this instance is not installed.
AbstractInputMode
 Inheritedinstalled : Boolean
Whether this mode is currently installed, i.e.
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
Releases the mutex if this input mode currently owns the mutex.
AbstractConcurrentInputMode
 Inherited
dispose():void
Disposes this input mode.
AbstractInputMode
 Inherited
install(context:IInputModeContext):void
Installs this mode into the canvas of the given context.
AbstractInputMode
  
stop():Boolean
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
  
hasMutex():Boolean
Determines whether this instance owns the input mutex.
AbstractConcurrentInputMode
 Inherited
initialize():void
Performs one-time initialization of this instance.
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
  
releaseMutex():void
Releases the mutex that is currently owned by this instance.
AbstractConcurrentInputMode
  
requestMutex():void
Requests the InputMutex from the current controller.
AbstractConcurrentInputMode
Events
 EventSummaryDefined by
   Dispatched when the default cursor changed.AbstractConcurrentInputMode
Public Constants
 ConstantDefined by
  PREFERRED_CURSOR_CHANGED : String = "preferredCursorChanged"
[static]
AbstractConcurrentInputMode
Property detail
controllerproperty
controller:ConcurrencyController  [read-write]

Gets or injects the ConcurrencyController for this instance.

Implementation
    public function get controller():ConcurrencyController
    public function set controller(value:ConcurrencyController):void
enabledproperty 
enabled:Boolean  [read-write]

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  [read-write]

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
public override 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
— If the mutex could not be obtained.
stop()method 
public override 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
preferredCursorChangedevent 
Event object type: mx.events.PropertyChangeEvent

Dispatched when the default cursor changed.

Constant detail
PREFERRED_CURSOR_CHANGEDconstant
public static const PREFERRED_CURSOR_CHANGED:String = "preferredCursorChanged"