public static class AbstractTool.Input extends FlagSupport
| Constructor and Description |
|---|
AbstractTool.Input() |
| Modifier and Type | Method and Description |
|---|---|
protected int |
getModifiers()
Returns the event modifiers.
|
Point |
getMouseLocation()
Returns the current location of the mouse.
|
boolean |
isAltKeyDown()
Returns
true if the ALT key is pressed. |
boolean |
isAnyButtonDown()
Returns
true if any of the mouse buttons are pressed. |
boolean |
isControlKeyDown()
Returns
true if the CTRL key is pressed. |
boolean |
isModKeyDown(int mod)
Returns
true if any of the given mod keys are pressed. |
boolean |
isMouseButtonDown(int which)
Returns
true if the specified button is down. |
boolean |
isShiftKeyDown()
Returns
true if the SHIFT key is pressed. |
void |
setInput(KeyEvent ke)
Sets the keyboard input based on the KeyEvent.
|
void |
setInput(MouseEvent me)
Sets the mouse and keyboard input based on the MouseEvent.
|
void |
setMouseButton(int which,
boolean state)
Sets mouse button #
which to be pressed if
state is true. |
void |
setMouseLocation(int x,
int y)
Sets the current location of the mouse
|
getFlag, setFlagprotected int getModifiers()
MouseEvent.stateMask, and include things like the mouse
buttons and keyboard modifier keys.public Point getMouseLocation()
public boolean isAltKeyDown()
true if the ALT key is pressed.true if the ALT key is pressedpublic boolean isAnyButtonDown()
true if any of the mouse buttons are pressed.true if any of the mouse buttons are pressedpublic boolean isControlKeyDown()
true if the CTRL key is pressed.true of CTRL pressedpublic boolean isModKeyDown(int mod)
true if any of the given mod keys are pressed.mod - SWT.MOD1, SWT.MOD2, SWT.MOD3, SWT.MOD4 or any combination
thereoftrue if the given mod key is pressedpublic boolean isMouseButtonDown(int which)
true if the specified button is down.which - which buttontrue if the button is downpublic boolean isShiftKeyDown()
true if the SHIFT key is pressed.true if SHIFT pressedpublic void setInput(KeyEvent ke)
ke - the key event providing the inputpublic void setInput(MouseEvent me)
me - the mouse event providing the inputpublic void setMouseButton(int which,
boolean state)
which to be pressed if
state is true.which - which buttonstate - true if button downpublic void setMouseLocation(int x,
int y)
x - x locationy - y locationCopyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.