Class DragUtil

java.lang.Object
dk.gtz.graphedit.util.DragUtil

public class DragUtil extends Object
Utility class for mousedragging behaviors. Note that there are differing "types" of the concept of "dragging" with a mouse. - If the intention is to have an object follow the mouse, this class simply calls that "dragging" - If the intention is to have a viewport and all its elements move with the mouse, this class calls that "inverse dragging" - If the intention is to have a drag and drop behavior, this class calls that "dnd"
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    makeDraggable(javafx.scene.Node node, ViewModelPoint point, javafx.scene.transform.Affine viewportAffine, ViewModelProjectResource buffer)
    Add some event handlers to the provided node that makes it draggable through a ViewModelPoint
    static void
    makeDraggableInverse(javafx.scene.Node node, javafx.scene.transform.Affine transform)
    Add event handlers to the provided node such that the provided Affine will be inversely translated on mouse dragging Note that the drag events will not be registered as undoable actions NB: The provided affine only gets changes on mouse secondary button presses

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • makeDraggable

      public static void makeDraggable(javafx.scene.Node node, ViewModelPoint point, javafx.scene.transform.Affine viewportAffine, ViewModelProjectResource buffer)
      Add some event handlers to the provided node that makes it draggable through a ViewModelPoint
      Parameters:
      node - The node that will catch the related mouse events
      point - View model point values that will be modified
      viewportAffine - Affine of the viewport
      buffer - The buffer to push undoable actions to
    • makeDraggableInverse

      public static void makeDraggableInverse(javafx.scene.Node node, javafx.scene.transform.Affine transform)
      Add event handlers to the provided node such that the provided Affine will be inversely translated on mouse dragging Note that the drag events will not be registered as undoable actions NB: The provided affine only gets changes on mouse secondary button presses
      Parameters:
      node - The node that will catch the related mouse events
      transform - The affine to add translation delta to