net.sourceforge.groboutils.uicapture.v1.javamaker
Class JavaMaker

java.lang.Object
  extended bynet.sourceforge.groboutils.uicapture.v1.javamaker.JavaMaker
All Implemented Interfaces:
IScriptMaker

public class JavaMaker
extends java.lang.Object
implements IScriptMaker

Creates a Java playback sourcefile. The Java file will quit with an error code of 1 if the playback did not go perfectly.

Version:
Jan 7, 2002
Author:
Matt Albrecht groboclown@users.sourceforge.net

Constructor Summary
JavaMaker(java.io.File outFile, java.lang.String packageName, java.lang.String className)
           
JavaMaker(java.io.Writer w, java.lang.String packageName, java.lang.String className)
           
 
Method Summary
protected  void assertActive()
           
 void end()
          Terminates the script generation.
 void generateDelay(long milliseconds)
          Cause the script to delay for the given number of milliseconds.
 void generateMoveMouse(int x, int y)
          Cause the script to move the mouse.
 void generateMoveMouseWheel(int rotate)
          Cause the script to rotate the mouse wheel.
 void generatePressKey(int keyCode)
          Cause the script to press a key.
 void generatePressMouse(int modifier)
          Cause the script to press a mouse button.
 void generateReleaseKey(int keyCode)
          Cause the script to release a key.
 void generateReleaseMouse(int modifier)
          Cause the script to release a mouse button.
 void generateScreenCapture(java.io.File originalImage, int x, int y, int width, int height)
          Cause the script to capture a screen shot.
protected  void handleException(java.lang.Throwable t)
           
 void start()
          Starts the script generation.
protected  void step(java.lang.String msg)
           
protected  void wr(java.lang.String text)
           
protected  void wrln()
           
protected  void wrln(java.lang.String text)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaMaker

public JavaMaker(java.io.File outFile,
                 java.lang.String packageName,
                 java.lang.String className)
          throws java.io.IOException

JavaMaker

public JavaMaker(java.io.Writer w,
                 java.lang.String packageName,
                 java.lang.String className)
Method Detail

start

public void start()
Starts the script generation.

Specified by:
start in interface IScriptMaker

end

public void end()
Terminates the script generation.

Specified by:
end in interface IScriptMaker

generateDelay

public void generateDelay(long milliseconds)
Cause the script to delay for the given number of milliseconds.

Specified by:
generateDelay in interface IScriptMaker
Parameters:
milliseconds - the number of milliseconds in the delay.

generateMoveMouseWheel

public void generateMoveMouseWheel(int rotate)
Cause the script to rotate the mouse wheel.

Specified by:
generateMoveMouseWheel in interface IScriptMaker
Parameters:
rotate - the number of rotations the mouse wheel generated.
See Also:
MouseWheelEvent

generateMoveMouse

public void generateMoveMouse(int x,
                              int y)
Cause the script to move the mouse.

Specified by:
generateMoveMouse in interface IScriptMaker
Parameters:
x - the x-coordinate that the mouse moved to
y - the y-coordinate that the mouse moved to

generatePressMouse

public void generatePressMouse(int modifier)
Cause the script to press a mouse button.

Specified by:
generatePressMouse in interface IScriptMaker
See Also:
MouseEvent

generateReleaseMouse

public void generateReleaseMouse(int modifier)
Cause the script to release a mouse button.

Specified by:
generateReleaseMouse in interface IScriptMaker
Parameters:
modifier - the modifier code for the mouse button released.
See Also:
MouseEvent

generatePressKey

public void generatePressKey(int keyCode)
Cause the script to press a key.

Specified by:
generatePressKey in interface IScriptMaker
Parameters:
keyCode - code for the pressed key.
See Also:
KeyEvent

generateReleaseKey

public void generateReleaseKey(int keyCode)
Cause the script to release a key.

Specified by:
generateReleaseKey in interface IScriptMaker
Parameters:
keyCode - code for the released key.
See Also:
KeyEvent

generateScreenCapture

public void generateScreenCapture(java.io.File originalImage,
                                  int x,
                                  int y,
                                  int width,
                                  int height)
Cause the script to capture a screen shot. Probably, it should compare the captured image against the original saved image.

Specified by:
generateScreenCapture in interface IScriptMaker
Parameters:
x - screen image bounds.
y - screen image bounds.
width - screen image bounds.
height - screen image bounds.
originalImage - file containing the original image for the screen capture that the generated script will compare against when the test is run.

handleException

protected void handleException(java.lang.Throwable t)

assertActive

protected void assertActive()

wr

protected void wr(java.lang.String text)

wrln

protected void wrln(java.lang.String text)

wrln

protected void wrln()

step

protected void step(java.lang.String msg)


Copyright © 2001-2003 by The GroboUtils Project