org.openbp.cockpit.modeler.util
Class InputState

java.lang.Object
  extended by org.openbp.cockpit.modeler.util.InputState

public class InputState
extends java.lang.Object

Input state constants.

Author:
Heiko Erhardt

Field Summary
static int ALT
          Alt key down state
static int ALT_GRAPH
          Alt key down state
static int BUTTON1
          Mouse button 1 down state
static int BUTTON2
          Mouse button 2 down state
static int BUTTON3
          Mouse button 3 down state
static int CTRL
          Control key down state
static int HOVER
          Hover activation
static int KEY_STATES
          Keyboard modifier states
static int META
          Meta key down state
static int MOUSE_STATES
          Mouse button modifier states
static int SHIFT
          Shift key down state
 
Method Summary
static int getState()
          Gets the curent input state.
static boolean isAltDown()
          Checks if the alt key is down.
static boolean isAltGraphDown()
          Checks if the alt graph key is down.
static boolean isCtrlDown()
          Checks if the control key is down.
static boolean isLeftButtonDown()
          Checks if the left mouse button is down.
static boolean isMetaDown()
          Checks if the meta key is down.
static boolean isMiddleButtonDown()
          Checks if the middle mouse button is down.
static boolean isRightButtonDown()
          Checks if the right mouse button is down.
static boolean isShiftDown()
          Checks if the shift key is down.
static void setState(int newState)
          Sets the curent input state.
static void updateStateOnInputEvent(java.awt.event.InputEvent e)
          Updates the given input state in case of a keyboard input event.
static void updateStateOnMouseDownEvent(java.awt.event.MouseEvent e)
          Updates the given input state in case of a mouse down event.
static void updateStateOnMouseUpEvent(java.awt.event.MouseEvent e)
          Updates the given input state in case of a mouse up event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHIFT

public static final int SHIFT
Shift key down state

See Also:
Constant Field Values

CTRL

public static final int CTRL
Control key down state

See Also:
Constant Field Values

META

public static final int META
Meta key down state

See Also:
Constant Field Values

ALT

public static final int ALT
Alt key down state

See Also:
Constant Field Values

ALT_GRAPH

public static final int ALT_GRAPH
Alt key down state

See Also:
Constant Field Values

BUTTON1

public static final int BUTTON1
Mouse button 1 down state

See Also:
Constant Field Values

BUTTON2

public static final int BUTTON2
Mouse button 2 down state

See Also:
Constant Field Values

BUTTON3

public static final int BUTTON3
Mouse button 3 down state

See Also:
Constant Field Values

HOVER

public static final int HOVER
Hover activation

See Also:
Constant Field Values

KEY_STATES

public static final int KEY_STATES
Keyboard modifier states

See Also:
Constant Field Values

MOUSE_STATES

public static final int MOUSE_STATES
Mouse button modifier states

See Also:
Constant Field Values
Method Detail

getState

public static int getState()
Gets the curent input state.


setState

public static void setState(int newState)
Sets the curent input state.


updateStateOnInputEvent

public static void updateStateOnInputEvent(java.awt.event.InputEvent e)
Updates the given input state in case of a keyboard input event.

Parameters:
e - Input event

updateStateOnMouseDownEvent

public static void updateStateOnMouseDownEvent(java.awt.event.MouseEvent e)
Updates the given input state in case of a mouse down event.

Parameters:
e - Mouse event

updateStateOnMouseUpEvent

public static void updateStateOnMouseUpEvent(java.awt.event.MouseEvent e)
Updates the given input state in case of a mouse up event.

Parameters:
e - Mouse event

isShiftDown

public static boolean isShiftDown()
Checks if the shift key is down.


isCtrlDown

public static boolean isCtrlDown()
Checks if the control key is down.


isMetaDown

public static boolean isMetaDown()
Checks if the meta key is down.


isAltDown

public static boolean isAltDown()
Checks if the alt key is down.


isAltGraphDown

public static boolean isAltGraphDown()
Checks if the alt graph key is down.


isLeftButtonDown

public static boolean isLeftButtonDown()
Checks if the left mouse button is down.


isMiddleButtonDown

public static boolean isMiddleButtonDown()
Checks if the middle mouse button is down.


isRightButtonDown

public static boolean isRightButtonDown()
Checks if the right mouse button is down.



Copyright © 2011. All Rights Reserved.