public class Utils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static int |
button(java.awt.event.InputEvent e)
Returns the button of an input mouse event :
BasicInputStateMachine.NOBUTTON
BasicInputStateMachine.BUTTON1
BasicInputStateMachine.BUTTON2
BasicInputStateMachine.BUTTON3
.
|
static java.lang.String |
getButtonAsText(int button)
Returns the text corresponding to a button for toString methods in Transition classes.
|
static java.lang.String |
getModifiersAsText(int modifier)
Returns the text corresponding to a modifier for toString methods in Transition classes.
|
static java.lang.String |
getPrefixInputEvent(java.awt.event.KeyEvent e)
Returns the string describing this awt key event ("KeyType", "KeyPress" or "KeyRelease").
|
static java.lang.String |
getPrefixInputEvent(java.awt.event.MouseEvent me)
Returns the string describing this awt mouse event
("Down", "Move", "Drag", "Release", "Click", "Enter", "Leave" or "Wheel")
concatenated with the number of the mouse button (0, 1 or 2).
|
static int |
modifiers(java.awt.event.InputEvent e)
Returns the modifier of an input event :
BasicInputStateMachine.NOMODIFIER
BasicInputStateMachine.ALT
BasicInputStateMachine.SHIFT
BasicInputStateMachine.CONTROL
BasicInputStateMachine.CONTROL_SHIFT
BasicInputStateMachine.ALT_CONTROL
BasicInputStateMachine.ALT_SHIFT
BasicInputStateMachine.ALT_CONTROL_SHIFT
.
|
public static java.lang.String getPrefixInputEvent(java.awt.event.KeyEvent e)
e
- The awt key event.public static java.lang.String getPrefixInputEvent(java.awt.event.MouseEvent me)
me
- The awt mouse event.public static int modifiers(java.awt.event.InputEvent e)
e
- The awt input event.e
.public static int button(java.awt.event.InputEvent e)
e
- The awt input event.e
.public static java.lang.String getButtonAsText(int button)
getButtonAsText(BasicInputStateMachine.BUTTON1)returns "BUTTON1".
button
- The buttonpublic static java.lang.String getModifiersAsText(int modifier)
getModifiersAsText(BasicInputStateMachine.SHIFT)returns "SHIFT".
modifier
- The modifier