edu.wpi.cs.dsrg.xmldb.xat.component.gui.utils
Class FramesManager

java.lang.Object
  |
  +--edu.wpi.cs.dsrg.xmldb.xat.component.gui.utils.FramesManager

public class FramesManager
extends java.lang.Object

The FramesManager manages open frames and the making of new frames.

Author:
Maylene Waltz

Nested Class Summary
 class FramesManager.CloseWindowListener
          The listener to handle window/frame closing events.
 
Constructor Summary
FramesManager(GUI gui)
          Constructor that initializes the HashMap to hold open frames and associates the given gui with this FramesManager.
 
Method Summary
 void decrementOpenPlotsCount()
          Decrements the count variable for the number of plot windows open.
 javax.swing.JFrame getFrame(java.lang.String key)
          Returns the open frame with the given key.
 int getOpenPlotsCount()
          Returns the number of open plot windows.
 void incrementOpenPlotsCount()
          Increments the count variable for the number of plot windows open.
 boolean isOpenFrame(java.lang.String key)
          Returns whether or not the frame with the given key is open or not.
 javax.swing.JFrame makeNewFrame(java.lang.String key, java.lang.String frameTitle)
          Makes a new frame and adds it to the HashMap of open frames using the given key.
 javax.swing.JFrame makeNewFrame(java.lang.String key, java.lang.String frameTitle, java.awt.Point location)
          Makes a new frame and adds it to the HashMap of open frames using the given key.
 void removeOpenFrame(javax.swing.JFrame frame)
          Removes the given frame from the HashMap of open frames.
 void removeOpenFrame(java.lang.String key)
          Removes the frame with the given key from the HashMap of open frames.
 void resetOpenPlotsCount()
          Resets the counter for the number of open plot windows.
 void toFront(java.lang.String key)
          Focuses the frame with the given key to the front (or top).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FramesManager

public FramesManager(GUI gui)
Constructor that initializes the HashMap to hold open frames and associates the given gui with this FramesManager.

Parameters:
gui - the GUI to associate with this FramesManager
Method Detail

decrementOpenPlotsCount

public void decrementOpenPlotsCount()
Decrements the count variable for the number of plot windows open.


getFrame

public javax.swing.JFrame getFrame(java.lang.String key)
Returns the open frame with the given key.

Returns:
the open frame associated with the given key

getOpenPlotsCount

public int getOpenPlotsCount()
Returns the number of open plot windows.


incrementOpenPlotsCount

public void incrementOpenPlotsCount()
Increments the count variable for the number of plot windows open.


isOpenFrame

public boolean isOpenFrame(java.lang.String key)
Returns whether or not the frame with the given key is open or not.

Parameters:
key - the key to match to see if the frame is open
Returns:
true, if the frame with the given key is open; false, otherwise

makeNewFrame

public javax.swing.JFrame makeNewFrame(java.lang.String key,
                                       java.lang.String frameTitle)
Makes a new frame and adds it to the HashMap of open frames using the given key. Sets the frame's title to the given frameTitle.

Parameters:
key - the key to use to add this frame to the HashMap of open frames
frameTitle - the title to use for this frame
Returns:
the newly created frame

makeNewFrame

public javax.swing.JFrame makeNewFrame(java.lang.String key,
                                       java.lang.String frameTitle,
                                       java.awt.Point location)
Makes a new frame and adds it to the HashMap of open frames using the given key. Sets the frame's title to the given frameTitle. Places the frame at the given location on the screen.

Parameters:
key - the key to use to add this frame to the HashMap of open frames
frameTitle - the title to use for this frame
location - the point at which to place the frame on the screen
Returns:
the newly created frame

removeOpenFrame

public void removeOpenFrame(javax.swing.JFrame frame)
Removes the given frame from the HashMap of open frames.

Parameters:
frame - the frame to remove from the HashMap of open frames

removeOpenFrame

public void removeOpenFrame(java.lang.String key)
Removes the frame with the given key from the HashMap of open frames.

Parameters:
key - the key of the frame to remove from the HashMap of open frames.

resetOpenPlotsCount

public void resetOpenPlotsCount()
Resets the counter for the number of open plot windows.


toFront

public void toFront(java.lang.String key)
Focuses the frame with the given key to the front (or top).

Parameters:
key - the key of the frame to focus to the front