Skip to content

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.

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.

ReturnsSignatureSummary
NodeMouseEvent<N>create(N node, double mouseX, double mouseY, MouseButton button, long deltaTime, IConsumableEvent source) factoryCreates the event for a node, the position of the pointer, the button and the time since the press.

ReturnsSignatureSummary
doublegetMouseX()Returns the horizontal position of the pointer, in design pixels of the UI.
doublegetMouseY()Returns the vertical position of the pointer, in design pixels of the UI.
longgetDeltaTime()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.
MouseButtongetButton()Returns the MouseButton of the event; for a drag, the button held.
Inherited from NodeInputEvent (2)

consume · isConsumed

Inherited from NodeEvent (1)

getNode

<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.

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.


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

Report a problem with this page