Package org.fest.swing.core
Class RobotEventGenerator
java.lang.Object
org.fest.swing.core.RobotEventGenerator
- All Implemented Interfaces:
InputEventGenerator
Understands input event generation using a AWT
Robot.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRobotEventGenerator(Settings settings) RobotEventGenerator(RobotFactory robotFactory, Settings settings) -
Method Summary
Modifier and TypeMethodDescriptionvoidmoveMouse(int x, int y) Simulates a user moving the mouse pointer to the given coordinates.voidSimulates a user moving the mouse pointer to the given coordinates relative to the given.ComponentvoidpressKey(int keyCode, char keyChar) Simulates a user pressing given key.voidpressMouse(int buttons) Simulates a user pressing mouse buttons.voidpressMouse(Component c, Point where, int buttons) Simulates a user pressing the given mouse buttons on the given.ComponentvoidpressMouse(Point where, int buttons) Simulates a user pressing the given mouse buttons on the given coordinates.voidreleaseKey(int keyCode) Simulates a user releasing the given key.voidreleaseMouse(int buttons) Releases the given mouse buttons.(package private) Robotrobot()voidrotateMouseWheel(int amount) Rotates the scroll wheel on wheel-equipped mice.
-
Field Details
-
KEY_INPUT_DELAY
private static final int KEY_INPUT_DELAY- See Also:
-
robot
-
settings
-
-
Constructor Details
-
RobotEventGenerator
RobotEventGenerator() -
RobotEventGenerator
RobotEventGenerator(Settings settings) -
RobotEventGenerator
RobotEventGenerator(RobotFactory robotFactory, Settings settings)
-
-
Method Details
-
robot
Robot robot() -
pressMouse
Simulates a user pressing the given mouse buttons on the given. If the given component isComponentnull, this method will delegate to.InputEventGenerator.pressMouse(Point, int)- Specified by:
pressMousein interfaceInputEventGenerator- Parameters:
c- theComponentto click on.where- the given coordinates, relative to the givenComponent.buttons- the mouse buttons to press.
-
pressMouse
Simulates a user pressing the given mouse buttons on the given coordinates.- Specified by:
pressMousein interfaceInputEventGenerator- Parameters:
where- the coordinates where to press the given mouse buttons.buttons- the mouse buttons to press.
-
pressMouse
public void pressMouse(int buttons) Simulates a user pressing mouse buttons.- Specified by:
pressMousein interfaceInputEventGenerator- Parameters:
buttons- the buttons to press.
-
releaseMouse
public void releaseMouse(int buttons) Releases the given mouse buttons.- Specified by:
releaseMousein interfaceInputEventGenerator- Parameters:
buttons- the mouse buttons to release.
-
rotateMouseWheel
public void rotateMouseWheel(int amount) Rotates the scroll wheel on wheel-equipped mice.- Specified by:
rotateMouseWheelin interfaceInputEventGenerator- Parameters:
amount- number of "notches" to move the mouse wheel. Negative values indicate movement up/away from the user, while positive values indicate movement down/towards the user.
-
moveMouse
Simulates a user moving the mouse pointer to the given coordinates relative to the given.Component- Specified by:
moveMousein interfaceInputEventGenerator- Parameters:
c- the givenComponent.x- X coordinate, relative to the givenComponent.y- Y coordinate, relative to the givenComponent.
-
moveMouse
public void moveMouse(int x, int y) Simulates a user moving the mouse pointer to the given coordinates.- Specified by:
moveMousein interfaceInputEventGenerator- Parameters:
x- X coordinate.y- Y coordinate.
-
pressKey
public void pressKey(int keyCode, char keyChar) Simulates a user pressing given key.- Specified by:
pressKeyin interfaceInputEventGenerator- Parameters:
keyCode- the code of the key to press.keyChar- the given character.- See Also:
-
releaseKey
public void releaseKey(int keyCode) Simulates a user releasing the given key.- Specified by:
releaseKeyin interfaceInputEventGenerator- Parameters:
keyCode- the code of the key to release.- See Also:
-