MouseEvent.
Full press-drag-release gesture can be started by calling
startFullDrag() (on a node or scene) inside of a DRAG_DETECTED
event handler. This call activates delivering of MouseDragEvents
to the nodes that are under cursor during the dragging gesture.
When you drag a node, it's still under cursor, so it is considered
being a potential gesture target during the whole gesture. If you need to
drag a node to a different node and let the other node know about it,
you need to ensure that the nodes under the dragged node are picked
as the potential gesture targets. You can achieve this by calling
setMouseTransparent(true) on the dragged node in a
MOUSE_PRESSED handler and returning it back to false in a
MOUSE_RELEASED handler. This way the nodes under the dragged
node will receive the MouseDragEvents, while all the
MouseEvents will still be delivered to the (currently mouse
transparent) gesture source.
The entered/exited events behave similarly to mouse entered/exited
events, please see MouseEvent overview.
| Modifier and Type | Field and Description |
|---|---|
| public static final EventType | ANY
Common supertype for all mouse event types.
|
| private final transient Object | |
| public static final EventType | MOUSE_DRAG_ENTERED
This event occurs when the gesture enters a node. |
| public static final EventType | MOUSE_DRAG_ENTERED_TARGET
This event occurs when the gesture enters a node. |
| public static final EventType | MOUSE_DRAG_EXITED
This event occurs when the gesture exits a node. |
| public static final EventType | MOUSE_DRAG_EXITED_TARGET
This event occurs when the gesture exits a node. |
| public static final EventType | MOUSE_DRAG_OVER
This event occurs when the gesture progresses within this node. |
| public static final EventType | MOUSE_DRAG_RELEASED
This event occurs when the gesture ends (by releasing mouse button) on this node. |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | MouseDragEvent(Object
the source of the event, which can be source, EventTarget nullthe target of the event, which can be target, EventType<MouseDragEvent> nullThe type of the event eventType, double The x with respect to the scene x, double The y with respect to the scene y, double The x coordinate relative to screen screenX, double The y coordinate relative to screen screenY, MouseButton the mouse button used button, int number of click counts clickCount, boolean true if shift modifier was pressed shiftDown, boolean true if control modifier was pressed controlDown, boolean true if alt modifier was pressed altDown, boolean true if meta modifier was pressed metaDown, boolean true if primary button was pressed primaryButtonDown, boolean true if middle button was pressed middleButtonDown, boolean true if secondary button was pressed secondaryButtonDown, boolean if this event was synthesized synthesized, boolean whether this event denotes a popup trigger for current platform popupTrigger, PickResult pick result. Can be null, in this case a 2D pick result
without any further values is constructed
based on the scene coordinates and target pickResult, Object source object of the ongoing gesture gestureSource)Constructs new MouseDragEvent event. |
| public | MouseDragEvent(Object
the source of the event, which can be source, EventTarget nullthe target of the event, which can be target, EventType<MouseDragEvent> nullThe type of the event eventType, double The x with respect to the scene x, double The y with respect to the scene y, double The x coordinate relative to screen screenX, double The y coordinate relative to screen screenY, MouseButton the mouse button used button, int number of click counts clickCount, boolean true if shift modifier was pressed shiftDown, boolean true if control modifier was pressed controlDown, boolean true if alt modifier was pressed altDown, boolean true if meta modifier was pressed metaDown, boolean true if primary button was pressed primaryButtonDown, boolean true if middle button was pressed middleButtonDown, boolean true if secondary button was pressed secondaryButtonDown, boolean true if back button was pressed backButtonDown, boolean true if forward button was pressed forwardButtonDown, boolean if this event was synthesized synthesized, boolean whether this event denotes a popup trigger for current platform popupTrigger, PickResult pick result. Can be null, in this case a 2D pick result
without any further values is constructed
based on the scene coordinates and target pickResult, Object source object of the ongoing gesture gestureSource)Constructs new MouseDragEvent event. |
| public | MouseDragEvent(EventType<MouseDragEvent>
The type of the event eventType, double The x with respect to the scene x, double The y with respect to the scene y, double The x coordinate relative to screen screenX, double The y coordinate relative to screen screenY, MouseButton the mouse button used button, int number of click counts clickCount, boolean true if shift modifier was pressed shiftDown, boolean true if control modifier was pressed controlDown, boolean true if alt modifier was pressed altDown, boolean true if meta modifier was pressed metaDown, boolean true if primary button was pressed primaryButtonDown, boolean true if middle button was pressed middleButtonDown, boolean true if secondary button was pressed secondaryButtonDown, boolean if this event was synthesized synthesized, boolean whether this event denotes a popup trigger for current platform popupTrigger, PickResult pick result. Can be null, in this case a 2D pick result
without any further values is constructed
based on the scene coordinates pickResult, Object source object of the ongoing gesture gestureSource)Constructs new MouseDragEvent event with null source and target. |
| Modifier and Type | Method and Description |
|---|---|
| public MouseDragEvent | copyFor(Object
New event source newSource, EventTarget New event target newTarget)Overrides javafx. Copies this event for a different source and target. |
| public MouseDragEvent | copyFor(Object
the new source of the copied event newSource, EventTarget the new target of the copied event newTarget, EventType<? extends MouseEvent> the new eventType type)Overrides javafx. Creates a copy of the given event with the given fields substituted. |
| public EventType | getEventType()
Overrides javafx. Gets the event type of this event. |
| public Object | Returns: The source object of the gesture.Returns the source object of the ongoing gesture. |
| public String | Returns: a string representation of thisMouseDragEvent object.Overrides javafx. Returns a string representation of this |
| ANY | back to summary |
|---|---|
| public static final EventType<MouseDragEvent> ANY Hides javafx. Common supertype for all mouse event types. | |
| gestureSource | back to summary |
|---|---|
| private final transient Object gestureSource | |
| MOUSE_DRAG_ENTERED | back to summary |
|---|---|
| public static final EventType<MouseDragEvent> MOUSE_DRAG_ENTERED This event occurs when the gesture enters a node. This event type is
delivered only to the entered node, if parents want to filter it or get
the bubbling event, they need to use | |
| MOUSE_DRAG_ENTERED_TARGET | back to summary |
|---|---|
| public static final EventType<MouseDragEvent> MOUSE_DRAG_ENTERED_TARGET This event occurs when the gesture enters a node. It's the bubbling variant,
which is delivered also to all parents of the entered node (unless it
was consumed). When notifications about mouse entering some of node's
children are not desired, | |
| MOUSE_DRAG_EXITED | back to summary |
|---|---|
| public static final EventType<MouseDragEvent> MOUSE_DRAG_EXITED This event occurs when the gesture exits a node. This event type is
delivered only to the exited node, if parents want to filter it or get
the bubbling event, they need to use | |
| MOUSE_DRAG_EXITED_TARGET | back to summary |
|---|---|
| public static final EventType<MouseDragEvent> MOUSE_DRAG_EXITED_TARGET This event occurs when the gesture exits a node. It's the bubbling variant,
which is delivered also to all parents of the exited node (unless it
was consumed). When notifications about mouse exiting some of node's
children are not desired, | |
| MOUSE_DRAG_OVER | back to summary |
|---|---|
| public static final EventType<MouseDragEvent> MOUSE_DRAG_OVER This event occurs when the gesture progresses within this node. | |
| MOUSE_DRAG_RELEASED | back to summary |
|---|---|
| public static final EventType<MouseDragEvent> MOUSE_DRAG_RELEASED This event occurs when the gesture ends (by releasing mouse button) on this node. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| MouseDragEvent | back to summary |
|---|---|
| public MouseDragEvent(Object source, EventTarget target, EventType<MouseDragEvent> eventType, double x, double y, double screenX, double screenY, MouseButton button, int clickCount, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean primaryButtonDown, boolean middleButtonDown, boolean secondaryButtonDown, boolean synthesized, boolean popupTrigger, PickResult pickResult, Object gestureSource) Constructs new MouseDragEvent event.
Both
| |
| MouseDragEvent | back to summary |
|---|---|
| public MouseDragEvent(Object source, EventTarget target, EventType<MouseDragEvent> eventType, double x, double y, double screenX, double screenY, MouseButton button, int clickCount, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean primaryButtonDown, boolean middleButtonDown, boolean secondaryButtonDown, boolean backButtonDown, boolean forwardButtonDown, boolean synthesized, boolean popupTrigger, PickResult pickResult, Object gestureSource) Constructs new MouseDragEvent event.
| |
| MouseDragEvent | back to summary |
|---|---|
| public MouseDragEvent(EventType<MouseDragEvent> eventType, double x, double y, double screenX, double screenY, MouseButton button, int clickCount, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean primaryButtonDown, boolean middleButtonDown, boolean secondaryButtonDown, boolean synthesized, boolean popupTrigger, PickResult pickResult, Object gestureSource) Constructs new MouseDragEvent event with null source and target.
Both
| |
| copyFor | back to summary |
|---|---|
| public MouseDragEvent copyFor(Object newSource, EventTarget newTarget) Overrides javafx. Doc from javafx. Copies this event for a different source and target. In most cases you don't need to use this method, it's called automatically when you fire the event.
| |
| copyFor | back to summary |
|---|---|
| public MouseDragEvent copyFor(Object newSource, EventTarget newTarget, EventType<? extends MouseEvent> type) Overrides javafx. Doc from javafx. Creates a copy of the given event with the given fields substituted.
| |
| getEventType | back to summary |
|---|---|
| public EventType Overrides javafx. Doc from javafx. Gets the event type of this event. Objects of the same
| |
| getGestureSource | back to summary |
|---|---|
| public Object getGestureSource() Returns the source object of the ongoing gesture.
Gesture source is the object that started the full press-drag-release
gesture (by
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides javafx. Returns a string representation of this | |