Class WindowManager

java.lang.Object
  |
  +--WindowManager
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class WindowManager
extends java.lang.Object
implements java.awt.event.ActionListener

This class provides facilities for window management.

Version:
$2007-05-01 03:20:21 mdh$
Author:
Malcolm D. Hyman

Inner Class Summary
static class WindowManager.MenuPosition
          This inner class is used to store the parent and position of a menu.
 
Constructor Summary
WindowManager()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
           
 void addWindow(javax.swing.JFrame frame)
          Adds a window (frame) for registration services.
 void changeMasterText()
          This method is called when the master text for an ArborPanel is changed.
 void freeMenuResources(javax.swing.JMenuBar menuBar)
          Removes all references to menu objects that have the menu bar menuBar.
static java.awt.Rectangle getBounds()
          Returns the bounds of the current screen device.
 javax.swing.JMenu getWindowMenu()
          Returns a window menu, which allows a named window to be raised by the user.
 javax.swing.JMenu getWindowMenu(javax.swing.JMenuBar parent, int pos)
          Returns a window menu, which allows a named window to be raised by the user.
 java.util.List getWindows()
          Returns the list of registered windows.
 void rebuildMenus()
          Rebuilds menus when windows are created, destroyed, or renamed.
 void removeAllFramesOwnedBy(ContentOwner owner)
          Removes all instances of ContentFrame with the specified owner.
 void removeWindow(javax.swing.JFrame frame)
          Removes a window (frame) from registration windows; the window is then allowed to die.
 void tileHorizontally()
          Tiles the visible windows horizontally.
 void tileVertically()
          Tiles the visible windows vertically.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowManager

public WindowManager()
Method Detail

addWindow

public void addWindow(javax.swing.JFrame frame)
Adds a window (frame) for registration services.
Parameters:
frame - frame to be registered

removeWindow

public void removeWindow(javax.swing.JFrame frame)
Removes a window (frame) from registration windows; the window is then allowed to die.
Parameters:
frame - frame to be unregistered

changeMasterText

public void changeMasterText()
This method is called when the master text for an ArborPanel is changed. It performs necessary housekeeping tasks for certain registered windows.

getWindows

public java.util.List getWindows()
Returns the list of registered windows.
Returns:
windows

getWindowMenu

public javax.swing.JMenu getWindowMenu(javax.swing.JMenuBar parent,
                                       int pos)
Returns a window menu, which allows a named window to be raised by the user. This version registers the parent menu bar and offset, so that the menu can be rebuilt.
Parameters:
parent - parent menu bar
pos - position in parent menu bar
Returns:
"Window" menu

getWindowMenu

public javax.swing.JMenu getWindowMenu()
Returns a window menu, which allows a named window to be raised by the user.
Returns:
"Window" menu

rebuildMenus

public void rebuildMenus()
Rebuilds menus when windows are created, destroyed, or renamed.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

freeMenuResources

public void freeMenuResources(javax.swing.JMenuBar menuBar)
Removes all references to menu objects that have the menu bar menuBar.
Parameters:
menuBar - menu bar

removeAllFramesOwnedBy

public void removeAllFramesOwnedBy(ContentOwner owner)
Removes all instances of ContentFrame with the specified owner. (This is a housekeeping task, needed when the owner is closed.)
Parameters:
owner - content owner

getBounds

public static java.awt.Rectangle getBounds()
Returns the bounds of the current screen device.
Returns:
rectangle corresponding to screen boundaries

tileHorizontally

public void tileHorizontally()
Tiles the visible windows horizontally.

tileVertically

public void tileVertically()
Tiles the visible windows vertically.