Interface implemented by input modes to handle user input in a CanvasComponent instance.
Remarks
Input modes capture user gestures (or any other kind of user interactions) and manipulate the contents of the canvas or the model behind it.
Implementations may request an input mutex from the ConcurrencyController that will be given to them in their install method. This allows them to exclusively modify the contents of the view. If another IInputMode successfully acquires the mutex, the ConcurrencyController will be deactivated.
Type Details
- yFiles module
- view
See Also
Properties
Gets the priority of this input mode.
Remarks
See Also
Methods
Will be called to unconditionally cancel all ongoing edits.
Remarks
This will be called prior to the uninstalling of this instance and when other input modes temporarily acquire the mutex.
In order to stop an active input mode manually, client code should use the following idiom:
if (!mode.tryStop()) {
mode.cancel()
}
Installs this mode into the given context that is provided by the canvas.
Remarks
In general a mode can only be installed into a single canvas at all times.
This method is called to initialize this instance. Implement this method to register the corresponding event handlers for the various input events this mode will listen to.
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 installed.
Parameters
A map of options to pass to the method.
- 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 while the mode is installed.
- controller - ConcurrencyController
- The ConcurrencyController for this mode.
See Also
Will be called to request a stop of the current editing progress.
Remarks
false
Returns
- ↪boolean
true
if and only if the editing has been stopped or there was no edit in progress
See Also
Uninstalls this mode from the given context.
Remarks
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context to deregister from. This is the same instance that had been passed to install during installation.