cds.aladin
Class MyRobot

java.lang.Object
  extended by cds.aladin.MyRobot

public class MyRobot
extends java.lang.Object

Title : MyRobot

Description : Main class of the "robot" facility

This is the main class of the "robot" facility
It aims at managing script commands, translate them into simple tasks, and execute these tasks
eg : script command "contour 4" would be translated into simple commands as "click on contour button", select 4, press Get contour
Those commands would then be executed

Version:
0.1 (kickoff : 02/02/2004)
Author:
Thomas Boch [CDS]

Constructor Summary
MyRobot(Aladin a)
          Constructor for MyRobot class
 
Method Summary
static void adjustPos(java.awt.Component comp)
          Adjusts the position of a frame, so that it is fully visible on the screen
static void createRobot()
          Crée l'object robot statique
 boolean executeCommand(java.lang.String cmdName, java.lang.String argsStr)
          Ask the robot to execute a command, given its name and its arguments
static void info(java.lang.String text, Aladin aladinInst)
           
static void moveTo(int px, int py, Aladin aladinInst)
          Mouve mouse cursor to point (px,py)
static void pause(int nbMs)
          Pause during a given time
static void press(int x, int y, java.awt.Component comp)
          Press the mouse button at point (x,y)
static void press(java.awt.Point loc, java.awt.Component comp)
           
static void select(java.lang.String item, java.awt.Component comp, java.awt.Point loc)
          Select a given item in a Choice widget
static void toFront(java.awt.Component comp)
          Put a frame in the front
static void type(java.lang.String text, java.awt.Component c)
          Type some text
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyRobot

public MyRobot(Aladin a)
Constructor for MyRobot class

Method Detail

createRobot

public static void createRobot()
Crée l'object robot statique


executeCommand

public boolean executeCommand(java.lang.String cmdName,
                              java.lang.String argsStr)
Ask the robot to execute a command, given its name and its arguments

Parameters:
cmdName - command name, as it appears in class Command
argsStr - arguments string
Returns:
true si on a trouvé un script correspondant

info

public static void info(java.lang.String text,
                        Aladin aladinInst)

moveTo

public static void moveTo(int px,
                          int py,
                          Aladin aladinInst)
Mouve mouse cursor to point (px,py)

Parameters:
loc -

press

public static void press(int x,
                         int y,
                         java.awt.Component comp)
Press the mouse button at point (x,y)

Parameters:
x -
y -
comp -

press

public static void press(java.awt.Point loc,
                         java.awt.Component comp)

select

public static void select(java.lang.String item,
                          java.awt.Component comp,
                          java.awt.Point loc)
Select a given item in a Choice widget

Parameters:
item - item to select
comp - Choice component

toFront

public static void toFront(java.awt.Component comp)
Put a frame in the front

Parameters:
comp - Frame to put toFront

type

public static void type(java.lang.String text,
                        java.awt.Component c)
Type some text

Parameters:
text - text to type in

adjustPos

public static void adjustPos(java.awt.Component comp)
Adjusts the position of a frame, so that it is fully visible on the screen

Parameters:
comp - frame

pause

public static void pause(int nbMs)
Pause during a given time

Parameters:
nbMs - number of ms to pause


Copyright © 2009 UDS/CNRS