documentationfor yFiles for HTML 2.6

HandleInputMode

An IInputMode implementation that can handle a collection of IHandles.

Inheritance Hierarchy
HandleInputMode
Implemented Interfaces

Remarks

This mode will render a visual representation of IHandles in the CanvasComponent and deal with mouse gestures that drag the visual representations accordingly.

This mode is exclusive by default.

Examples

Typically the HandleInputMode is installed as child mode of a GraphEditorInputMode and can be retrieved from the HandleInputMode property.

Getting the HandleInputMode from its parent input mode
const handleInputMode = mode.handleInputMode

If one needs to execute some code after some items have been moved by the HandleInputMode he can register a handler to its DragFinished event. The moved items can be retrieved from the affectedItems property:

mode.handleInputMode.addDragFinishedListener((sender, args) => {
  for (const item of mode.handleInputMode.affectedItems) {
    // these items have been moved
  }
})
The following example shows how to configure touch gestures without long press.
Configure touch gestures without long press
mode.moveViewportInputMode.allowSinglePointerMovement = true
mode.createBendInputMode.prepareRecognizerTouch =
  TouchEventRecognizers.TOUCH_DOWN_PRIMARY
mode.createEdgeInputMode.prepareRecognizerTouch =
  TouchEventRecognizers.TOUCH_DOWN_PRIMARY
mode.handleInputMode.pressedRecognizerTouch =
  TouchEventRecognizers.TOUCH_DOWN_PRIMARY
mode.lassoSelectionInputMode.prepareRecognizerTouch =
  TouchEventRecognizers.TOUCH_DOWN_PRIMARY
mode.marqueeSelectionInputMode.pressedRecognizerTouch =
  TouchEventRecognizers.TOUCH_DOWN_PRIMARY
mode.moveInputMode.pressedRecognizerTouch =
  TouchEventRecognizers.TOUCH_DOWN_PRIMARY

Type Details

yfiles module
view-component
yfiles-umd modules
All view modules
Legacy UMD name
yfiles.input.HandleInputMode

See Also

Constructors

Properties

Methods

Events

Constants