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.
See Also
Developer's Guide
API
- InputModeBase
Members
Properties
See Also
Developer's Guide
Implemented in
ClickInputMode.priority, ContextMenuInputMode.priority, CreateBendInputMode.priority, CreateEdgeInputMode.priority, DropInputMode.priority, EditLabelInputMode.priority, FocusGuardInputMode.priority, HandleInputMode.priority, InputModeBase.priority, ItemHoverInputMode.priority, KeyboardInputMode.priority, LassoSelectionInputMode.priority, MarqueeSelectionInputMode.priority, MoveInputMode.priority, MoveViewportInputMode.priority, MultiplexingInputMode.priority, NavigationInputMode.priority, ResizeStripeInputMode.priority, TextEditorInputMode.priority, ToolTipInputMode.priority, WaitInputMode.priorityMethods
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()
}Implemented in
ClickInputMode.cancel, ContextMenuInputMode.cancel, CreateBendInputMode.cancel, CreateEdgeInputMode.cancel, DropInputMode.cancel, EditLabelInputMode.cancel, FocusGuardInputMode.cancel, HandleInputMode.cancel, InputModeBase.cancel, ItemHoverInputMode.cancel, KeyboardInputMode.cancel, LassoSelectionInputMode.cancel, MarqueeSelectionInputMode.cancel, MoveInputMode.cancel, MoveViewportInputMode.cancel, MultiplexingInputMode.cancel, NavigationInputMode.cancel, ResizeStripeInputMode.cancel, TextEditorInputMode.cancel, ToolTipInputMode.cancel, WaitInputMode.cancelInstalls this mode into the given context that is provided by the canvas.
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
- 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
API
- uninstall
Implemented in
ClickInputMode.install, ContextMenuInputMode.install, CreateBendInputMode.install, CreateEdgeInputMode.install, DropInputMode.install, EditLabelInputMode.install, FocusGuardInputMode.install, HandleInputMode.install, InputModeBase.install, ItemHoverInputMode.install, KeyboardInputMode.install, LassoSelectionInputMode.install, MarqueeSelectionInputMode.install, MoveInputMode.install, MoveViewportInputMode.install, MultiplexingInputMode.install, NavigationInputMode.install, ResizeStripeInputMode.install, TextEditorInputMode.install, ToolTipInputMode.install, WaitInputMode.installfalseReturn Value
- boolean
trueif and only if the editing has been stopped or there was no edit in progress
See Also
API
- cancel
Implemented in
ClickInputMode.tryStop, ContextMenuInputMode.tryStop, CreateBendInputMode.tryStop, CreateEdgeInputMode.tryStop, DropInputMode.tryStop, EditLabelInputMode.tryStop, FocusGuardInputMode.tryStop, HandleInputMode.tryStop, InputModeBase.tryStop, ItemHoverInputMode.tryStop, KeyboardInputMode.tryStop, LassoSelectionInputMode.tryStop, MarqueeSelectionInputMode.tryStop, MoveInputMode.tryStop, MoveViewportInputMode.tryStop, MultiplexingInputMode.tryStop, NavigationInputMode.tryStop, ResizeStripeInputMode.tryStop, TextEditorInputMode.tryStop, ToolTipInputMode.tryStop, WaitInputMode.tryStopUninstalls this mode from the given context.
Parameters
- context: IInputModeContext
- The context to deregister from. This is the same instance that had been passed to install during installation.