NodeMouseEvent
final class NodeMouseEvent<N extends Node>
Extends: NodeInputEvent<N>
Package: dev.joid.lib.ui.event.impl.node · Module: core · Source: NodeMouseEvent.java
The event of a press, a release, a drag or a click on a node, with the position of the pointer and the button.
Description
Section titled “Description”Node.onClick, Node.handleMousePressed, Node.handleMouseReleased and Node.handleMouseDragged receive it.
A handle listener hears every press of the UI, wherever the pointer is: test Node.isHovered to keep the presses on the node.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
NodeMouseEvent<N> | create(N node, double mouseX, double mouseY, MouseButton button, long deltaTime, IConsumableEvent source) factory | Creates the event for a node, the position of the pointer, the button and the time since the press. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
double | getMouseX() | Returns the horizontal position of the pointer, in design pixels of the UI. |
double | getMouseY() | Returns the vertical position of the pointer, in design pixels of the UI. |
long | getDeltaTime() | Returns, for a drag or a release, the time in ms since the button went down (0 for a release whose press JOID did not see); 0 for a press or a click. |
MouseButton | getButton() | Returns the MouseButton of the event; for a drag, the button held. |
Inherited from NodeInputEvent (2)
Creation details
Section titled “Creation details”create
Section titled “create”<N extends Node> NodeMouseEvent<N> create(N node, double mouseX, double mouseY, MouseButton button, long deltaTime, IConsumableEvent source) factory
Creates the event for a node, the position of the pointer, the button and the time since the press.
source is the input that the event belongs to, or null for an input of its own.
Method details
Section titled “Method details”getMouseX
Section titled “getMouseX”double getMouseX()
Returns the horizontal position of the pointer, in design pixels of the UI.
getMouseY
Section titled “getMouseY”double getMouseY()
Returns the vertical position of the pointer, in design pixels of the UI.
getDeltaTime
Section titled “getDeltaTime”long getDeltaTime()
Returns, for a drag or a release, the time in ms since the button went down (0 for a release whose press JOID did not see); 0 for a press or a click.
getButton
Section titled “getButton”MouseButton getButton()
Returns the MouseButton of the event; for a drag, the button held.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
