Packagecom.yworks.canvas.input
Classpublic class AbstractInputMode
InheritanceAbstractInputMode Inheritance flash.events.EventDispatcher
ImplementsIInputMode
SubclassesAbstractConcurrentInputMode, MultiplexingInputMode, 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.
AbstractInputMode
Public Methods
 MethodDefined by
  
cancel():void
Cancels the editing of this mode.
AbstractInputMode
  
dispose():void
Disposes this input mode.
AbstractInputMode
  
install(context:IInputModeContext):void
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
  
initialize():void
Performs one-time initialization of this instance.
AbstractInputMode
  
invalidate():void
Convenience method for subclass implementations that invalidates the canvasComponent this mode is currently installed in.
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.

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 function install(context:IInputModeContext):void

Installs this mode into the canvas of the given context.

Subclasses should override this method and call super.install(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 function uninstall(context:IInputModeContext):void

Uninstalls this mode from the canvas.

Subclasses should always call super.uninstall( 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 ).