The event coordinates contain default position for the context menu. For mouse-triggered events it is the position of the mouse cursor, for keyboard-triggered events it is a point inside of bounds of current focus owner (which is the event's target).
| Modifier and Type | Field and Description |
|---|---|
| public static final EventType | ANY
Common supertype for all context menu event types.
|
| public static final EventType | CONTEXT_MENU_REQUESTED
This event occurs when a context menu is requested. |
| private final boolean | keyboardTrigger
The boolean that indicates the event was triggered by a keyboard gesture. |
| private PickResult | pickResult
Information about the pick if the picked |
| private final double | sceneX
Horizontal x position of the event relative to the
origin of the |
| private final double | sceneY
Vertical y position of the event relative to the
origin of the |
| private final double | screenX
Absolute horizontal x position of the event. |
| private final double | screenY
Absolute vertical y position of the event. |
| private static final long | |
| private transient double | x
Horizontal x position of the event relative to the origin of the ContextMenuEvent's node. |
| private transient double | y
Vertical y position of the event relative to the origin of the ContextMenuEvent's node. |
| private transient double | z
Depth z position of the event relative to the origin of the MouseEvent's node. |
| Access | Constructor and Description |
|---|---|
| public | ContextMenuEvent(Object
the source of the event. Can be null. source, EventTarget the target of the event. Can be null. target, EventType<ContextMenuEvent> 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, boolean true if this event was triggered by keyboard. keyboardTrigger, 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 the target pickResult)Constructs new ContextMenu event. |
| public | ContextMenuEvent(EventType<ContextMenuEvent>
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, boolean true if this event was triggered by keyboard. keyboardTrigger, 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)Constructs new ContextMenu event with empty source and target. |
| Modifier and Type | Method and Description |
|---|---|
| public ContextMenuEvent | copyFor(Object
the new source of the copied event newSource, EventTarget the new target of the copied event newTarget)Overrides javafx. Creates and returns a copy of this event with the specified event source and target. |
| public EventType | getEventType()
Overrides javafx. Gets the event type of this event. |
| public final PickResult | Returns: new PickResult object that contains information about the pickReturns information about the pick. |
| public final double | Returns: horizontal position of the event relative to the origin of theScene that contains the ContextMenuEvent's sourceReturns horizontal position of the event relative to the
origin of the |
| public final double | Returns: vertical position of the event relative to the origin of theScene that contains the ContextMenuEvent's sourceReturns vertical position of the event relative to the
origin of the |
| public final double | Returns: absolute horizontal position of the eventReturns absolute horizontal position of the event. |
| public final double | Returns: absolute vertical position of the eventReturns absolute vertical position of the event. |
| public final double | Returns: horizontal position of the event relative to the origin of the ContextMenuEvent's source.Horizontal position of the event relative to the origin of the ContextMenuEvent's source. |
| public final double | Returns: vertical position of the event relative to the origin of the ContextMenuEvent's source.Vertical position of the event relative to the origin of the ContextMenuEvent's source. |
| public final double | Returns: depth position of the event relative to the origin of the MouseEvent's source.Depth position of the event relative to the origin of the MouseEvent's source. |
| public boolean | Returns: true if the event was caused by the keyboardDetermines whether this event originated from the keyboard. |
| private void | |
| private void | recomputeCoordinatesToSource(ContextMenuEvent
Event whose coordinates are to be filled newEvent, Object Source object to compute coordinates for newSource)Fills the given event by this event's coordinates recomputed to the given source object |
| public String | Returns: a string representation of thisContextMenuEvent object.Overrides java. Returns a string representation of this |
| ANY | back to summary |
|---|---|
| public static final EventType<ContextMenuEvent> ANY Hides javafx. Common supertype for all context menu event types.
| |
| CONTEXT_MENU_REQUESTED | back to summary |
|---|---|
| public static final EventType<ContextMenuEvent> CONTEXT_MENU_REQUESTED This event occurs when a context menu is requested. | |
| keyboardTrigger | back to summary |
|---|---|
| private final boolean keyboardTrigger The boolean that indicates the event was triggered by a keyboard gesture. | |
| pickResult | back to summary |
|---|---|
| private PickResult pickResult Information about the pick if the picked | |
| sceneX | back to summary |
|---|---|
| private final double sceneX Horizontal x position of the event relative to the
origin of the | |
| sceneY | back to summary |
|---|---|
| private final double sceneY Vertical y position of the event relative to the
origin of the | |
| screenX | back to summary |
|---|---|
| private final double screenX Absolute horizontal x position of the event. | |
| screenY | back to summary |
|---|---|
| private final double screenY Absolute vertical y position of the event. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| x | back to summary |
|---|---|
| private transient double x Horizontal x position of the event relative to the origin of the ContextMenuEvent's node. | |
| y | back to summary |
|---|---|
| private transient double y Vertical y position of the event relative to the origin of the ContextMenuEvent's node. | |
| z | back to summary |
|---|---|
| private transient double z Depth z position of the event relative to the origin of the MouseEvent's node. | |
| ContextMenuEvent | back to summary |
|---|---|
| public ContextMenuEvent(Object source, EventTarget target, EventType<ContextMenuEvent> eventType, double x, double y, double screenX, double screenY, boolean keyboardTrigger, PickResult pickResult) Constructs new ContextMenu event.
| |
| ContextMenuEvent | back to summary |
|---|---|
| public ContextMenuEvent(EventType<ContextMenuEvent> eventType, double x, double y, double screenX, double screenY, boolean keyboardTrigger, PickResult pickResult) Constructs new ContextMenu event with empty source and target.
| |
| copyFor | back to summary |
|---|---|
| public ContextMenuEvent copyFor(Object newSource, EventTarget newTarget) Overrides javafx. Doc from javafx. Creates and returns a copy of this event with the specified event source
and target. If the source or target is set to
| |
| getEventType | back to summary |
|---|---|
| public EventType Overrides javafx. Doc from javafx. Gets the event type of this event. Objects of the same
| |
| getPickResult | back to summary |
|---|---|
| public final PickResult getPickResult() Returns information about the pick.
| |
| getSceneX | back to summary |
|---|---|
| public final double getSceneX() Returns horizontal position of the event relative to the
origin of the
| |
| getSceneY | back to summary |
|---|---|
| public final double getSceneY() Returns vertical position of the event relative to the
origin of the
| |
| getScreenX | back to summary |
|---|---|
| public final double getScreenX() Returns absolute horizontal position of the event.
For more information about this event's coordinate semantics please see
the general description of
| |
| getScreenY | back to summary |
|---|---|
| public final double getScreenY() Returns absolute vertical position of the event.
For more information about this event's coordinate semantics please see
the general description of
| |
| getX | back to summary |
|---|---|
| public final double getX() Horizontal position of the event relative to the
origin of the ContextMenuEvent's source.
For more information about this event's coordinate semantics please see
the general description of
| |
| getY | back to summary |
|---|---|
| public final double getY() Vertical position of the event relative to the
origin of the ContextMenuEvent's source.
For more information about this event's coordinate semantics please see
the general description of
| |
| getZ | back to summary |
|---|---|
| public final double getZ() Depth position of the event relative to the origin of the MouseEvent's source.
| |
| isKeyboardTrigger | back to summary |
|---|---|
| public boolean isKeyboardTrigger() Determines whether this event originated from the keyboard.
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException Hides javafx.
| |
| recomputeCoordinatesToSource | back to summary |
|---|---|
| private void recomputeCoordinatesToSource(ContextMenuEvent newEvent, Object newSource) Fills the given event by this event's coordinates recomputed to the given source object
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of this | |