Package dk.gtz.graphedit.util
Class DragUtil
java.lang.Object
dk.gtz.graphedit.util.DragUtil
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 TypeMethodDescriptionstatic 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 aViewModelPoint
static void
makeDraggableInverse
(javafx.scene.Node node, javafx.scene.transform.Affine transform) Add event handlers to the provided node such that the providedAffine
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
-
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 aViewModelPoint
- Parameters:
node
- The node that will catch the related mouse eventspoint
- View model point values that will be modifiedviewportAffine
- Affine of the viewportbuffer
- 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 providedAffine
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 eventstransform
- The affine to add translation delta to
-