net.sourceforge.groboutils.uicapture.v1
Class VirtualWindowUI

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended bynet.sourceforge.groboutils.uicapture.v1.VirtualWindowUI
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.event.FocusListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.lang.Runnable, java.io.Serializable

public class VirtualWindowUI
extends java.awt.Window
implements java.lang.Runnable, java.awt.event.FocusListener

This UI part of the VirtualWindow framework is in charge of intercepting all Window events related to drawing, in order to keep the invisible facade.

There is a problem with the transparency right now. I'm investigating a solution. The final (and unwanted) solution is to capture the background behind the Window, and display that on paint( Graphics ) calls.

WARNING: if the screen size is to resize, then this will not work correctly.

Since:
Jan 4, 2002
Version:
Mar 13, 2002
Author:
Matt Albrecht groboclown@users.sourceforge.net
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
VirtualWindowUI(java.awt.Window owner)
          Creates a disabled window with no parent.
 
Method Summary
 void dispose()
           
protected  void finalize()
           
 void focusGained(java.awt.event.FocusEvent fe)
           
 void focusLost(java.awt.event.FocusEvent fe)
           
 java.awt.Rectangle getCoveredScreen()
          Retrieve the size of the covered window.
 void hide()
           
 boolean isGlassEnabled()
          Retrieves the current glass enabled state.
 void maximize()
          Enlarge the window to the size of the screen.
 void paint(java.awt.Graphics g)
           
 void run()
          Thread runner to keep the window in the front.
 void setBackground(java.awt.Image img)
          Update the background image.
 void setGlassEnabled(boolean on)
          Sets the inner state for displaying the glass pane.
 void show()
           
 void update(java.awt.Graphics g)
           
 
Methods inherited from class java.awt.Window
addNotify, addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VirtualWindowUI

public VirtualWindowUI(java.awt.Window owner)
Creates a disabled window with no parent.

Method Detail

setGlassEnabled

public void setGlassEnabled(boolean on)
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.

This should be the only method where the inner enableGlass field is manipulated. Any inner testing against this variable needs to be synchronized.

Parameters:
on - true if the glass pane is enabled (active and intercepting events), or false if is disabled.

isGlassEnabled

public boolean isGlassEnabled()
Retrieves the current glass enabled state.

Returns:
true if the glass pane is enabled (active and intercepting events), or false if is disabled.

maximize

public void maximize()
Enlarge the window to the size of the screen.


getCoveredScreen

public java.awt.Rectangle getCoveredScreen()
Retrieve the size of the covered window.


setBackground

public void setBackground(java.awt.Image img)
Update the background image. This may set the background to null.


show

public void show()

hide

public void hide()

dispose

public void dispose()

update

public void update(java.awt.Graphics g)

paint

public void paint(java.awt.Graphics g)

run

public void run()
Thread runner to keep the window in the front.

Specified by:
run in interface java.lang.Runnable

focusGained

public void focusGained(java.awt.event.FocusEvent fe)
Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent fe)
Specified by:
focusLost in interface java.awt.event.FocusListener

finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable - thrown if the super throws anything.


Copyright © 2001-2003 by The GroboUtils Project