public class MouseControlUtil
extends java.lang.Object
This is a utility class that provides methods for mouse gesture control. Currently, it can be used to make nodes draggable.
Modifier and Type | Method and Description |
---|---|
static void |
addSelectionRectangleGesture(javafx.scene.Parent root,
javafx.scene.shape.Rectangle rect)
Adds a selection rectangle gesture to the specified parent node.
|
static void |
addSelectionRectangleGesture(javafx.scene.Parent root,
javafx.scene.shape.Rectangle rect,
javafx.event.EventHandler<javafx.scene.input.MouseEvent> dragHandler,
javafx.event.EventHandler<javafx.scene.input.MouseEvent> pressHandler,
javafx.event.EventHandler<javafx.scene.input.MouseEvent> releaseHandler)
Adds a selection rectangle gesture to the specified parent node.
|
static void |
makeDraggable(javafx.scene.Node n)
Makes a node draggable via mouse gesture.
|
static void |
makeDraggable(javafx.scene.Node n,
javafx.event.EventHandler<javafx.scene.input.MouseEvent> dragHandler,
javafx.event.EventHandler<javafx.scene.input.MouseEvent> pressHandler)
Makes a node draggable via mouse gesture.
|
public static void makeDraggable(javafx.scene.Node n)
Makes a node draggable via mouse gesture.
<p> <b>Note:</b> Existing handlers will be replaced!</p>
n
- the node that shall be made draggablepublic static void addSelectionRectangleGesture(javafx.scene.Parent root, javafx.scene.shape.Rectangle rect)
Adds a selection rectangle gesture to the specified parent node.
A rectangle node must be specified that is used to indicate the selection area.
<p><b>Note:</b></p>
To support selection a node must implement the
SelectableNode
interface.
root
- parent noderect
- selectionn rectangleClipboard
,
WindowUtil.getDefaultClipboard()
public static void addSelectionRectangleGesture(javafx.scene.Parent root, javafx.scene.shape.Rectangle rect, javafx.event.EventHandler<javafx.scene.input.MouseEvent> dragHandler, javafx.event.EventHandler<javafx.scene.input.MouseEvent> pressHandler, javafx.event.EventHandler<javafx.scene.input.MouseEvent> releaseHandler)
Adds a selection rectangle gesture to the specified parent node.
A rectangle node must be specified that is used to indicate the selection area.
<p><b>Note:</b></p>
To support selection a node must implement the
SelectableNode
interface.
root
- parent noderect
- selectionn rectangledragHandler
- additional drag handler (optional, may be <code>null</code>)pressHandler
- additional press handler (optional, may be <code>null</code>)releaseHandler
- additional release handler (optional, may be <code>null</code>)Clipboard
,
WindowUtil.getDefaultClipboard()
public static void makeDraggable(javafx.scene.Node n, javafx.event.EventHandler<javafx.scene.input.MouseEvent> dragHandler, javafx.event.EventHandler<javafx.scene.input.MouseEvent> pressHandler)
Makes a node draggable via mouse gesture.
<p> <b>Note:</b> Existing handlers will be replaced!</p>
n
- the node that shall be made draggabledragHandler
- additional drag handlerpressHandler
- additional press handler