documentationfor yFiles for HTML 2.6

MoveInputMode

Generic IInputMode implementation that can be used to move something in the canvas using the mouse.

Inheritance Hierarchy
Implemented Interfaces

Remarks

This implementation uses the hitTestable to determine where the user can begin dragging the selection. It will then use the positionHandler to delegate the actual work of moving the elements to.

This mode is exclusive by default.

Examples

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

Getting the MoveInputMode from its parent input mode
const moveInputMode = mode.moveInputMode

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

mode.moveInputMode.addDragFinishedListener((sender, args) => {
  for (const item of mode.moveInputMode.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.MoveInputMode

See Also

Constructors

Properties

Methods

Events