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
public class RobotDriver extends LightSupportiveDriver
Superclass for all drivers using robot.- Author:
- Alexandre Iline(alexandre.iline@sun.com)
-
-
Field Summary
Fields Modifier and Type Field Description protected Timeout
autoDelay
protected QueueTool
qtool
A QueueTool instance.protected ClassReference
robotReference
A reference to the robot instance.
-
Constructor Summary
Constructors Constructor Description RobotDriver(Timeout autoDelay)
Constructs a RobotDriver object.RobotDriver(Timeout autoDelay, boolean smooth)
RobotDriver(Timeout autoDelay, java.lang.String[] supported)
Constructs a RobotDriver object.RobotDriver(Timeout autoDelay, java.lang.String[] supported, boolean smooth)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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(java.lang.String method, java.lang.Object[] params, java.lang.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
synchronizeRobot()
Callsjava.awt.Robot.waitForIdle()
method.-
Methods inherited from class org.netbeans.jemmy.drivers.LightSupportiveDriver
checkSupported, getSupported
-
-
-
-
Field Detail
-
robotReference
protected ClassReference robotReference
A reference to the robot instance.
-
qtool
protected QueueTool qtool
A QueueTool instance.
-
autoDelay
protected Timeout autoDelay
-
-
Constructor Detail
-
RobotDriver
public RobotDriver(Timeout autoDelay, java.lang.String[] supported)
Constructs a RobotDriver object.- Parameters:
autoDelay
- Time forRobot.setAutoDelay(long)
method.supported
- an array of supported class names
-
RobotDriver
public RobotDriver(Timeout autoDelay, java.lang.String[] supported, boolean smooth)
-
RobotDriver
public RobotDriver(Timeout autoDelay)
Constructs a RobotDriver object.- Parameters:
autoDelay
- Time forRobot.setAutoDelay(long)
method.
-
RobotDriver
public RobotDriver(Timeout autoDelay, boolean smooth)
-
-
Method Detail
-
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
public void dragNDrop(int start_x, int start_y, int end_x, int end_y, int mouseButton, int modifiers, Timeout before, Timeout after)
-
pressKey
public void pressKey(int keyCode, int modifiers)
Presses a key.- Parameters:
oper
- Operator to press a key on.keyCode
- Key code (KeyEventVK_*
field.modifiers
- a combination ofInputEvent.*_MASK
fields.
-
releaseKey
public void releaseKey(int keyCode, int modifiers)
Releases a key.- Parameters:
oper
- Operator to release a key on.keyCode
- Key code (KeyEventVK_*
field.modifiers
- a combination ofInputEvent.*_MASK
fields.
-
makeAnOperation
protected void makeAnOperation(java.lang.String method, java.lang.Object[] params, java.lang.Class[] paramClasses)
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:
oper
- an operator for a component to press keys on.modifiers
- a combination ofInputEvent.*_MASK
fields.
-
releaseModifiers
protected void releaseModifiers(int modifiers)
Releases modifiers keys by robot.- Parameters:
oper
- an operator for a component to release keys on.modifiers
- a combination ofInputEvent.*_MASK
fields.
-
-