Skip to content

UIMouseEvent

final class UIMouseEvent<U extends UI>
Extends: UIInputEvent<U>
Package: dev.joid.lib.ui.event.impl.ui · Module: core · Source: UIMouseEvent.java

The event of a press, a release or a drag on a UI, with the position of the pointer and the button.

UI.handleMousePressed, UI.handleMouseReleased and UI.handleMouseDragged receive it, for example to close a menu on a press in an empty area.

ReturnsSignatureSummary
UIMouseEvent<U>create(U ui, double mouseX, double mouseY, MouseButton button, long deltaTime) factoryCreates the event for a UI, 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.
MouseButtongetButton()Returns the MouseButton of the event; for a drag, the button held.
Inherited from UIInputEvent (2)

consume · isConsumed

Inherited from UIEvent (1)

getUi

<U extends UI> UIMouseEvent<U> create(U ui, double mouseX, double mouseY, MouseButton button, long deltaTime) factory

Creates the event for a UI, the position of the pointer, the button and the time since the press.

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.

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