Public Member Functions | ||||
MainWindow () | ||||
Constructor. | ||||
File | GetCurrentFileDirectory () | |||
Gets the current file directory. | ||||
void | SetCurrentFileDirectory (File oDirectory) | |||
Sets the current file directory. | ||||
void | SendMessage (ModelMessage oMsg) | |||
SendMessage accepts a message from the interface. | ||||
GUIManager | GetDataManager () | |||
Gets the GUI manager. | ||||
void | SetModelState (int iState) | |||
Sets the current window state. | ||||
int | GetModelState () | |||
Gets the current window state. | ||||
void | actionPerformed (ActionEvent oEvent) | |||
Manages window events. | ||||
void | UpdateChartChoices () | |||
Updates the chart choices in the data visualization panel according to the file which is selected in the file list. | ||||
Public Attributes | ||||
HelpBroker | m_oHelpBroker | |||
JavaHelp class for managing help displays. | ||||
Protected Member Functions | ||||
void | DoFileCloseData () | |||
Closes an open output file. | ||||
void | CloseOneDataFile (String sFileName) | |||
Closes a single output file and manages the file list. | ||||
void | DoFileSave () | |||
File | Save Parameter File action performed. | ||||
void | SetCursorToDefault () | |||
Changes the cursor to the default. | ||||
void | processWindowEvent (WindowEvent e) | |||
Protected Attributes | ||||
GUIManager | m_oDataManager | |||
Manager controlling all functions related to creating and editing parameter files and running the model. | ||||
DataVisualizerManager | m_oDataVisualizerManager | |||
Manager controlling all functions related to output data visualization. | ||||
File | m_oFileDirectory = new File("") | |||
We'll use this so that our file choosers can open to the same directory that they were in last. | ||||
HelpSet | m_oHelpSet | |||
The HelpSet object for the help file - class is from JavaHelp. | ||||
JMenuItem | m_jMenuFileNew | |||
JMenuItem | m_jMenuFileBatchNew | |||
JMenuItem | m_jMenuFileOpen | |||
JMenuItem | m_jMenuFileSave | |||
JMenuItem | m_jMenuFileOpenData | |||
JMenuItem | m_jMenuFileCloseData | |||
JMenuItem | m_jMenuFileExit = new JMenuItem("Exit", KeyEvent.VK_X) | |||
JMenuItem | m_jMenuEditTree | |||
JMenuItem | m_jMenuEditGrid | |||
JMenuItem | m_jMenuEditFlow | |||
JMenuItem | m_jMenuEditParameters | |||
JMenuItem | m_jMenuEditDisturbance | |||
JMenuItem | m_jMenuEditOutput | |||
JMenuItem | m_jMenuModelRun = new JMenuItem("Run", KeyEvent.VK_R) | |||
JMenuItem | m_jMenuModelRunBatch = new JMenuItem("Run Batch...") | |||
JMenuItem | m_jMenuModelPause = new JMenuItem("Pause", KeyEvent.VK_P) | |||
JMenuItem | m_jMenuModelStop | |||
JMenuItem | m_jMenuHelpContents | |||
JMenuItem | m_jMenuHelpAbout = new JMenuItem("About", KeyEvent.VK_A) | |||
JComboBox | m_jChartChoicesComboBox = new JComboBox() | |||
Holds the chart choices for the currently open output files. | ||||
JComboBox | m_jFileChoicesComboBox = new JComboBox() | |||
Holds the list of currently open output files. | ||||
JTextField | m_jParameterFileField = new JTextField() | |||
Field in the status bar holding the parameter file. | ||||
JTextField | m_jModelStatusField = new JTextField() | |||
Field holding the model status. | ||||
JTextField | m_jMessagesField = new JTextField() | |||
Field holding model messages. | ||||
JButton | m_jModelRunButton | |||
Button for running model. | ||||
JButton | m_jModelStopButton | |||
Button for stopping model. | ||||
JButton | m_jModelPauseButton | |||
Button for pausing model. | ||||
JButton | m_jModelStepForwardButton | |||
Button for stepping model. | ||||
JButton | m_jModelLoadOutputButton | |||
Button for loading run's output. | ||||
Package Functions | ||||
void | DoDrawChart () | |||
Draws a chart upon selection in the data visualizer panel. | ||||
Private Member Functions | ||||
void | LoadHelp () throws ModelException | |||
Loads the SORTIE help file so that it can be opened from buttons and menu commands. | ||||
void | CreateGUI () | |||
Component initialization and GUI construction. | ||||
void | DoFileExit () | |||
File | Exit action performed. | ||||
void | DoFileNew () | |||
File | New Parameter File action performed. | ||||
void | DoFileBatchNew () | |||
File | New Batch File action performed. | ||||
void | DoViewRunOutput () throws ModelException | |||
Responds to the click of the button for viewing the current run's output. | ||||
void | DoFileOpen () | |||
File | Open Parameter File action performed. | ||||
void | DoModelRunBatch () | |||
Model | Run Batch action performed. | ||||
void | DoFileOpenData () throws ModelException | |||
Opens an output file. | ||||
void | DoEditModelFlow () | |||
Edit | Edit model flow action performed. | ||||
void | DoEditParameters () | |||
Edit | Run parameters data action performed. | ||||
void | DoEditOutput () | |||
Edit | Edit output options action performed. | ||||
void | DoEditEpisodicEvents () throws ModelException | |||
Edit | Episodic events action performed
| ||||
void | DoModelPause (boolean bAlert) throws ModelException | |||
Model | Pause action performed. | ||||
void | DoModelStop () throws ModelException | |||
Model | Stop Run action performed. | ||||
void | DoModelRun (int iNumStepsToRun) | |||
Model | Run action performed. | ||||
void | DoEditTree () | |||
Displays the Tree editing window. | ||||
void | DoEditGrid () | |||
Displays the Grid editing window. | ||||
Private Attributes | ||||
Interface | m_oInterface = null | |||
Object managing the interface between this application and the C++ model core. | ||||
Timer | m_oTimer | |||
Object that allows us to update the GUI while the core model is running. | ||||
int | m_iState | |||
file loaded, no file loaded, running, etc. | ||||
JDesktopPane | m_oDesktop | |||
Desktop pane - allows the use of JInternalFrames. | ||||
JScrollPane | m_jScroller | |||
boolean | m_bViewingRunOutput = false | |||
Flag for whether or not the user is doing real-time data visualization of the current run. | ||||
boolean | m_bKeepRunning = false | |||
Flag for whether, during real-time data visualization, a new run timestep should be triggered after data updates. | ||||
Classes | ||||
class | RunListener | |||
Runs the window's timer code while the C++ core is running. More... |
The main application window has two main functions; creating and editing parameter files for running the model, and viewing the output generated. To run these functions, it has a separate manager object for each. The rest of the components in this window are for GUI display.
Copyright: Copyright (c) Charles D. Canham 2003
Company: Institute of Ecosystem Studies
|
Constructor. Draws the window.
|
|
Manages window events.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
Closes a single output file and manages the file list.
|
|
Component initialization and GUI construction.
|
|
Draws a chart upon selection in the data visualizer panel.
|
|
Edit | Episodic events action performed
|
|
Displays the Grid editing window.
|
|
Edit | Edit model flow action performed.
|
|
Edit | Edit output options action performed.
|
|
Edit | Run parameters data action performed.
|
|
Displays the Tree editing window.
|
|
File | New Batch File action performed.
|
|
Closes an open output file.
All open windows related to this file are closed as well. |
|
File | Exit action performed. This prompts a save if the user has changed the parameter file, and causes the data visualizer manager to perform cleanup operations.
|
|
File | New Parameter File action performed.
|
|
File | Open Parameter File action performed. Allows the user to input a parameter file of either the old or new type. Any selected file is passed to the GUI manager for processing.
|
|
Opens an output file. Any file that was chosen by the user gets passed to the Data Visualization Manager for processing.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
File | Save Parameter File action performed. This is a request to save a parameter file. The request is passed to the GUI manager for processing.
|
|
Model | Pause action performed. Pauses the model.
|
|
Model | Run action performed. This runs the model. The request is passed off to the Interface, which handles the communications with the C++ core. If there is an existing Interface object whose run has been paused, then this will pass it the run command and let it continue. If the model is already running, this does nothing.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) November 8, 2004: Added run after pause feature (LEM) |
|
Model | Run Batch action performed. Allows the user to input a batch file and run it.
|
|
Model | Stop Run action performed. Stops the currently executing run.
|
|
Responds to the click of the button for viewing the current run's output. If there is no parameter file loaded, this tells the user that it can't do the requested operation. If there's no output to load, this tells the user that. Otherwise, this will load all currently created output files for the current run.
Edit history: ------------------ November 18, 2004: Created (LEM) |
|
Gets the current file directory. This is where file chooser windows should default to.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
Gets the GUI manager.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
Gets the current window state.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
Loads the SORTIE help file so that it can be opened from buttons and menu commands.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
SendMessage accepts a message from the interface.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
Sets the current file directory. This is where file chooser windows should default to.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
Changes the cursor to the default. This is a separate function so it can be called from the private inner class created in DoModelRun(). |
|
Sets the current window state.
Edit history: ------------------ April 28, 2004: Submitted in beta version (LEM) |
|
Updates the chart choices in the data visualization panel according to the file which is selected in the file list.
|
|
Flag for whether, during real-time data visualization, a new run timestep should be triggered after data updates. If the user has run the model instead of pausing it or stepping forward one timestep, this is set to true. Otherwise, it is false and no new timestep will be triggered after the charts have been refreshed. |
|
Initial value: new JMenuItem("Episodic events", KeyEvent.VK_D) |
|
Initial value: new JMenuItem("Model flow", KeyEvent.VK_M) |
|
Initial value: new JMenuItem("Grid layer setup", KeyEvent.VK_G) |
|
Initial value: new JMenuItem("Output options", KeyEvent.VK_O) |
|
Initial value: new JMenuItem("Parameters", KeyEvent.VK_P) |
|
Initial value: new JMenuItem("Tree setup", KeyEvent.VK_T) |
|
Initial value: new JMenuItem("New batch file", KeyEvent.VK_B) |
|
Initial value: new JMenuItem( "Close output file", KeyEvent.VK_C) |
|
Initial value: new JMenuItem("New parameter file", KeyEvent.VK_N) |
|
Initial value: new JMenuItem("Open file", KeyEvent.VK_O) |
|
Initial value: new JMenuItem("Open output file", KeyEvent.VK_R) |
|
Initial value: new JMenuItem("Save parameter file", KeyEvent.VK_S) |
|
Initial value: new JMenuItem("Contents", KeyEvent.VK_C) |
|
Initial value: new JMenuItem("Stop run", KeyEvent.VK_S) |
|
Initial value: new JButton( "View this run's output")
|
|
Initial value: new JButton(new ModelIcon(15, 15, ModelIcon.PAUSE))
|
|
Initial value: new JButton(new ModelIcon(15, 15, ModelIcon.RIGHT_TRIANGLE))
|
|
Initial value: new JButton(new ModelIcon(15, 15, ModelIcon.STEP_FORWARD))
|
|
Initial value: new JButton(new ModelIcon(15, 15, ModelIcon.RECTANGLE))
|