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.
Description
Section titled “Description”UI.handleMousePressed, UI.handleMouseReleased and UI.handleMouseDragged receive it, for example to close a menu on a press in an empty area.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
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. |
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. |
MouseButton | getButton() | Returns the MouseButton of the event; for a drag, the button held. |
Inherited from UIInputEvent (2)
Creation details
Section titled “Creation details”create
Section titled “create”<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.
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.
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
