public class MouseEvent
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
MouseEvent.KeyboardModifier
The keyboard modifiers active.
|
static class |
MouseEvent.MouseButton
The mouse button which caused the event.
|
static class |
MouseEvent.MouseEventType
Type of mouse event.
|
Constructor and Description |
---|
MouseEvent(MouseEvent.MouseEventType eventType,
MouseEvent.MouseButton mouseButton,
java.util.Set<MouseEvent.KeyboardModifier> modifiers,
Position mousePosition) |
Modifier and Type | Method and Description |
---|---|
MouseEvent.MouseEventType |
getEventType()
Get the type of event.
|
java.util.Collection<MouseEvent.KeyboardModifier> |
getModifiers()
Get the set of keyboard modifiers active during the event.
|
MouseEvent.MouseButton |
getMouseButton()
Get the mouse button due to which the event occurred.
|
Position |
getMousePosition()
Get the position of the mouse on screen.
|
boolean |
hasNoModifiers()
Returns true iff the set of keyboard modifiers is empty.
|
boolean |
hasOnlyModifier(MouseEvent.KeyboardModifier modifier)
Checks if there is exactly one modifier.
|
public MouseEvent(MouseEvent.MouseEventType eventType, MouseEvent.MouseButton mouseButton, java.util.Set<MouseEvent.KeyboardModifier> modifiers, Position mousePosition)
public Position getMousePosition()
public MouseEvent.MouseEventType getEventType()
public MouseEvent.MouseButton getMouseButton()
public java.util.Collection<MouseEvent.KeyboardModifier> getModifiers()
public boolean hasNoModifiers()
public boolean hasOnlyModifier(MouseEvent.KeyboardModifier modifier)
modifier
- The modifier to be the only one active.