Package org.netbeans.jemmy.drivers.input
Class RobotDriver
java.lang.Object
org.netbeans.jemmy.drivers.LightSupportiveDriver
org.netbeans.jemmy.drivers.input.RobotDriver
- All Implemented Interfaces:
LightDriver
- Direct Known Subclasses:
AppleMenuDriver
,KeyRobotDriver
,MouseRobotDriver
Superclass for all drivers using robot.
- Author:
- Alexandre Iline(alexandre.iline@sun.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Timeout
protected QueueTool
A QueueTool instance.protected ClassReference
A reference to the robot instance. -
Constructor Summary
ConstructorsConstructorDescriptionRobotDriver
(Timeout autoDelay) Constructs a RobotDriver object.RobotDriver
(Timeout autoDelay, boolean smooth) RobotDriver
(Timeout autoDelay, String[] supported) Constructs a RobotDriver object.RobotDriver
(Timeout autoDelay, String[] supported, boolean smooth) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clickMouse
(int x, int y, int clickCount, int mouseButton, int modifiers, Timeout mouseClick) void
dragMouse
(int x, int y, int mouseButton, int modifiers) void
dragNDrop
(int start_x, int start_y, int end_x, int end_y, int mouseButton, int modifiers, Timeout before, Timeout after) protected void
makeAnOperation
(String method, Object[] params, Class[] paramClasses) Performs a single operation.void
moveMouse
(int x, int y) void
pressKey
(int keyCode, int modifiers) Presses a key.protected void
pressModifiers
(int modifiers) Presses modifiers keys by robot.void
pressMouse
(int mouseButton, int modifiers) void
releaseKey
(int keyCode, int modifiers) Releases a key.protected void
releaseModifiers
(int modifiers) Releases modifiers keys by robot.void
releaseMouse
(int mouseButton, int modifiers) protected void
Callsjava.awt.Robot.waitForIdle()
method.Methods inherited from class org.netbeans.jemmy.drivers.LightSupportiveDriver
checkSupported, getSupported
-
Field Details
-
robotReference
A reference to the robot instance. -
qtool
A QueueTool instance. -
autoDelay
-
-
Constructor Details
-
RobotDriver
Constructs a RobotDriver object.- Parameters:
autoDelay
- Time forRobot.setAutoDelay(long)
method.supported
- an array of supported class names
-
RobotDriver
-
RobotDriver
Constructs a RobotDriver object.- Parameters:
autoDelay
- Time forRobot.setAutoDelay(long)
method.
-
RobotDriver
-
-
Method Details
-
pressMouse
public void pressMouse(int mouseButton, int modifiers) -
releaseMouse
public void releaseMouse(int mouseButton, int modifiers) -
moveMouse
public void moveMouse(int x, int y) -
clickMouse
public void clickMouse(int x, int y, int clickCount, int mouseButton, int modifiers, Timeout mouseClick) -
dragMouse
public void dragMouse(int x, int y, int mouseButton, int modifiers) -
dragNDrop
-
pressKey
public void pressKey(int keyCode, int modifiers) Presses a key.- Parameters:
keyCode
- Key code (KeyEventVK_*
field.modifiers
- a combination ofInputEvent.*_MASK
fields.
-
releaseKey
public void releaseKey(int keyCode, int modifiers) Releases a key.- Parameters:
keyCode
- Key code (KeyEventVK_*
field.modifiers
- a combination ofInputEvent.*_MASK
fields.
-
makeAnOperation
Performs a single operation.- Parameters:
method
- a name ofjava.awt.Robot
method.params
- method parametersparamClasses
- method parameters classes
-
synchronizeRobot
protected void synchronizeRobot()Callsjava.awt.Robot.waitForIdle()
method. -
pressModifiers
protected void pressModifiers(int modifiers) Presses modifiers keys by robot.- Parameters:
modifiers
- a combination ofInputEvent.*_MASK
fields.
-
releaseModifiers
protected void releaseModifiers(int modifiers) Releases modifiers keys by robot.- Parameters:
modifiers
- a combination ofInputEvent.*_MASK
fields.
-