public class Mouse2DEvent extends InputEvent implements IEventArgs
Mouse2DEvent types.| Modifier and Type | Field and Description |
|---|---|
static EventType<Mouse2DEvent> |
ANY
Any Mouse2DEvent.
|
static EventType<Mouse2DEvent> |
CLICKED
A mouse click has been recognized.
|
static EventType<Mouse2DEvent> |
DRAGGED
The mouse has been dragged, i.e. it has been moved while at least one button has been pressed.
|
static EventType<Mouse2DEvent> |
ENTERED
The mouse has entered the control's bounds.
|
static EventType<Mouse2DEvent> |
EXITED
The mouse has exited the control's bounds.
|
static EventType<Mouse2DEvent> |
MOVED
The mouse has been moved.
|
static EventType<Mouse2DEvent> |
NONE
Not a mouse event.
|
static EventType<Mouse2DEvent> |
PRESSED
A button has been pressed.
|
static EventType<Mouse2DEvent> |
RELEASED
A button has been released.
|
static EventType<Mouse2DEvent> |
WHEEL_TURNED
The mouse wheel has been turned.
|
consumed, eventType, NULL_SOURCE_TARGET, targetsourceEMPTY| Constructor and Description |
|---|
Mouse2DEvent(Object source,
EventType<Mouse2DEvent> eventType,
PointD location,
MouseButtons changedButtons,
ModifierKeys changedModifiers,
MouseButtons buttons,
ModifierKeys modifiers)
Constructs a new mouse event argument.
|
Mouse2DEvent(Object source,
EventType<Mouse2DEvent> eventType,
PointD location,
MouseButtons changedButtons,
ModifierKeys changedModifiers,
MouseButtons buttons,
ModifierKeys modifiers,
int mouseWheelDelta,
ScrollType scrollType,
int scrollAmount,
int clickCount)
Constructs a new mouse event argument.
|
| Modifier and Type | Method and Description |
|---|---|
MouseButtons |
getButtons()
The state of the mouse buttons at the time of the event creation.
|
MouseButtons |
getChangedButtons()
Returns the mouse buttons that have changed for this event.
|
ModifierKeys |
getChangedModifiers()
Returns the modifier keys that have changed for this event.
|
int |
getClickCount()
Returns the number of clicks the current event represents if it is of type
CLICKED. |
EventType<Mouse2DEvent> |
getEventType()
Gets the type of this event.
|
PointD |
getLocation()
Returns the coordinates in the world coordinate space associated with this event.
|
ModifierKeys |
getModifiers()
The state of the modifier keys at the time of the event creation.
|
double |
getScrollAmount()
Gets the distance to scroll at once when
ScrollType is ScrollType.LINES. |
ScrollType |
getScrollType()
Gets the scrolling behavior.
|
double |
getWheelDelta()
Gets the signed number of mouse wheel turn units.
|
String |
toString()
Provides a human readable string representation of this event.
|
clone, consume, copyFor, fireEvent, getTarget, isConsumedgetSourcepublic static final EventType<Mouse2DEvent> ANY
public static final EventType<Mouse2DEvent> CLICKED
public static final EventType<Mouse2DEvent> DRAGGED
public static final EventType<Mouse2DEvent> ENTERED
public static final EventType<Mouse2DEvent> EXITED
public static final EventType<Mouse2DEvent> MOVED
public static final EventType<Mouse2DEvent> NONE
public static final EventType<Mouse2DEvent> PRESSED
public static final EventType<Mouse2DEvent> RELEASED
public static final EventType<Mouse2DEvent> WHEEL_TURNED
public Mouse2DEvent(Object source, EventType<Mouse2DEvent> eventType, PointD location, MouseButtons changedButtons, ModifierKeys changedModifiers, MouseButtons buttons, ModifierKeys modifiers)
eventType - The type of the eventlocation - the position of the mouse in world coordinates at the time of the eventchangedButtons - the mouse buttons that have changed state if the type of event is PRESSED or RELEASEDchangedModifiers - the modifier Keys that have been changedbuttons - the current state of the MouseButtonsmodifiers - the current state of the modifier Keyspublic Mouse2DEvent(Object source, EventType<Mouse2DEvent> eventType, PointD location, MouseButtons changedButtons, ModifierKeys changedModifiers, MouseButtons buttons, ModifierKeys modifiers, int mouseWheelDelta, ScrollType scrollType, int scrollAmount, int clickCount)
eventType - The type of the eventlocation - the position of the mouse in world coordinates at the time of the eventchangedButtons - the mouse buttons that have changed state if the type of event is PRESSED or RELEASEDchangedModifiers - the modifier Keys that have been changedbuttons - the current state of the MouseButtonsmodifiers - the current state of the modifier KeysmouseWheelDelta - the signed number of mouse wheel turn unitsscrollType - The type of scrolling performed.scrollAmount - The number of lines to scroll, if scrollType is ScrollType.LINES.clickCount - the number of clicks this event represents, 2 for a double clickpublic final MouseButtons getButtons()
public final MouseButtons getChangedButtons()
getButtons()public final ModifierKeys getChangedModifiers()
getModifiers()public final int getClickCount()
CLICKED.public final EventType<Mouse2DEvent> getEventType()
getEventType in class InputEventpublic final PointD getLocation()
public final ModifierKeys getModifiers()
public final double getScrollAmount()
ScrollType is ScrollType.LINES.
This is a system setting that only applies to scrolling (not zooming) and usually translates to the number of small scroll increments per scroll wheel notch.
This property has a value of 1 if ScrollType is
ScrollType.PAGE, as it is not applicable in that case.
public final ScrollType getScrollType()
This is a system setting that only applies to scrolling (not zooming) and can be either ScrollType.LINES, in
which case ScrollAmount will contain the number of "lines" to scroll with each scroll wheel
notch, or ScrollType.PAGE in which case a single scroll wheel notch should scroll a "page" at a time.
public final double getWheelDelta()
Note that this can, for high-precision mouse wheels, include fractional turns.
public String toString()
toString in class EventObject