Packagecom.yworks.canvas.input
Classpublic class AbstractInputMode
InheritanceAbstractInputMode Inheritance flash.events.EventDispatcher
Implements IInputMode
Subclasses AbstractConcurrentInputMode, MagnifierInputMode, OverviewInputMode

Abstract base class implementation of an IInputMode.



Public Properties
 PropertyDefined By
  canvas : CanvasComponent
[read-only] The canvas instance this mode is currently installed in or null
AbstractInputMode
  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
Public Methods
 MethodDefined By
  
cancel():void
Cancels the editing of this mode.
AbstractInputMode
  
dispose():void
Disposes this input mode.
AbstractInputMode
  
Installs this mode into the canvas of the given context.
AbstractInputMode
  
stop():Boolean
Tries to stop the editing.
AbstractInputMode
  
Uninstalls this mode from the canvas.
AbstractInputMode
Protected Methods
 MethodDefined By
  
AbstractInputMode
  
AbstractInputMode
  
AbstractInputMode
  
AbstractInputMode
  
initialize():void
Performs one-time initialization of this instance.
AbstractInputMode
  
The implementation of the install() method: installs this mode into the canvas of the given context.
AbstractInputMode
  
invalidate():void
Convenience method for subclass implementations that invalidates the canvasComponent this mode is currently installed in.
AbstractInputMode
  
Implementation of uninstall: Uninstalls this mode from the canvas.
AbstractInputMode
Events
 Event Summary Defined By
  Dispatched after the input mode was installed.AbstractInputMode
  Dispatched before the input mode will be installed.AbstractInputMode
  Dispatched after the input mode was uninstalled.AbstractInputMode
  Dispatched before the input mode will be uninstalled.AbstractInputMode
Public Constants
 ConstantDefined By
  INSTALLED : String = installed
[static]
AbstractInputMode
  INSTALLING : String = installing
[static]
AbstractInputMode
  UNINSTALLED : String = uninstalled
[static]
AbstractInputMode
  UNINSTALLING : String = uninstalling
[static]
AbstractInputMode
Property Detail
canvasproperty
canvas:CanvasComponent  [read-only]

The canvas instance this mode is currently installed in or null


Implementation
    public function get canvas():CanvasComponent
inputModeContextproperty 
inputModeContext:IInputModeContext  [read-only]

The context instance this mode is currently installed in or null if this instance is not installed.


Implementation
    public function get inputModeContext():IInputModeContext
installedproperty 
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.


Implementation
    public function get installed():Boolean
Method Detail
cancel()method
public function cancel():void

Cancels the editing of this mode. This implementation does nothing. Classes that need to perform clean-up should override this method and invoke super.cancel as the last statement.

dispose()method 
public function dispose():void

Disposes this input mode.

Subclasses should remove all listeners that they have registered.

fireInstalled()method 
protected function fireInstalled():void

fireInstalling()method 
protected function fireInstalling():void

fireUninstalled()method 
protected function fireUninstalled():void

fireUninstalling()method 
protected function fireUninstalling():void

initialize()method 
protected function initialize():void

Performs one-time initialization of this instance. This method should not be invoked by subclasses. This will be done automatically upon first installment of this mode.

This code will be executed only once. The canvas property will yield null when this code is executed. This method not should be used to install this mode into a specific canvas. Subclasses should always call super.initialize() first.

install()method 
public final function install(context:IInputModeContext):void

Installs this mode into the canvas of the given context.

This method is final. Subclasses should override the method installCore() instead.

This method fires an INSTALLING event, calls installCore(), then fires INSTALLED

Parameters

context:IInputModeContext — The context to use for installation.


Throws
ArgumentError ArgumentError: if the given context is null or the input mode is already installed.
installCore()method 
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.

invalidate()method 
protected function invalidate():void

Convenience method for subclass implementations that invalidates the canvasComponent this mode is currently installed in.

stop()method 
public function stop():Boolean

Tries to stop the editing. This implementation always return true. Subclasses that want to prevent a stop or need to do special clean up should do this here if super.stop() returns true.

A typical implementation should follow this idiom if it wants to stop:

         if( super.stop() ) {
           //do cleanup
           return true;
         } else {
           return false;
         }
         

Returns
Boolean
uninstall()method 
public final function uninstall(context:IInputModeContext):void

Uninstalls this mode from the canvas.

This method is final. Subclasses should override uninstallCore instead.

This method fires an UNINSTALLING event, calls uninstallCore(), then fires UNINSTALLED

Parameters

context:IInputModeContext — The context to remove this mode from. This is the same instance that has been passed to install( IInputModeContext ).


Throws
ArgumentError ArgumentError: if the given context is different from the context this mode is installed on.
uninstallCore()method 
protected function uninstallCore(context:IInputModeContext):void

Implementation of uninstall: Uninstalls this mode from the canvas.

Subclasses should always call super.uninstallCore( context ) as the last statement.

Parameters

context:IInputModeContext — The context to remove this mode from. This is the same instance that has been passed to install( IInputModeContext ).

Event Detail
installed Event
Event Object Type: flash.events.Event
Event.type property = com.yworks.canvas.input.INSTALLED

Dispatched after the input mode was installed.

installing Event  
Event Object Type: flash.events.Event
Event.type property = com.yworks.canvas.input.INSTALLING

Dispatched before the input mode will be installed.

Event handlers for this event can be used to configure the input mode before it is installed.

uninstalled Event  
Event Object Type: flash.events.Event
Event.type property = com.yworks.canvas.input.UNINSTALLED

Dispatched after the input mode was uninstalled.

uninstalling Event  
Event Object Type: flash.events.Event
Event.type property = com.yworks.canvas.input.UNINSTALLING

Dispatched before the input mode will be uninstalled.

Constant Detail
INSTALLEDConstant
public static const INSTALLED:String = installed

INSTALLINGConstant 
public static const INSTALLING:String = installing

UNINSTALLEDConstant 
public static const UNINSTALLED:String = uninstalled

UNINSTALLINGConstant 
public static const UNINSTALLING:String = uninstalling