Inherits javax::swing::JFrame, and java::awt::event::ActionListener.
Public Member Functions | |
MainWindow () | |
Constructor. | |
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) |
Ensures the application closes when this window closes. | |
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. | |
HelpSet | m_oHelpSet |
The HelpSet object for the help file - class is from JavaHelp. | |
JMenuItem | m_jMenuFileNew |
File - new menu item. | |
JMenuItem | m_jMenuFileBatchNew |
File - new batch file menu item. | |
JMenuItem | m_jMenuFileOpen |
File - open file menu item. | |
JMenuItem | m_jMenuFileSave |
File - file save menu item. | |
JMenuItem | m_jMenuFileOpenData |
File - open output file menu item. | |
JMenuItem | m_jMenuFileCloseData |
File - close output file menu item. | |
JMenuItem | m_jMenuFileSetDir |
File - set working directory menu item. | |
JMenuItem | m_jMenuFileExit = new JMenuItem("Exit", KeyEvent.VK_X) |
File - exit menu item. | |
JMenu | m_jMenuEditTree = new JMenu("Tree Population") |
Edit - tree setup submenu. | |
JMenuItem | m_jMenuEditGrid |
Edit - grid setup menu item. | |
JMenuItem | m_jMenuEditFlow |
Edit - model flow menu item. | |
JMenuItem | m_jMenuEditParameters |
Edit - parameters menu item. | |
JMenuItem | m_jMenuEditDisturbance |
Edit - episodic events menu item. | |
JMenuItem | m_jMenuEditHarvInter |
Edit - harvest interface menu item. | |
JMenuItem | m_jMenuEditSchedStorms |
Edit - scheduled storms menu item. | |
JMenuItem | m_jMenuEditOutput |
Edit - output options menu item. | |
JMenuItem | m_jMenuTreeAllometry |
Tree submenu item - set allometry functions. | |
JMenuItem | m_jMenuTreeSpecies |
Tree submenu item - edit species list. | |
JMenuItem | m_jMenuTreeSizeClasses |
Tree submenu item - edit initial density size classes. | |
JMenuItem | m_jMenuTreeTreeMaps |
Tree submenu item - manage tree maps. | |
JMenuItem | m_jMenuModelRun = new JMenuItem("Run", KeyEvent.VK_R) |
Model - run menu item. | |
JMenuItem | m_jMenuModelRunBatch = new JMenuItem("Run Batch...") |
Model - run batch menu item. | |
JMenuItem | m_jMenuModelPause = new JMenuItem("Pause", KeyEvent.VK_P) |
Model - pause menu item. | |
JMenuItem | m_jMenuModelStop |
Model - stop menu item. | |
JMenuItem | m_jMenuHelpContents |
Help - contents menu item. | |
JMenuItem | m_jMenuHelpAbout = new JMenuItem("About", KeyEvent.VK_A) |
Help - about menu item. | |
SORTIEComboBox | m_jChartChoicesComboBox = new SORTIEComboBox() |
Holds the chart choices for the currently open output files. | |
SORTIEComboBox | m_jFileChoicesComboBox = new SORTIEComboBox() |
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. | |
Static Package Attributes | |
static final long | serialVersionUID = 1 |
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 | DoFileSetWorkingDirectory () |
File | Set Working Directory 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 | DoEditHarvestInterface () throws ModelException |
Edit | Harvest Interface action performed. | |
void | DoEditScheduleStorms () throws ModelException |
Edit | Schedule Storms 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 | DoEditTreeSpecies () |
Displays the tree species editing window. | |
void | DoEditTreeSetAllometryFunctions () |
Displays the allometry functions editing window. | |
void | DoEditTreeDensityClasses () |
Displays the tree initial density classes window. | |
void | DoEditTreeManageTreeMap () throws ModelException |
Displays the tree map management 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 |
Scroll pane for the desktop. | |
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
javawrapper.MainWindow.MainWindow | ( | ) |
Constructor.
Draws the window.
void javawrapper.MainWindow.LoadHelp | ( | ) | throws ModelException [private] |
Loads the SORTIE help file so that it can be opened from buttons and menu commands.
ModelException | if the help is not found. |
void javawrapper.MainWindow.SendMessage | ( | ModelMessage | oMsg | ) |
SendMessage accepts a message from the interface.
oMsg | Message to accept. |
void javawrapper.MainWindow.CreateGUI | ( | ) | [private] |
Component initialization and GUI construction.
void javawrapper.MainWindow.DoDrawChart | ( | ) | [package] |
Draws a chart upon selection in the data visualizer panel.
GUIManager javawrapper.MainWindow.GetDataManager | ( | ) |
Gets the GUI manager.
void javawrapper.MainWindow.DoFileExit | ( | ) | [private] |
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.
void javawrapper.MainWindow.DoFileNew | ( | ) | [private] |
File | New Parameter File action performed.
void javawrapper.MainWindow.DoFileSetWorkingDirectory | ( | ) | [private] |
File | Set Working Directory action performed.
void javawrapper.MainWindow.DoFileBatchNew | ( | ) | [private] |
File | New Batch File action performed.
void javawrapper.MainWindow.DoViewRunOutput | ( | ) | throws ModelException [private] |
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.
ModelException | if there is a problem opening the output. |
void javawrapper.MainWindow.DoFileOpen | ( | ) | [private] |
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.
void javawrapper.MainWindow.DoModelRunBatch | ( | ) | [private] |
Model | Run Batch action performed.
Allows the user to input a batch file and run it.
void javawrapper.MainWindow.DoFileOpenData | ( | ) | throws ModelException [private] |
Opens an output file.
Any file that was chosen by the user gets passed to the Data Visualization Manager for processing.
ModelException | if anything goes wrong with the data visualization. |
void javawrapper.MainWindow.DoFileCloseData | ( | ) | [protected] |
Closes an open output file.
All open windows related to this file are closed as well.
void javawrapper.MainWindow.CloseOneDataFile | ( | String | sFileName | ) | [protected] |
Closes a single output file and manages the file list.
sFileName | String File to close. |
void javawrapper.MainWindow.DoFileSave | ( | ) | [protected] |
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.
void javawrapper.MainWindow.DoEditModelFlow | ( | ) | [private] |
Edit | Edit model flow action performed.
void javawrapper.MainWindow.DoEditParameters | ( | ) | [private] |
Edit | Run parameters data action performed.
void javawrapper.MainWindow.DoEditOutput | ( | ) | [private] |
Edit | Edit output options action performed.
void javawrapper.MainWindow.DoEditEpisodicEvents | ( | ) | throws ModelException [private] |
Edit | Episodic events action performed.
ModelException | passing through from called methods. |
void javawrapper.MainWindow.DoEditHarvestInterface | ( | ) | throws ModelException [private] |
Edit | Harvest Interface action performed.
ModelException | passing through from called methods. |
void javawrapper.MainWindow.DoEditScheduleStorms | ( | ) | throws ModelException [private] |
Edit | Schedule Storms action performed.
ModelException | passing through from called methods. |
void javawrapper.MainWindow.SetModelState | ( | int | iState | ) |
Sets the current window state.
iState | State to set to. Should be one of the choices in MainWindowStateSetter. |
int javawrapper.MainWindow.GetModelState | ( | ) |
Gets the current window state.
void javawrapper.MainWindow.DoModelPause | ( | boolean | bAlert | ) | throws ModelException [private] |
Model | Pause action performed.
Pauses the model.
ModelException | passing through from called methods. |
bAlert | Whether or not to alert the user to the pause. |
void javawrapper.MainWindow.DoModelStop | ( | ) | throws ModelException [private] |
Model | Stop Run action performed.
Stops the currently executing run.
ModelException | passed through from called functions. |
void javawrapper.MainWindow.DoModelRun | ( | int | iNumStepsToRun | ) | [private] |
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.
iNumStepsToRun | Number of timesteps to run the model. Set to 0 if the model should run without interruption. |
void javawrapper.MainWindow.SetCursorToDefault | ( | ) | [protected] |
Changes the cursor to the default.
This is a separate function so it can be called from the private inner class created in DoModelRun().
void javawrapper.MainWindow.actionPerformed | ( | ActionEvent | oEvent | ) |
Manages window events.
oEvent | Event triggered. |
void javawrapper.MainWindow.DoEditTreeSpecies | ( | ) | [private] |
Displays the tree species editing window.
void javawrapper.MainWindow.DoEditTreeSetAllometryFunctions | ( | ) | [private] |
Displays the allometry functions editing window.
void javawrapper.MainWindow.DoEditTreeDensityClasses | ( | ) | [private] |
Displays the tree initial density classes window.
void javawrapper.MainWindow.DoEditTreeManageTreeMap | ( | ) | throws ModelException [private] |
Displays the tree map management window.
void javawrapper.MainWindow.DoEditGrid | ( | ) | [private] |
Displays the Grid editing window.
void javawrapper.MainWindow.UpdateChartChoices | ( | ) |
Updates the chart choices in the data visualization panel according to the file which is selected in the file list.
void javawrapper.MainWindow.processWindowEvent | ( | WindowEvent | e | ) | [protected] |
Ensures the application closes when this window closes.
e | WindowEvent Window event. |
final long javawrapper.MainWindow.serialVersionUID = 1 [static, package] |
Interface javawrapper.MainWindow.m_oInterface = null [private] |
Object managing the interface between this application and the C++ model core.
Timer javawrapper.MainWindow.m_oTimer [private] |
Object that allows us to update the GUI while the core model is running.
GUIManager javawrapper.MainWindow.m_oDataManager [protected] |
Manager controlling all functions related to creating and editing parameter files and running the model.
Manager controlling all functions related to output data visualization.
HelpSet javawrapper.MainWindow.m_oHelpSet [protected] |
The HelpSet object for the help file - class is from JavaHelp.
HelpBroker javawrapper.MainWindow.m_oHelpBroker |
JavaHelp class for managing help displays.
int javawrapper.MainWindow.m_iState [private] |
File loaded, no file loaded, running, etc.
JDesktopPane javawrapper.MainWindow.m_oDesktop [private] |
Desktop pane - allows the use of JInternalFrames.
JScrollPane javawrapper.MainWindow.m_jScroller [private] |
Scroll pane for the desktop.
JMenuItem javawrapper.MainWindow.m_jMenuFileNew [protected] |
Initial value:
new JMenuItem("New parameter file", KeyEvent.VK_N)
JMenuItem javawrapper.MainWindow.m_jMenuFileBatchNew [protected] |
Initial value:
new JMenuItem("New batch file", KeyEvent.VK_B)
JMenuItem javawrapper.MainWindow.m_jMenuFileOpen [protected] |
Initial value:
new JMenuItem("Open file", KeyEvent.VK_O)
JMenuItem javawrapper.MainWindow.m_jMenuFileSave [protected] |
Initial value:
new JMenuItem("Save parameter file", KeyEvent.VK_S)
JMenuItem javawrapper.MainWindow.m_jMenuFileOpenData [protected] |
Initial value:
new JMenuItem("Open output file", KeyEvent.VK_R)
JMenuItem javawrapper.MainWindow.m_jMenuFileCloseData [protected] |
Initial value:
new JMenuItem( "Close output file", KeyEvent.VK_C)
JMenuItem javawrapper.MainWindow.m_jMenuFileSetDir [protected] |
Initial value:
new JMenuItem( "Set working directory", KeyEvent.VK_D)
JMenuItem javawrapper.MainWindow.m_jMenuFileExit = new JMenuItem("Exit", KeyEvent.VK_X) [protected] |
File - exit menu item.
JMenu javawrapper.MainWindow.m_jMenuEditTree = new JMenu("Tree Population") [protected] |
Edit - tree setup submenu.
JMenuItem javawrapper.MainWindow.m_jMenuEditGrid [protected] |
Initial value:
new JMenuItem("Grid layer setup", KeyEvent.VK_G)
JMenuItem javawrapper.MainWindow.m_jMenuEditFlow [protected] |
Initial value:
new JMenuItem("Model flow", KeyEvent.VK_M)
JMenuItem javawrapper.MainWindow.m_jMenuEditParameters [protected] |
Initial value:
new JMenuItem("Parameters", KeyEvent.VK_P)
JMenuItem javawrapper.MainWindow.m_jMenuEditDisturbance [protected] |
Initial value:
new JMenuItem("Episodic events", KeyEvent.VK_D)
JMenuItem javawrapper.MainWindow.m_jMenuEditHarvInter [protected] |
Initial value:
new JMenuItem("Harvest interface", KeyEvent.VK_H)
JMenuItem javawrapper.MainWindow.m_jMenuEditSchedStorms [protected] |
Initial value:
new JMenuItem("Schedule storms", KeyEvent.VK_S)
JMenuItem javawrapper.MainWindow.m_jMenuEditOutput [protected] |
Initial value:
new JMenuItem("Output options", KeyEvent.VK_O)
JMenuItem javawrapper.MainWindow.m_jMenuTreeAllometry [protected] |
Initial value:
new JMenuItem("Set allometry functions", KeyEvent.VK_A)
JMenuItem javawrapper.MainWindow.m_jMenuTreeSpecies [protected] |
Initial value:
new JMenuItem("Edit species list", KeyEvent.VK_S)
JMenuItem javawrapper.MainWindow.m_jMenuTreeSizeClasses [protected] |
Initial value:
new JMenuItem("Edit initial density size classes", KeyEvent.VK_I)
JMenuItem javawrapper.MainWindow.m_jMenuTreeTreeMaps [protected] |
Initial value:
new JMenuItem("Manage tree maps", KeyEvent.VK_M)
JMenuItem javawrapper.MainWindow.m_jMenuModelRun = new JMenuItem("Run", KeyEvent.VK_R) [protected] |
Model - run menu item.
JMenuItem javawrapper.MainWindow.m_jMenuModelRunBatch = new JMenuItem("Run Batch...") [protected] |
Model - run batch menu item.
JMenuItem javawrapper.MainWindow.m_jMenuModelPause = new JMenuItem("Pause", KeyEvent.VK_P) [protected] |
Model - pause menu item.
JMenuItem javawrapper.MainWindow.m_jMenuModelStop [protected] |
JMenuItem javawrapper.MainWindow.m_jMenuHelpContents [protected] |
Initial value:
new JMenuItem("Contents", KeyEvent.VK_C)
JMenuItem javawrapper.MainWindow.m_jMenuHelpAbout = new JMenuItem("About", KeyEvent.VK_A) [protected] |
Help - about menu item.
SORTIEComboBox javawrapper.MainWindow.m_jChartChoicesComboBox = new SORTIEComboBox() [protected] |
Holds the chart choices for the currently open output files.
SORTIEComboBox javawrapper.MainWindow.m_jFileChoicesComboBox = new SORTIEComboBox() [protected] |
Holds the list of currently open output files.
JTextField javawrapper.MainWindow.m_jParameterFileField = new JTextField() [protected] |
Field in the status bar holding the parameter file.
JTextField javawrapper.MainWindow.m_jModelStatusField = new JTextField() [protected] |
Field holding the model status.
JTextField javawrapper.MainWindow.m_jMessagesField = new JTextField() [protected] |
Field holding model messages.
JButton javawrapper.MainWindow.m_jModelRunButton [protected] |
Initial value:
new JButton(new ModelIcon(15, 15, ModelIcon.RIGHT_TRIANGLE))
JButton javawrapper.MainWindow.m_jModelStopButton [protected] |
Initial value:
new JButton(new ModelIcon(15, 15, ModelIcon.RECTANGLE))
JButton javawrapper.MainWindow.m_jModelPauseButton [protected] |
Initial value:
new JButton(new ModelIcon(15, 15, ModelIcon.PAUSE))
JButton javawrapper.MainWindow.m_jModelStepForwardButton [protected] |
Initial value:
new JButton(new ModelIcon(15, 15, ModelIcon.STEP_FORWARD))
JButton javawrapper.MainWindow.m_jModelLoadOutputButton [protected] |
Initial value:
new JButton( "View this run's output")
boolean javawrapper.MainWindow.m_bViewingRunOutput = false [private] |
Flag for whether or not the user is doing real-time data visualization of the current run.
boolean javawrapper.MainWindow.m_bKeepRunning = false [private] |
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.