Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse GEF
3.3

org.eclipse.gef.tools
Class AbstractTool.Input

java.lang.Object
  extended by

org.eclipse.gef.util.FlagSupport
      extended by
org.eclipse.gef.tools.AbstractTool.Input
Enclosing class:
AbstractTool

public static class AbstractTool.Input
extends FlagSupport

Allows the user to access mouse and keyboard input.


Constructor Summary
AbstractTool.Input ()
           
 
Method Summary
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 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
 
Methods inherited from class org.eclipse.gef.util. FlagSupport
getFlag, setFlag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTool.Input

public AbstractTool.Input()
Method Detail

getModifiers

protected int getModifiers()
Returns the event modifiers. Modifiers are defined in MouseEvent#stateMask, and include things like the mouse buttons and keyboard modifier keys.

Returns:
the event modifiers

getMouseLocation

public 
Point getMouseLocation()
Returns the current location of the mouse.

Returns:
the mouse location

isAltKeyDown

public boolean isAltKeyDown()
Returns true if the ALT key is pressed.

Returns:
true if the ALT key is pressed

isAnyButtonDown

public boolean isAnyButtonDown()
Returns true if any of the mouse buttons are pressed.

Returns:
true if any of the mouse buttons are pressed

isControlKeyDown

public boolean isControlKeyDown()
Returns true if the CTRL key is pressed.

Returns:
true of CTRL pressed

isModKeyDown

public boolean isModKeyDown(int mod)
Returns true if any of the given mod keys are pressed.

Parameters:
mod - SWT.MOD1, SWT.MOD2, SWT.MOD3, SWT.MOD4 or any combination thereof
Returns:
true if the given mod key is pressed
Since:
3.1

isMouseButtonDown

public boolean isMouseButtonDown(int which)
Returns true if the specified button is down.

Parameters:
which - which button
Returns:
true if the button is down

isShiftKeyDown

public boolean isShiftKeyDown()
Returns true if the SHIFT key is pressed.

Returns:
true if SHIFT pressed

setInput

public void setInput(KeyEvent ke)
Sets the keyboard input based on the KeyEvent.

Parameters:
ke - the key event providing the input

setMouseButton

public void setMouseButton(int which,
                           boolean state)
Sets mouse button # which to be pressed if state is true.

Parameters:
which - which button
state - true if button down

setMouseLocation

public void setMouseLocation(int x,
                             int y)
Sets the current location of the mouse

Parameters:
x - x location
y - y location
Since:
3.4

Eclipse GEF
3.3

Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire