Package org.eclipse.gef.tools
Class AbstractTool.Input
java.lang.Object
org.eclipse.gef.util.FlagSupport
org.eclipse.gef.tools.AbstractTool.Input
- Enclosing class:
- AbstractTool
Allows the user to access mouse and keyboard input.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected intReturns the event modifiers.Returns the current location of the mouse.booleanReturnstrueif the ALT key is pressed.booleanReturnstrueif any of the mouse buttons are pressed.booleanReturnstrueif the CTRL key is pressed.booleanisModKeyDown(int mod) Returnstrueif any of the given mod keys are pressed.booleanisMouseButtonDown(int which) Returnstrueif the specified button is down.booleanReturnstrueif the SHIFT key is pressed.voidSets the keyboard input based on the KeyEvent.voidsetInput(MouseEvent me) Sets the mouse and keyboard input based on the MouseEvent.voidsetMouseButton(int which, boolean state) Sets mouse button #whichto be pressed ifstateis true.voidsetMouseLocation(int x, int y) Sets the current location of the mouseMethods inherited from class org.eclipse.gef.util.FlagSupportgetFlag, setFlag
- 
Constructor Details- 
Inputpublic Input()
 
- 
- 
Method Details- 
getModifiersprotected int getModifiers()Returns the event modifiers. Modifiers are defined inMouseEvent.stateMask, and include things like the mouse buttons and keyboard modifier keys.- Returns:
- the event modifiers
 
- 
getMouseLocationReturns the current location of the mouse.- Returns:
- the mouse location
 
- 
isAltKeyDownpublic boolean isAltKeyDown()Returnstrueif the ALT key is pressed.- Returns:
- trueif the ALT key is pressed
 
- 
isAnyButtonDownpublic boolean isAnyButtonDown()Returnstrueif any of the mouse buttons are pressed.- Returns:
- trueif any of the mouse buttons are pressed
 
- 
isControlKeyDownpublic boolean isControlKeyDown()Returnstrueif the CTRL key is pressed.- Returns:
- trueof CTRL pressed
 
- 
isModKeyDownpublic boolean isModKeyDown(int mod) Returnstrueif any of the given mod keys are pressed.- Parameters:
- mod- SWT.MOD1, SWT.MOD2, SWT.MOD3, SWT.MOD4 or any combination thereof
- Returns:
- trueif the given mod key is pressed
- Since:
- 3.1
 
- 
isMouseButtonDownpublic boolean isMouseButtonDown(int which) Returnstrueif the specified button is down.- Parameters:
- which- which button
- Returns:
- trueif the button is down
 
- 
isShiftKeyDownpublic boolean isShiftKeyDown()Returnstrueif the SHIFT key is pressed.- Returns:
- trueif SHIFT pressed
 
- 
setInputSets the keyboard input based on the KeyEvent.- Parameters:
- ke- the key event providing the input
 
- 
setInputSets the mouse and keyboard input based on the MouseEvent.- Parameters:
- me- the mouse event providing the input
 
- 
setMouseButtonpublic void setMouseButton(int which, boolean state) Sets mouse button #whichto be pressed ifstateis true.- Parameters:
- which- which button
- state-- trueif button down
 
- 
setMouseLocationpublic void setMouseLocation(int x, int y) Sets the current location of the mouse- Parameters:
- x- x location
- y- y location
- Since:
- 3.4
 
 
-