Packagecom.yworks.canvas.input
Interfacepublic interface IInputMode
Implementors AbstractInputMode, NodeEffectInputMode

Interface implemented by input modes that can be registered with a GraphCanvasComponent.

Input modes capture user gestures (or any other kind of "input") and manipulate the contents of the graph canvas or the graph model.



Public Methods
 MethodDefined By
  
cancel():void
Called by the client to unconditionally cancel all editing.
IInputMode
  
Installs this mode into the given canvas.
IInputMode
  
stop():Boolean
Called by the client in order to stop a current editing progress.
IInputMode
  
Uninstalls this mode from the given canvas.
IInputMode
Method Detail
cancel()method
public function cancel():void

Called by the client to unconditionally cancel all editing. This will be called prior to the uninstalling of this instance. In order to stop an active input mode manually, client code should use the following idiom:

	     if ( !mode.stop() ){
	       mode.cancel();
	     }
	     

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

Installs this mode into the given canvas.

Installation ususally means registering some event listeners on the canvasComponent or on canvasComponent.root.

When this instance gets uninstalled from the context the same context instance will be passed to it.

Implementations may hold a reference to the context instance and use it while they are being installed.

Parameters

context:IInputModeContext — The context that this instance shall be installed into. The same instance will be passed to this instance during uninstall. A reference to the context may be kept and queried during the time the mode is installed.

stop()method 
public function stop():Boolean

Called by the client in order to stop a current editing progress. This should stop the current edit, if one is in progress and possibly commit all of the changes. If stopping is not possible, this method can return false

Returns
Booleantrue if and only if the editing has been stopped or there was no edit in progress
uninstall()method 
public function uninstall(context:IInputModeContext):void

Uninstalls this mode from the given canvas. This code should clean up all changes made to the canvas in the install method. After a mode has been uninstalled it can be installed again into the same or another canvas.

Parameters

context:IInputModeContext — The context to deregister from. This is the same instance that had been passed to install during installation.