public final class ScrollEvent extends Object implements IInputEvent, AutoCloseable
IInputEvent
that represents a scroll gesture (for example using the mouse wheel).
This class contains the location, the scroll amount and direction and modifiers if any.
Constructor and Description |
---|
ScrollEvent(Coordinate location,
ModifierKeys modifierKeys,
double deltaY)
Creates a scroll event.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
finalize() |
double |
getDeltaY()
Returns the vertical scroll amount and direction.
|
Coordinate |
getLocation() |
ModifierKeys |
getModifierKeys() |
public ScrollEvent(@NotNull Coordinate location, @NotNull ModifierKeys modifierKeys, double deltaY)
location
- The location of the event, defined in device independent pixels.modifierKeys
- The modifiers of the event.deltaY
- the vertical scroll amount and direction.public void close()
close
in interface AutoCloseable
@NotNull public Coordinate getLocation()
@NotNull public ModifierKeys getModifierKeys()
public double getDeltaY()
A positive value indicates scrolling up, a negative value indicates scrolling down.
A delta of 1.0 (or -1.0) should be interpreted as follows: