Package org.fest.swing.core
Interface InputEventGenerator
- All Known Implementing Classes:
RobotEventGenerator
interface InputEventGenerator
Understands generation of input events.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
moveMouse
(int x, int y) Simulates a user moving the mouse pointer to the given coordinates.void
Simulates a user moving the mouse pointer to the given coordinates relative to the given
.Component
void
pressKey
(int keyCode, char keyChar) Simulates a user pressing given key.void
pressMouse
(int buttons) Simulates a user pressing mouse buttons.void
pressMouse
(Component c, Point where, int buttons) Simulates a user pressing the given mouse buttons on the given
.Component
void
pressMouse
(Point where, int buttons) Simulates a user pressing the given mouse buttons on the given coordinates.void
releaseKey
(int keyCode) Simulates a user releasing the given key.void
releaseMouse
(int buttons) Releases the given mouse buttons.void
rotateMouseWheel
(int amount) Rotates the scroll wheel on wheel-equipped mice.
-
Method Details
-
pressMouse
void pressMouse(int buttons) Simulates a user pressing mouse buttons.- Parameters:
buttons
- the buttons to press.
-
pressMouse
Simulates a user pressing the given mouse buttons on the given
. If the given component isComponent
null
, this method will delegate to
.pressMouse(Point, int)
- Parameters:
c
- theComponent
to click on.where
- the given coordinates, relative to the givenComponent
.buttons
- the mouse buttons to press.- Throws:
ActionFailedException
- if the component to click is out of the boundaries of the screen.
-
pressMouse
Simulates a user pressing the given mouse buttons on the given coordinates.- Parameters:
where
- the coordinates where to press the given mouse buttons.buttons
- the mouse buttons to press.
-
moveMouse
Simulates a user moving the mouse pointer to the given coordinates relative to the given
.Component
- Parameters:
c
- the givenComponent
.x
- X coordinate, relative to the givenComponent
.y
- Y coordinate, relative to the givenComponent
.
-
moveMouse
void moveMouse(int x, int y) Simulates a user moving the mouse pointer to the given coordinates.- Parameters:
x
- X coordinate.y
- Y coordinate.
-
releaseMouse
void releaseMouse(int buttons) Releases the given mouse buttons.- Parameters:
buttons
- the mouse buttons to release.
-
rotateMouseWheel
void rotateMouseWheel(int amount) Rotates the scroll wheel on wheel-equipped mice.- 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.
-
pressKey
void pressKey(int keyCode, char keyChar) Simulates a user pressing given key.- Parameters:
keyCode
- the code of the key to press.keyChar
- the given character.- Throws:
IllegalArgumentException
- if the key code is not valid.- See Also:
-
releaseKey
void releaseKey(int keyCode) Simulates a user releasing the given key.- Parameters:
keyCode
- the code of the key to release.- See Also:
-