net.officefloor.demo.macro
Interface MacroTaskContext

All Known Implementing Classes:
MacroPlayer

public interface MacroTaskContext

Context for running a Macro.

The methods invoke an underlying Robot and handles translating the relative locations to absolute locations.

See the corresponding methods of Robot for details on the methods.

Author:
Daniel Sagenschneider

Method Summary
 Point getAbsoluteLocation(Point relativeLocation)
           Obtains the absolute location for the relative location.
 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.
 

Method Detail

mouseMove

void mouseMove(int x,
               int y)
As per Robot.

Parameters:
x - X location.
y - Y location.

mousePress

void mousePress(int buttons)
As per Robot.

Parameters:
buttons - Buttons.

mouseRelease

void mouseRelease(int buttons)
As per Robot.

Parameters:
buttons - Buttons.

mouseClick

void mouseClick(int buttons)
Convenience method to do press and release of mouse button.

Parameters:
buttons - Buttons as per Robot.

mouseWheel

void mouseWheel(int wheelAmt)
As per Robot.

Parameters:
buttons - Wheel amount.

keyPress

void keyPress(int keycode)
As per Robot.

Parameters:
keycode - Key code.

keyRelease

void keyRelease(int keycode)
As per Robot.

Parameters:
keycode - Key code.

keyStroke

void keyStroke(int keycode)
Convenience method to do press and release of key.

Parameters:
keycode - Key code as per Robot.

keyText

void keyText(String text)
Convenience method to type in text.

Parameters:
text - Text to be typed in.

getAbsoluteLocation

Point getAbsoluteLocation(Point relativeLocation)

Obtains the absolute location for the relative location.

This is useful for example to display a JDialog and position correctly.

Parameters:
relativeLocation - Relative location.
Returns:
Absolute location.

getRelativeLocation

Point getRelativeLocation(Point absoluteLocation)

Obtains 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.

Parameters:
absoluteLocation - Absolute location.
Returns:
Relative location.


Copyright © 2005-2012. All Rights Reserved.