| java.lang.Object net.sourceforge.groboutils.uicapture.v1.VirtualWindow
VirtualWindow | public class VirtualWindow implements KeyListener,MouseListener,MouseMotionListener,MouseWheelListener(Code) | | 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. This transparent window is
similar to the "glass pane" concept in Swing JFrames.
For the moment, there is no way for listeners to prevent an event from
being passed to the underlying UI. This needs to be changed.
WARNING: if the screen size is to resize, then this will not work correctly.
author: Matt Albrecht groboclown@users.sourceforge.net since: Jan 4, 2002 version: Mar 13, 2002 |
Constructor Summary | |
public | VirtualWindow() Create a new VirtualWindow, with the glass enabled. | public | VirtualWindow(String title, boolean enable) Specify the initial enabled state of the window. |
VirtualWindow | public VirtualWindow(String title, boolean enable) throws java.awt.AWTException(Code) | | Specify the initial enabled state of the window.
Parameters: enable - set to the initial glass pane state. exception: java.awt.AWTException - thrown if a Robot is not supportedin the current JDK implementation. |
addCaptureListener | public void addCaptureListener(ICaptureListener cl)(Code) | | Adds an ICaptureListener to the list of recipients of input
events. If the given listener is null, then the request is
ignored.
Parameters: cl - the listener to add. |
createScreenScrape | public BufferedImage createScreenScrape()(Code) | | Scrapes the current screen into a BufferedImage the same size as the
window.
the captured screen image. |
createScreenScrape | public BufferedImage createScreenScrape(Rectangle bounds)(Code) | | Scrapes the current screen into a BufferedImage from the given area
on the screen. This is passed directly to the underlying Robot.
the captured screen image. |
delay | public void delay(int ms)(Code) | | Sleeps for the specified number of milliseconds. This is passed
directly through to the underlying Robot.
Parameters: ms - Time to sleep in milliseconds. exception: IllegalArgumentException - thrown by Robot if ms isnot between 0 and 60,000, inclusive. |
dispose | public void dispose()(Code) | | Close out all inner instances and shut down the UI
|
getCaptureListeners | protected Iterator getCaptureListeners()(Code) | | Returns a list of all the current ICaptureListeners.
an iterator of the listeners. |
hide | public void hide()(Code) | | Hides the glass pane, and stops all input event capturing. This is
only executed if the glass is enabled, and has no effect on the
enabled state of the glass.
|
isGlassEnabled | public boolean isGlassEnabled()(Code) | | Retrieves the current glass enabled state.
true if the glass pane is enabled (active andintercepting events), or false if is disabled. |
removeCaptureListener | public void removeCaptureListener(ICaptureListener cl)(Code) | | Removes the given ICaptureListener from the inner list of
input events recipients. If the given listener is null or
not registered, then the request is ignored.
Parameters: cl - the listener to remove. |
setGlassEnabled | public synchronized void setGlassEnabled(boolean on)(Code) | | Sets the inner state for displaying the glass pane. If the pane is
enabled, then the glass pane will attempt to maximize itself and
keep itself on the foreground at all costs.
Parameters: on - true if the glass pane is enabled (active andintercepting events), or false if is disabled. |
show | public void show()(Code) | | Shows the glass pane, and continues all input event capturing. This is
only executed if the glass is enabled, and has no effect on the
enabled state of the glass.
|
simulateEvent | public synchronized void simulateEvent(CaptureEvent ce)(Code) | | Simulates the given captured event. This minimizes the glass window,
performs the event with the Robot, and restores the glass window if
the glass pane is enabled.
Parameters: ce - the event to simulate. |
update | public void update()(Code) | | Updates the background image.
|
waitForIdle | public void waitForIdle()(Code) | | Waits until all events currently on the event queue have been processed.
This is passed directly through to the underlying Robot.
|
|
|