com.pentec.gui.windows
Class AdaptWindowManager

java.lang.Object
  extended by com.pentec.gui.windows.AdaptWindowManager

public class AdaptWindowManager
extends java.lang.Object

AdaptWindowManager

Author:
Pender Technology

Field Summary
(package private) static java.awt.event.WindowAdapter windowAdapter
           
private static java.util.Vector windows
           
 
Constructor Summary
AdaptWindowManager()
           
 
Method Summary
static void addWindow(AdaptWindow window)
           
static void close(AdaptWindow callingFrame)
          Menu callback (File -> Close) for SimpleMenuBar
static boolean contains(AdaptWindow window)
           
static java.awt.Frame findActiveFrame()
          Step through all open windows and find the active one
static int getNumWindows()
           
static AdaptWindow[] getWindows()
          Get a list of AdaptWindows in array format.
static boolean removeWindow(AdaptWindow window)
           
static void setBoundsBottom(java.awt.Window window, java.awt.Rectangle r, int iWidth, int iHeight)
          This method positions a window to the bottom of a box.
static void setBoundsBottom(java.awt.Window w1, java.awt.Window w2)
          Position window 2 below window 1
static void setBoundsCenter(java.awt.Window window, java.awt.Rectangle r, int iWidth, int iHeight)
          This method positions a window in the middle of a box
static void setBoundsCenter(java.awt.Window w1, java.awt.Window w2)
          Position window 2 in the center of window 1
static void setBoundsLeft(AdaptWindow w1, java.awt.Window w2)
          Position window 2 to the left of window 1
private static void setBoundsLeft(java.awt.Window window, java.awt.Rectangle r, int iWidth, int iHeight)
          This method positions a window to the left of a box.
static void setBoundsRight(AdaptWindow w1, java.awt.Window w2)
          Position window 2 to the right of window 1
static void setBoundsRight(AdaptWindow w1, java.awt.Window w2, boolean doSize)
          Position window 2 to the right of window 1
static void setBoundsRight(java.awt.Window window, java.awt.Rectangle r, int iWidth, int iHeight)
          This method positions a window to the right of a rectangle.
static void setBoundsScreenCenter(java.awt.Window window, int iWidth, int iHeight)
          This method sets the window size and positions it in the middle of the screen
static void setBoundsStacked(java.awt.Window window, java.awt.Rectangle r)
          This method positions a window to the right and down relative to an input box.
static void setBoundsStacked(java.awt.Window window, java.awt.Rectangle r, boolean doSize)
          This method positions a window to the right and down relative to an input box.
static void setBoundsTop(java.awt.Window window, java.awt.Rectangle r, int iWidth, int iHeight)
          This method positions a window to the top of a box.
static void setLocationScreenRandom(java.awt.Window window)
          This method positions a window at a random location on the screen while ensuring that as much as possible of the entire window is visible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

windowAdapter

static java.awt.event.WindowAdapter windowAdapter

windows

private static final java.util.Vector windows
Constructor Detail

AdaptWindowManager

public AdaptWindowManager()
Method Detail

addWindow

public static void addWindow(AdaptWindow window)

close

public static void close(AdaptWindow callingFrame)
Menu callback (File -> Close) for SimpleMenuBar


contains

public static boolean contains(AdaptWindow window)

findActiveFrame

public static java.awt.Frame findActiveFrame()
Step through all open windows and find the active one

Returns:
the currently active window

getNumWindows

public static int getNumWindows()

getWindows

public static AdaptWindow[] getWindows()
Get a list of AdaptWindows in array format.


removeWindow

public static boolean removeWindow(AdaptWindow window)

setBoundsBottom

public static void setBoundsBottom(java.awt.Window window,
                                   java.awt.Rectangle r,
                                   int iWidth,
                                   int iHeight)
This method positions a window to the bottom of a box. If there is not room to the bottom, then it is positioned to the top.

Parameters:
window - the window to position
r - the rectangle defining a box to position the window beside
iWidth - the width of the window
iHeight - the height of the window

setBoundsBottom

public static void setBoundsBottom(java.awt.Window w1,
                                   java.awt.Window w2)
Position window 2 below window 1


setBoundsCenter

public static void setBoundsCenter(java.awt.Window window,
                                   java.awt.Rectangle r,
                                   int iWidth,
                                   int iHeight)
This method positions a window in the middle of a box

Parameters:
window - the window to position
r - the rectangle defining a box to position the window in
iWidth - the width of the window
iHeight - the height of the window

setBoundsCenter

public static void setBoundsCenter(java.awt.Window w1,
                                   java.awt.Window w2)
Position window 2 in the center of window 1


setBoundsLeft

public static void setBoundsLeft(AdaptWindow w1,
                                 java.awt.Window w2)
Position window 2 to the left of window 1


setBoundsLeft

private static void setBoundsLeft(java.awt.Window window,
                                  java.awt.Rectangle r,
                                  int iWidth,
                                  int iHeight)
This method positions a window to the left of a box. If there is not room to the left, then it is positioned in the center.

Parameters:
window - the window to position
r - the rectangle defining a box to position the window beside
iWidth - the width of the window
iHeight - the height of the window

setBoundsRight

public static void setBoundsRight(AdaptWindow w1,
                                  java.awt.Window w2)
Position window 2 to the right of window 1


setBoundsRight

public static void setBoundsRight(AdaptWindow w1,
                                  java.awt.Window w2,
                                  boolean doSize)
Position window 2 to the right of window 1


setBoundsRight

public static void setBoundsRight(java.awt.Window window,
                                  java.awt.Rectangle r,
                                  int iWidth,
                                  int iHeight)
This method positions a window to the right of a rectangle. If there is not room to the right, then it is positioned on the left.

Parameters:
window - the window to position
r - the rectangle defining a box to position the window beside
iWidth - the width of the window
iHeight - the height of the window

setBoundsScreenCenter

public static void setBoundsScreenCenter(java.awt.Window window,
                                         int iWidth,
                                         int iHeight)
This method sets the window size and positions it in the middle of the screen

Parameters:
window - the window to position
iWidth - the width of the window
iHeight - the height of the window

setBoundsStacked

public static void setBoundsStacked(java.awt.Window window,
                                    java.awt.Rectangle r)
This method positions a window to the right and down relative to an input box. If there is not room, then it is positioned in the upper left of the screen.

Parameters:
window - the window to position
r - the rectangle defining a box to position the window beside

setBoundsStacked

public static void setBoundsStacked(java.awt.Window window,
                                    java.awt.Rectangle r,
                                    boolean doSize)
This method positions a window to the right and down relative to an input box. If there is not room, then it is positioned in the upper left of the screen.

Parameters:
window - the window to position
r - the rectangle defining a box to position the window beside
doSize - flag indicating whether or not to autosize the new window

setBoundsTop

public static void setBoundsTop(java.awt.Window window,
                                java.awt.Rectangle r,
                                int iWidth,
                                int iHeight)
This method positions a window to the top of a box. If there is not room to the top, then it is positioned in the center.

Parameters:
window - the window to position
r - the rectangle defining a box to position the window beside
iWidth - the width of the window
iHeight - the height of the window

setLocationScreenRandom

public static void setLocationScreenRandom(java.awt.Window window)
This method positions a window at a random location on the screen while ensuring that as much as possible of the entire window is visible.

Parameters:
window - the window to position