|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.groboutils.uicapture.v1.VirtualWindowController
A window which covers the whole screen, and does not paint in the background. It captures keyboard and mouse events, and sends them to both all registered listeners, and to the underlying GUI as well. WARNING: if the screen size is to resize, then this will not work correctly.
Constructor Summary | |
VirtualWindowController()
Uses the Default version for the IScreenScraper and IFocusedWindowFinder. |
|
VirtualWindowController(IScreenScraper ss,
IFocusedWindowFinder fwf)
Create using the given arguments to build the framework. |
Method Summary | |
protected void |
assertActive()
|
protected void |
assertInactive()
|
void |
begin()
Begin the reinactment process. |
boolean |
compareFiles(java.io.File one,
java.io.File two)
Compares the two files for identity. |
void |
end()
Complete the reinactment process. |
java.awt.Rectangle |
getBounds()
Retrieves the size and position of the capture area of the screen. |
java.lang.String |
getImageExtension()
|
void |
moveMouse(int x,
int y)
Simulate a mouse movement. |
void |
pressKey(int keyCode)
Simulate a key press. |
void |
pressMouse(int modifiers)
Simulate a mouse button press. |
void |
releaseKey(int keyCode)
Simulate a key release. |
void |
releaseMouse(int modifiers)
Simulate a mouse button release. |
void |
rotateMouseWheel(int rotation)
Simulate a mouse wheel rotation. |
void |
saveFocusedWindow(java.lang.String filename)
Saves a picture of the underlying UI's focused window to a file. |
void |
saveScreen(java.lang.String filename)
Saves the entire screen to a file. |
void |
saveScreenImage(java.lang.String filename,
int x,
int y,
int w,
int h)
Saves the selected screen part to a file. |
void |
saveScreenImage(java.lang.String filename,
java.awt.Rectangle bounds)
Saves the selected screen part to a file. |
void |
sleep(long milliseconds)
Pause for a period of milliseconds. |
void |
waitForIdle()
Waits until all events currently on the event queue have been processed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public VirtualWindowController()
public VirtualWindowController(IScreenScraper ss, IFocusedWindowFinder fwf)
Method Detail |
public void begin() throws java.awt.AWTException
java.awt.AWTException
- thrown if a Robot is not supported
in the current JDK implementation.public void end()
public void sleep(long milliseconds)
milliseconds
- Time in milliseconds to sleep.public void waitForIdle()
public java.awt.Rectangle getBounds()
public boolean compareFiles(java.io.File one, java.io.File two) throws java.io.IOException
java.io.IOException
public java.lang.String getImageExtension()
public void saveScreen(java.lang.String filename) throws java.io.IOException
filename
- the file to save the image as.
java.io.IOException
- thrown if there was a problem writing the file.public void saveFocusedWindow(java.lang.String filename) throws java.io.IOException
filename
- the file to save the image as.
java.io.IOException
- thrown if there was a problem writing the file.public void saveScreenImage(java.lang.String filename, int x, int y, int w, int h) throws java.io.IOException
filename
- the file to save the image as.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.
java.io.IOException
- thrown if there was a problem writing the file.public void saveScreenImage(java.lang.String filename, java.awt.Rectangle bounds) throws java.io.IOException
filename
- the file to save the image as.bounds
- the part of the screen to grab.
java.io.IOException
- thrown if there was a problem writing the file.public void moveMouse(int x, int y)
x
- the x position (aboslute) to move the mouse to.y
- the y position (aboslute) to move the mouse to.public void pressMouse(int modifiers)
modifiers
- the mouse button modifiers.public void releaseMouse(int modifiers)
modifiers
- the mouse button modifiers.public void rotateMouseWheel(int rotation)
rotation
- the number of 'clicks' to rotate the mouse wheel.public void pressKey(int keyCode)
keyCode
- the key code of the key.public void releaseKey(int keyCode)
keyCode
- the key code of the key.protected void assertActive()
protected void assertInactive()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |