public class RobotDriver extends Object
| Constructor and Description |
|---|
RobotDriver(Environment env)
Constructs a RobotDriver object.
|
RobotDriver(Timeout autoDelay)
Constructs a RobotDriver object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clickMouse(Point point,
int clickCount,
Mouse.MouseButton mouseButton,
Timeout mouseClick,
Modifier... modifiers)
Clicks the mouse button specified by mouseButton at the specified point
specified number of times preceding it by pressing the modifiers key or
buttons and ending by releasing them.
|
static Image |
createScreenCapture(Rectangle screenRect)
Capture an image of specified rectangular area of screen
|
void |
dragMouse(Point point,
int mouseButton,
int modifiers)
Deprecated.
Implementation doesn't seem to be correct as it ignores mouseButton and modifiers
|
void |
dragNDrop(Point startPoint,
Point endPoint,
Mouse.MouseButton mouseButton,
Modifier[] modifiers,
Timeout before,
Timeout after)
Performs drag and drop from startPoint to endPoint using specified
mouseButton and modifiers to perform it.
|
static void |
exit()
If java.awt.Robot is running in other JVM, it shutdowns that JVM
|
static int |
getMouseSmoothness()
Gets mouse smoothness
|
void |
makeAnOperation(String method,
Object[] params,
Class[] paramClasses)
Performs a single operation.
|
void |
moveMouse(Point point)
Moves mouse to the specified mouse.
|
void |
pressKey(Keyboard.KeyboardButton kbdButton,
Modifier... modifiers)
Presses a key.
|
protected void |
pressModifiers(Modifier... modifiers)
Presses modifiers keys by robot.
|
void |
pressMouse(Mouse.MouseButton mouseButton,
Modifier... modifiers)
Presses mouse button specified by mouseButton preceding pressing of
modifier keys or buttons specified by modifiers
|
void |
releaseKey(Keyboard.KeyboardButton kbdButton,
Modifier... modifiers)
Releases a key.
|
protected void |
releaseModifiers(Modifier... modifiers)
Releases modifiers keys by robot.
|
void |
releaseMouse(Mouse.MouseButton mouseButton,
Modifier... modifiers)
Releases mouse button specified by mouseButton then releasing
modifier keys or buttons specified by modifiers
|
static void |
setMouseSmoothness(int mouseSmoothness)
Sets mouse smoothness
|
void |
turnWheel(Point p,
int amount,
Modifier... modifiers)
Turns the wheel.
|
public RobotDriver(Timeout autoDelay)
autoDelay - Time for Robot.setAutoDelay(long) method.public RobotDriver(Environment env)
env - Environment with ROBOT_DELAY_TIMEOUT_NAME timeoutAWTRobotInputFactory.ROBOT_DELAY_TIMEOUT_NAMEpublic static void setMouseSmoothness(int mouseSmoothness)
mouseSmoothness - the maximum distance in pixels between
mouse positions during movementmoveMouse(Point)public static int getMouseSmoothness()
setMouseSmoothness(int),
moveMouse(Point)public static Image createScreenCapture(Rectangle screenRect)
screenRect - area on screen that will be capturedpublic void pressMouse(Mouse.MouseButton mouseButton, Modifier... modifiers)
mouseButton - One of MouseEvent.BUTTON*_MASKmodifiers - Combination of InputEvent.*_DOWN_MASKInputEvent,
MouseEventpublic void releaseMouse(Mouse.MouseButton mouseButton, Modifier... modifiers)
mouseButton - One of MouseEvent.BUTTON*_MASKmodifiers - Combination of InputEvent.*_DOWN_MASKInputEvent,
MouseEventpublic void moveMouse(Point point)
point - Position on the screen where to move mousesetMouseSmoothness(int),
getMouseSmoothness()public void clickMouse(Point point, int clickCount, Mouse.MouseButton mouseButton, Timeout mouseClick, Modifier... modifiers)
point - Screen location where to click mouseclickCount - Number of clicksmouseButton - One of MouseEvent.BUTTON*_MASKmodifiers - Combination of InputEvent.*_DOWN_MASKmouseClick - Timeout of the last clickInputEvent,
MouseEventpublic void dragMouse(Point point, int mouseButton, int modifiers)
point - todo documentmouseButton - One of MouseEvent.BUTTON*_MASKmodifiers - todo documentpublic void dragNDrop(Point startPoint, Point endPoint, Mouse.MouseButton mouseButton, Modifier[] modifiers, Timeout before, Timeout after)
startPoint - Screen coordinates of drag start pointendPoint - Screen coordinates of drag end pointmouseButton - One of MouseEvent.BUTTON*_MASKmodifiers - Combination of InputEvent.*_DOWN_MASKbefore - Timeout between pressing mouse at the startPoint and
mouse moveafter - Timeout between mouse move to the endPoint and mouse
releasepublic void pressKey(Keyboard.KeyboardButton kbdButton, Modifier... modifiers)
kbdButton - Key code (KeyEventVK_* field.modifiers - a combination of InputEvent.*_MASK fields.public void releaseKey(Keyboard.KeyboardButton kbdButton, Modifier... modifiers)
kbdButton - Key code (KeyEventVK_* field.modifiers - a combination of InputEvent.*_MASK fields.public void turnWheel(Point p, int amount, Modifier... modifiers)
p - todo documentamount - Either positive or negativemodifiers - a combination of InputEvent.*_MASK fields.public void makeAnOperation(String method, Object[] params, Class[] paramClasses)
method - a name of java.awt.Robot method.params - method parametersparamClasses - method parameters classesprotected void pressModifiers(Modifier... modifiers)
modifiers - a combination of InputEvent.*_MASK fields.protected void releaseModifiers(Modifier... modifiers)
modifiers - a combination of InputEvent.*_MASK fields.public static void exit()
Copyright © 2018. All rights reserved.