|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.officefloor.demo.play.MacroPlayer
public class MacroPlayer
Plays the specified Macro instances.
| Constructor Summary | |
|---|---|
MacroPlayer(int delay,
Point offset)
Initiate. |
|
MacroPlayer(Robot robot,
Point offset)
Initiate allowing specifying the Robot to use. |
|
| Method Summary | |
|---|---|
Point |
getAbsoluteLocation(Point relativeLocation)
Obtains the absolute location for the relative location. |
static int[] |
getCharacterKeyCodes(char character)
Obtains the key codes for the character. |
Point |
getRelativeLocation(Point absoluteLocation)
Obtains the relative location for the absolute location. |
void |
keyPress(int keycode)
As per Robot. |
void |
keyRelease(int keycode)
As per Robot. |
void |
keyStroke(int keycode)
Convenience method to do press and release of key. |
void |
keyText(String text)
Convenience method to type in text. |
void |
mouseClick(int buttons)
Convenience method to do press and release of mouse button. |
void |
mouseMove(int x,
int y)
As per Robot. |
void |
mousePress(int buttons)
As per Robot. |
void |
mouseRelease(int buttons)
As per Robot. |
void |
mouseWheel(int wheelAmt)
As per Robot. |
void |
play(Macro... macros)
Plays the Macro instances in the order provided. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MacroPlayer(int delay,
Point offset)
throws AWTException
delay - Delay in between events for the player. The higher the value
the slower the play.offset - Reference point for relative locations.
AWTException - If fails to initialise for playing.
public MacroPlayer(Robot robot,
Point offset)
Robot to use.
robot - Robot to use for playing.offset - Reference point for relative locations.| Method Detail |
|---|
public static int[] getCharacterKeyCodes(char character)
throws UnsupportedOperationException
character - Character.
UnsupportedOperationException - If unsupported character.KeyEventpublic void play(Macro... macros)
Macro instances in the order provided.
macros - Macro instances to play.
public void mouseMove(int x,
int y)
MacroTaskContextRobot.
mouseMove in interface MacroTaskContextx - X location.y - Y location.public void mousePress(int buttons)
MacroTaskContextRobot.
mousePress in interface MacroTaskContextbuttons - Buttons.public void mouseRelease(int buttons)
MacroTaskContextRobot.
mouseRelease in interface MacroTaskContextbuttons - Buttons.public void mouseClick(int buttons)
MacroTaskContext
mouseClick in interface MacroTaskContextbuttons - Buttons as per Robot.public void mouseWheel(int wheelAmt)
MacroTaskContextRobot.
mouseWheel in interface MacroTaskContextpublic void keyPress(int keycode)
MacroTaskContextRobot.
keyPress in interface MacroTaskContextkeycode - Key code.public void keyRelease(int keycode)
MacroTaskContextRobot.
keyRelease in interface MacroTaskContextkeycode - Key code.public void keyStroke(int keycode)
MacroTaskContext
keyStroke in interface MacroTaskContextkeycode - Key code as per Robot.public void keyText(String text)
MacroTaskContext
keyText in interface MacroTaskContexttext - Text to be typed in.public Point getAbsoluteLocation(Point relativeLocation)
MacroTaskContextObtains the absolute location for the relative location.
This is useful for example to display a JDialog and position
correctly.
getAbsoluteLocation in interface MacroTaskContextrelativeLocation - Relative location.
public Point getRelativeLocation(Point absoluteLocation)
MacroTaskContextObtains the relative location for the absolute location.
This is useful for example to find the relative location for a mouse move where the active window only provides an absolute location.
getRelativeLocation in interface MacroTaskContextabsoluteLocation - Absolute location.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||