This implementation will request the mutex as soon as it recognizes a drag with the mouse or touch.
If allowPinchZoom is enabled, zooming is done with two fingers using the pinch zoom gesture. If the primary pointer is released during pinch, the secondary pointer is used for moving the viewpoint. The pinch zoom then can be restarted by touching another pointer that is recognized as the primary pointer.
If allowSinglePointerMovement is enabled, moving the viewport can be started with a single pointer, i.e., touching with one finger. Disabling this property is especially useful for applications that allow editing. When disabled, other gestures like moving items, or creating edges can be configured to start without a long press.
options - Object A map of options to pass to the method.
priority - number
exclusive - boolean
A value indicating whether this mode will be the only one running when it has the mutex. This option sets the exclusive property on the created object.
enabled - boolean
The enabled state of this input mode. This option sets the enabled property on the created object.
The event recognizer that determines whether to start the 'move viewport' gesture. This option sets the primaryDownRecognizer property on the created object.
The event recognizer that determines whether to move the viewport or zoom the canvas if a secondary device is down. This option sets the primaryMoveRecognizer property on the created object.
The event recognizer that determines whether to finish the 'move viewport' or 'pinch' gesture. This option sets the primaryUpRecognizer property on the created object.
The event recognizer that determines whether to zoom the canvas using the 'pinch' gesture or move the viewport if no primary device is down. This option sets the secondaryMoveRecognizer property on the created object.
The event recognizer that determines whether to finish the pinch zoom gesture or finish the move if no primary device is down. This option sets the secondaryUpRecognizer property on the created object.
The mode that determines when to use inertia when dragging the viewport. This option sets the inertia property on the created object.
allowPinchZoom - boolean
A value indicating whether to allow the pinch zoom gesture. This option sets the allowPinchZoom property on the created object.
allowSinglePointerMovement - boolean
A value indicating whether moving the viewport can be started with a single pointer, i.e., touching with one finger. This option sets the allowSinglePointerMovement property on the created object.
A value indicating whether touch panning should snap to the x- or y-axis. This option sets the snapPanning property on the created object.
snapPanningThreshold - number
A value that determines how far the pointer has to move away from the snapped axis in order to start with free panning. This option sets the snapPanningThreshold property on the created object.
pinchZoomThreshold - number
A value that determines how far the two pointers have to move apart while panning with two fingers in order to start a zoom gesture. This option sets the pinchZoomThreshold property on the created object.
pinchLockZoomThreshold - number
The distance threshold for returning from pinch zoom to two-finger panning with locked zoom level. This option sets the pinchLockZoomThreshold property on the created object.
The event recognizer that determines whether it is valid to begin moving the viewport. This option sets the validBeginRecognizer property on the created object.
Gets or sets a value indicating whether moving the viewport can be started with a single pointer, i.e., touching with one finger.
Remarks
The default value is true.
Examples
Setting this property to false is especially useful for applications that allow editing. When disabled, other gestures like moving items, or creating edges can be configured to start without a long press.
Gets or sets the enabled state of this input mode.
Remarks
Clients can use this property to disable or reenable this instance. This will set the Enabled property of the installed controller so a disabled instance should never try to acquire the input mutex.
Gets or sets a value indicating whether this mode will be the only one running when it has the mutex.
Remarks
The value of this property will be delegated to the exclusive property of the controller.
If this mode is marked as exclusive and has the mutex, all other modes added to the same MultiplexingInputMode will be deactivated. Otherwise it will always run concurrently with all other modes.
Gets the context instance this mode is currently installed in or null if this instance is not installed.
Remarks
Note that this instance should not be passed down to subordinate modes or instances. Instead a corresponding context that has this instance set as the parentInputMode should be used.
Gets or sets the event recognizer that determines whether to start the navigation gesture.
Remarks
By default this recognizer detects left mouse button presses. If this input mode is a child mode of GraphEditorInputMode method createMoveViewportInputMode sets a different recognizer which detects left clicks with Ctrl held down.
The priority will influence the order in which the modes will be installed into the canvas control. The lower the priority value, the earlier it will be installed. If two modes are installed using the same priority value, the first one will be installed earlier.
Gets or sets the event recognizer that determines whether to zoom the canvas using the 'pinch' gesture or move the viewport if no primary device is down.
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. Subclasses should override this method to register the corresponding event handler delegates for the various input events they need to register with.
Overriding implementations should call the base implementation, first.
Parameters
options - Object A map of options to pass to the method.
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.
Can be overridden in subclasses to perform additional actions after the mode has been stopped.
This implementation does nothing.
tryStop
() : boolean
Called by the client in order to stop a current editing progress.
Remarks
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
↪boolean
true if and only if the editing has been stopped or there was no edit in progress
Uninstalls this mode from the given context that is provided by the canvas.
Remarks
This method is called to un-register this instance. Subclasses should override this method to un-register the event handler delegates and free resources which were registered in the install method.
Overriding implementations should call the base implementation at the end.
Parameters
options - Object A map of options to pass to the method.