superwaba.ext.xplat.unit
Class UIRobot

java.lang.Object
  |
  +--superwaba.ext.xplat.unit.UIRobot

public class UIRobot
extends java.lang.Object
implements Thread

This class permits the control of an User Interface window, issuing events as if it was the user.


Constructor Summary
UIRobot()
          Constructs a new UIRobot
 
Method Summary
 void click(Control c)
          Simulates a click (pen down followed by a pen up) in the given control, at relative position 0,0.
 void click(Control c, int deltaX, int deltaY)
          Simulates a click (pen down followed by a pen up) in the given control, at relative position deltaX,deltaY.
 void click(int x, int y)
          Simulates a click (pen down followed by a pen up) at the given absolute position.
 void delay(int ms)
          Adds a delay between two events.
 void go()
          Stars this robot as a thread.
 void keyPress(int key)
          Simulates a key press with the given key.
 void penDown(Control c)
          Simulates a pen down in the given control, at relative position 0,0.
 void penDown(Control c, int deltaX, int deltaY)
          Simulates a pen down in the given control, at relative position deltaX,deltaY.
 void penDown(int x, int y)
          Simulates a pen down at the given absolute position.
 void penDrag(Control c)
          Simulates a pen drag in the given control, at relative position 0,0.
 void penDrag(Control c, int deltaX, int deltaY)
          Simulates a pen drag in the given control, at relative position deltaX,deltaY.
 void penDrag(int x, int y)
          Simulates a pen drag at the given absolute position.
 void penUp(Control c)
          Simulates a pen up in the given control, at relative position 0,0.
 void penUp(Control c, int deltaX, int deltaY)
          Simulates a pen up in the given control, at relative position deltaX,deltaY.
 void penUp(int x, int y)
          Simulates a pen up at the given absolute position.
 void run()
          Called by the system thread scheduler to run the current event.
 void started()
          Called by the system thread scheduler telling that the thread was started.
 void stopped()
          Called by the system thread scheduler telling that the thread was stopped.
 void type(java.lang.String s)
          Simulates the typying of the given string, as a series of key press events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UIRobot

public UIRobot()
Constructs a new UIRobot
Method Detail

click

public void click(Control c)
Simulates a click (pen down followed by a pen up) in the given control, at relative position 0,0.

penDown

public void penDown(Control c)
Simulates a pen down in the given control, at relative position 0,0.

penUp

public void penUp(Control c)
Simulates a pen up in the given control, at relative position 0,0.

penDrag

public void penDrag(Control c)
Simulates a pen drag in the given control, at relative position 0,0.

click

public void click(Control c,
                  int deltaX,
                  int deltaY)
Simulates a click (pen down followed by a pen up) in the given control, at relative position deltaX,deltaY.

penDown

public void penDown(Control c,
                    int deltaX,
                    int deltaY)
Simulates a pen down in the given control, at relative position deltaX,deltaY.

penUp

public void penUp(Control c,
                  int deltaX,
                  int deltaY)
Simulates a pen up in the given control, at relative position deltaX,deltaY.

penDrag

public void penDrag(Control c,
                    int deltaX,
                    int deltaY)
Simulates a pen drag in the given control, at relative position deltaX,deltaY.

click

public void click(int x,
                  int y)
Simulates a click (pen down followed by a pen up) at the given absolute position.

penDown

public void penDown(int x,
                    int y)
Simulates a pen down at the given absolute position.

penUp

public void penUp(int x,
                  int y)
Simulates a pen up at the given absolute position.

penDrag

public void penDrag(int x,
                    int y)
Simulates a pen drag at the given absolute position.

delay

public void delay(int ms)
Adds a delay between two events.

keyPress

public void keyPress(int key)
Simulates a key press with the given key.

type

public void type(java.lang.String s)
Simulates the typying of the given string, as a series of key press events.

run

public void run()
Called by the system thread scheduler to run the current event.
Specified by:
run in interface Thread

started

public void started()
Called by the system thread scheduler telling that the thread was started.
Specified by:
started in interface Thread

stopped

public void stopped()
Called by the system thread scheduler telling that the thread was stopped.
Specified by:
stopped in interface Thread

go

public void go()
Stars this robot as a thread. The method only returns when all events were ran.