|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.groboutils.uicapture.v1.ScriptGenerator
Listens to CaptureEvents, and converts these into script commands to the IScriptMaker. It allows for easy subclassing through having a "Meta-Mode". All events will be swallowed (not passed to the UI or IScriptMaker) while in this meta-mode.
Constructor Summary | |
ScriptGenerator(IScreenScraper ss,
IFocusedWindowFinder fwf,
IScriptMaker maker,
java.lang.String baseImageName)
Create using the given arguments to build the framework. |
|
ScriptGenerator(IScriptMaker maker,
java.lang.String baseImageName)
Uses the Default version for the IScreenScraper and IFocusedWindowFinder. |
Method Summary | |
boolean |
allowKeyPressed(KeyPressedCaptureEvent ce)
|
boolean |
allowKeyReleased(KeyReleasedCaptureEvent ce)
|
boolean |
allowMouseMoved(MouseMovedCaptureEvent ce)
Not part of the allow interface. |
boolean |
allowMousePressed(MousePressedCaptureEvent ce)
|
boolean |
allowMouseReleased(MouseReleasedCaptureEvent ce)
|
boolean |
allowMouseWheelMoved(MouseWheelCaptureEvent ce)
|
void |
begin()
|
protected java.io.File |
createFile()
|
protected void |
encounteredError(java.lang.Throwable t)
|
void |
end()
|
protected void |
fireKeyPressed(KeyCaptureEvent ce)
|
protected void |
fireKeyReleased(KeyCaptureEvent ce)
|
protected void |
fireMouseMoved(MouseMovedCaptureEvent ce)
|
protected void |
fireMousePressed(MouseButtonCaptureEvent ce)
|
protected void |
fireMouseReleased(MouseButtonCaptureEvent ce)
|
protected void |
fireMouseWheelMoved(MouseWheelCaptureEvent ce)
|
protected void |
fireSaveFocusedWindow()
Saves a picture of the underlying UI's focused window to a file. |
protected void |
fireSaveScreen()
Saves the entire screen to a file. |
protected void |
fireSaveScreenImage(int x,
int y,
int w,
int h)
Saves the selected screen part to a file. |
protected void |
fireSaveScreenImage(java.awt.Rectangle bounds)
Saves the selected screen part to a file. |
protected void |
fireStop()
|
protected void |
generateDelay(CaptureEvent ce)
Create a delay event in the script maker. |
protected long |
getDelayTime(CaptureEvent ce)
Calculate the amount of time between the last event and the given event. |
boolean |
isInMetaMode()
|
boolean |
isRunning()
|
void |
keyPressed(KeyPressedCaptureEvent ce)
If a subclass overrides this method, it must first check if meta-mode is enabled, and invoke the super's version of this method at the very end (right before leaving the method). |
void |
keyReleased(KeyReleasedCaptureEvent ce)
If a subclass overrides this method, it must first check if meta-mode is enabled, and invoke the super's version of this method at the very end (right before leaving the method). |
protected void |
metaKeyPressed(KeyPressedCaptureEvent ce)
Performs a meta-mode action when this event is caught and the generator is in meta-mode. |
protected void |
metaKeyReleased(KeyReleasedCaptureEvent ce)
Performs a meta-mode action when this event is caught and the generator is in meta-mode. |
protected void |
metaMouseMoved(MouseMovedCaptureEvent ce)
Performs a meta-mode action when this event is caught and the generator is in meta-mode. |
protected void |
metaMousePressed(MousePressedCaptureEvent ce)
Performs a meta-mode action when this event is caught and the generator is in meta-mode. |
protected void |
metaMouseReleased(MouseReleasedCaptureEvent ce)
Performs a meta-mode action when this event is caught and the generator is in meta-mode. |
protected void |
metaMouseWheelMoved(MouseWheelCaptureEvent ce)
Performs a meta-mode action when this event is caught and the generator is in meta-mode. |
void |
mouseMoved(MouseMovedCaptureEvent ce)
If a subclass overrides this method, it must first check if meta-mode is enabled, and invoke the super's version of this method at the very end (right before leaving the method). |
void |
mousePressed(MousePressedCaptureEvent ce)
If a subclass overrides this method, it must first check if meta-mode is enabled, and invoke the super's version of this method at the very end (right before leaving the method). |
void |
mouseReleased(MouseReleasedCaptureEvent ce)
If a subclass overrides this method, it must first check if meta-mode is enabled, and invoke the super's version of this method at the very end (right before leaving the method). |
void |
mouseWheelMoved(MouseWheelCaptureEvent ce)
If a subclass overrides this method, it must first check if meta-mode is enabled, and invoke the super's version of this method at the very end (right before leaving the method). |
void |
setInMetaMode(boolean set)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ScriptGenerator(IScriptMaker maker, java.lang.String baseImageName)
public ScriptGenerator(IScreenScraper ss, IFocusedWindowFinder fwf, IScriptMaker maker, java.lang.String baseImageName)
Method Detail |
public void begin() throws java.awt.AWTException
java.awt.AWTException
- Robot isn't supported.public void end()
public boolean isRunning()
public boolean isInMetaMode()
public void setInMetaMode(boolean set)
protected void metaMouseWheelMoved(MouseWheelCaptureEvent ce)
protected void metaMousePressed(MousePressedCaptureEvent ce)
protected void metaMouseReleased(MouseReleasedCaptureEvent ce)
protected void metaKeyPressed(KeyPressedCaptureEvent ce)
protected void metaKeyReleased(KeyReleasedCaptureEvent ce)
protected void metaMouseMoved(MouseMovedCaptureEvent ce)
protected void fireStop()
protected void fireSaveScreen()
protected void fireSaveFocusedWindow()
protected void fireSaveScreenImage(int x, int y, int w, int h)
x
- the x position of the part of the screen to grab.y
- the y position of the part of the screen to grab.w
- the width of the part of the screen to grab.h
- the height of the part of the screen to grab.protected void fireSaveScreenImage(java.awt.Rectangle bounds)
bounds
- the part of the screen to grab.protected void fireMouseWheelMoved(MouseWheelCaptureEvent ce)
protected void fireMouseMoved(MouseMovedCaptureEvent ce)
protected void fireMousePressed(MouseButtonCaptureEvent ce)
protected void fireMouseReleased(MouseButtonCaptureEvent ce)
protected void fireKeyPressed(KeyCaptureEvent ce)
protected void fireKeyReleased(KeyCaptureEvent ce)
public void mouseWheelMoved(MouseWheelCaptureEvent ce)
mouseWheelMoved
in interface ICaptureListener
MouseWheelListener
public void mouseMoved(MouseMovedCaptureEvent ce)
mouseMoved
in interface ICaptureListener
MouseMotionListener
public void mousePressed(MousePressedCaptureEvent ce)
mousePressed
in interface ICaptureListener
MouseListener
public void mouseReleased(MouseReleasedCaptureEvent ce)
mouseReleased
in interface ICaptureListener
MouseListener
public void keyPressed(KeyPressedCaptureEvent ce)
keyPressed
in interface ICaptureListener
KeyListener
public void keyReleased(KeyReleasedCaptureEvent ce)
keyReleased
in interface ICaptureListener
KeyListener
public final boolean allowMouseWheelMoved(MouseWheelCaptureEvent ce)
allowMouseWheelMoved
in interface IAllowCapturePassThroughListener
MouseWheelListener
public final boolean allowMousePressed(MousePressedCaptureEvent ce)
allowMousePressed
in interface IAllowCapturePassThroughListener
MouseListener
public final boolean allowMouseReleased(MouseReleasedCaptureEvent ce)
allowMouseReleased
in interface IAllowCapturePassThroughListener
MouseListener
public final boolean allowKeyPressed(KeyPressedCaptureEvent ce)
allowKeyPressed
in interface IAllowCapturePassThroughListener
KeyListener
public final boolean allowKeyReleased(KeyReleasedCaptureEvent ce)
allowKeyReleased
in interface IAllowCapturePassThroughListener
KeyListener
public final boolean allowMouseMoved(MouseMovedCaptureEvent ce)
protected void generateDelay(CaptureEvent ce)
protected long getDelayTime(CaptureEvent ce)
protected java.io.File createFile()
protected void encounteredError(java.lang.Throwable t)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |