An input mode that recognizes simple touch taps.
Remarks
Clients register to Tapped to get notified of touch taps. This mode can be instructed to swallow taps if they lead happen shortly after the control gained focus. This is useful to prevent accidental taps from being processed if the user wanted to put the focus into the control, only.
This mode is exclusive by default.
Examples
TapInputMode
is installed as child mode of a GraphEditorInputMode or GraphViewerInputMode and can be retrieved from the tapInputMode property.Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.input.TapInputMode
See Also
Constructors
Creates a new instance of this mode that detects touch taps.
Parameters
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.
- tapHandlingPolicy - TapHandlingPolicy
The tap handling policy that determines the triggering behavior of Tapped and DoubleTapped. This option sets the tapHandlingPolicy property on the created object.
- validTapHitTestable - IHitTestable
A hit test that determines where this mode should recognize taps. This option sets the validTapHitTestable property on the created object.
- requestMutexOnTap - boolean
Whether to request the mutex on a tap. This option sets the requestMutexOnTap property on the created object.
- swallowFocusTap - boolean
A property that determines whether taps should be swallowed if they happen within a short amount of time after the CanvasComponent got focus. This option sets the swallowFocusTap property on the created object.
Properties
Returns the installed ConcurrencyController.
Gets or sets the enabled state of this input mode.
Remarks
Examples
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
Implements
Gets the priority of this input mode.
Remarks
See Also
Implements
Gets or sets whether to request the mutex on a tap.
Remarks
true
this will discard other concurrent input modes on a tap. The default is true
.Gets or sets a property that determines whether taps should be swallowed if they happen within a short amount of time after the CanvasComponent got focus.
Remarks
false
. If set to true
taps are discarded within 100 ms after the focus entered.See Also
Gets or sets the tap handling policy that determines the triggering behavior of Tapped and DoubleTapped.
See Also
Gets the location of the last tap.
Gets or sets a hit test that determines where this mode should recognize taps.
Remarks
See Also
Methods
Cancels the editing of this mode.
Remarks
See Also
Implements
Creates the event recognizer that is used to recognize the press event for this instance.
Creates the event recognizer that is used to recognize the release event for this instance.
Creates the event recognizer that is used to recognize the taps for this instance.
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
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 during the time the mode is installed.
- controller - ConcurrencyController
- The ConcurrencyController for this mode.
See Also
Implements
Determines whether the given event is a press event that occurred at an invalid location.
See Also
Called after cancel has been called.
Remarks
Can be overridden in subclasses to perform additional actions after the mode has been canceled.
This implementation does nothing.
Called after the active property of the installed ConcurrencyController has been set to true
.
Remarks
Can be overridden in subclasses to perform additional actions after the mode has been activated.
Overriding implementations should call the base implementation.
Called after the active property of the installed ConcurrencyController has been set to false
.
Remarks
Can be overridden in subclasses to perform additional actions after the mode has been deactivated.
Overriding implementations should call the base implementation.
Called once this mode has recognized a double-tap gesture.
Remarks
Parameters
A map of options to pass to the method.
- evt - TapEventArgs
- The arguments.
Called after tryStop has been called.
Remarks
Can be overridden in subclasses to perform additional actions after the mode has been stopped.
This implementation does nothing.
Called once this mode has recognized a tap gesture.
Remarks
Parameters
A map of options to pass to the method.
- evt - TapEventArgs
- The arguments.
Prevents a double-tap event from being issued if the next tap would do so and sends only a single tap instead.
Remarks
The intention is for "breaking" a double tap if an input mode using TapInputMode performs actions that would lead to surprising behavior if the next tap would lead to a double-tap. Examples of this are GraphEditorInputMode's selection cycling where several taps in short succession may occur, as well as creating a node by tapping on the canvas and selecting it immediately afterwards with another tap.
This method's effect is very short-lived. It really only prevents a double-tap event for the very next tap that this input mode handles. The internal flag set by this method is re-set on every tap received. This also means that if you call this method and the next tap is just a regular single-tap the flag is cleared nonetheless.
Returns and resets the flag set by preventNextDoubleTap.
Remarks
Called by the client in order to stop a 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
Implements
Uninstalls this mode from the given context.
Remarks
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.
Overriding implementations should call the base implementation after their own code.
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.
Implements
Events
Occurs once a double-tap has been detected.
See Also
Event Registration
addDoubleTappedListener(function(this, TapEventArgs):void)
Event Deregistration
removeDoubleTappedListener(function(this, TapEventArgs):void)
Signature Details
function(sender: this, evt: TapEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - TapEventArgs
- An object that contains the event data.
Occurs once a tap has been detected.
See Also
Event Registration
addTappedListener(function(this, TapEventArgs):void)
Event Deregistration
removeTappedListener(function(this, TapEventArgs):void)
Signature Details
function(sender: this, evt: TapEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - TapEventArgs
- An object that contains the event data.