|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuchicago.src.sim.gui.FrameFactory
public class FrameFactory
A Factory for JFrames that adds support for persistent location and size. Individual JFrames are identified by their title. So, two or more JFrames with the same title will be treated has having the same location and size.
Any JFrame created with createFrame will have its size and
location (its bounds property) saved and indexed to that JFrame's
title when the JFrame is closed. When a JFrame with this title is created
its bounds are set to the saved value. The saved bounds information can
also be accessed via the getBounds method.
The size and location data is persisted between application instances
via an xml file. The file is stored in $HOME/fully_qualified_model_name_as_dir/frame_props.xml.
So, for example, if the home directory is /home/nick and the fully qualified
model name is uchicago.src.sim.heatBugs, then the file path is
/home/nick/.repast/uchicago/src/sim/heatBugs/frame_props.xml.
The xml itself is human readable, but is liable to change. An example follows:
| Method Summary | |
|---|---|
static javax.swing.JFrame |
createFrame(java.lang.String title)
Returns a new JFrame with specified title as its title and size and location if any. |
static java.awt.Rectangle |
getBounds(java.lang.String frameTitle)
Returns the bounds, if any, associated with this frameName. |
static void |
load(java.lang.String fqModelName)
Loads the frame data for the specified model. |
static void |
saveFrameData(java.lang.String fqModelName)
Saves the frame data for the specified model. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void load(java.lang.String fqModelName)
fqModelName - the name of the model to load the data forpublic static javax.swing.JFrame createFrame(java.lang.String title)
title - the title of the JFrame to create
public static java.awt.Rectangle getBounds(java.lang.String frameTitle)
frameTitle - the title of the JFrame whose bounds data this returns
public static void saveFrameData(java.lang.String fqModelName)
fqModelName - the fully qualified name of the model whose frame data
we want to save
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||