SORTIE Java Interface
1
|
Main application window. More...
Classes | |
class | RunListener |
Runs the window's timer code while the C++ core is running. | |
Public Member Functions | |
MainWindow () | |
Constructor. More... | |
void | sendMessage (ModelMessage oMsg) |
SendMessage accepts a message from the interface. More... | |
GUIManager | getDataManager () |
Gets the GUI manager. More... | |
void | closeOneDataFile (String sFileName) |
Closes a single output file and manages the file list. More... | |
void | setModelState (int iState) |
Sets the current window state. More... | |
int | getModelState () |
Gets the current window state. More... | |
void | actionPerformed (ActionEvent oEvent) |
Manages window events. More... | |
void | updateChartChoices () |
Updates the chart choices in the data visualization panel according to the file which is selected in the file list. More... | |
void | windowActivated (WindowEvent e) |
Not implemented. More... | |
void | windowClosed (WindowEvent e) |
Not implemented. More... | |
void | windowClosing (WindowEvent e) |
Ensures the application closes when this window closes. More... | |
void | windowDeactivated (WindowEvent e) |
Not implemented. More... | |
void | windowDeiconified (WindowEvent e) |
Not implemented. More... | |
void | windowIconified (WindowEvent e) |
Not implemented. More... | |
void | windowOpened (WindowEvent e) |
Not implemented. More... | |
void | internalFrameClosed (InternalFrameEvent e) |
Handles the closing of chart windows. More... | |
void | internalFrameClosing (InternalFrameEvent e) |
void | internalFrameDeactivated (InternalFrameEvent e) |
void | internalFrameDeiconified (InternalFrameEvent e) |
void | internalFrameIconified (InternalFrameEvent e) |
void | internalFrameOpened (InternalFrameEvent e) |
void | internalFrameActivated (InternalFrameEvent e) |
When a chart window is activated, this also brings its legend to the top. More... | |
Public Attributes | |
HelpBroker | m_oHelpBroker |
JavaHelp class for managing help displays. More... | |
Protected Member Functions | |
void | doFileCloseData () |
Opens an output file. More... | |
void | doFileSave () |
File | Save Parameter File action performed. More... | |
void | doFileTextSave () |
File | Save Parameter File as text action performed. More... | |
void | setCursorToDefault () |
Changes the cursor to the default. More... | |
Protected Attributes | |
JMenuItem | m_jMenuFileNew |
File - new menu item. More... | |
JMenuItem | m_jMenuFileBatchNew |
File - new batch file menu item. More... | |
JMenuItem | m_jMenuFileOpen |
File - open file menu item. More... | |
JMenuItem | m_jMenuFileSave |
File - file save menu item. More... | |
JMenuItem | m_jMenuTextFileSave |
File - text file save menu item. More... | |
JMenuItem | m_jMenuFileOpenData |
File - open output file menu item. More... | |
JMenuItem | m_jMenuFileCloseData |
File - close output file menu item. More... | |
JMenuItem | m_jMenuFileSetDir |
File - set working directory menu item. More... | |
JMenuItem | m_jMenuFileRecentFile1 = new JMenuItem("", KeyEvent.VK_1) |
File - recent file 1 menu item. More... | |
JMenuItem | m_jMenuFileRecentFile2 = new JMenuItem("", KeyEvent.VK_2) |
File - recent file 2 menu item. More... | |
JMenuItem | m_jMenuFileRecentFile3 = new JMenuItem("", KeyEvent.VK_3) |
File - recent file 3 menu item. More... | |
JMenuItem | m_jMenuFileRecentFile4 = new JMenuItem("", KeyEvent.VK_4) |
File - recent file 4 menu item. More... | |
JMenuItem | m_jMenuFileRecentOutputFile1 = new JMenuItem("", KeyEvent.VK_5) |
File - recent output file 1 menu item. More... | |
JMenuItem | m_jMenuFileRecentOutputFile2 = new JMenuItem("", KeyEvent.VK_6) |
File - recent output file 2 menu item. More... | |
JMenuItem | m_jMenuFileRecentOutputFile3 = new JMenuItem("", KeyEvent.VK_7) |
File - recent output file 3 menu item. More... | |
JMenuItem | m_jMenuFileRecentOutputFile4 = new JMenuItem("", KeyEvent.VK_8) |
File - recent output file 4 menu item. More... | |
JMenuItem | m_jMenuFileExit = new JMenuItem("Exit", KeyEvent.VK_X) |
File - exit menu item. More... | |
JMenu | m_jMenuEditTree = new JMenu("Tree Population") |
Edit - tree setup submenu. More... | |
JMenuItem | m_jMenuEditGrid |
Edit - grid setup menu item. More... | |
JMenuItem | m_jMenuEditFlow |
Edit - model flow menu item. More... | |
JMenuItem | m_jMenuEditParameters |
Edit - parameters menu item. More... | |
JMenuItem | m_jMenuEditOutput |
Edit - output options menu item. More... | |
JMenuItem | m_jMenuTreeSpecies |
Tree submenu item - edit species list. More... | |
JMenuItem | m_jMenuTreeSizeClasses |
Tree submenu item - edit initial density size classes. More... | |
JMenuItem | m_jMenuTreeTreeMaps |
Tree submenu item - manage tree maps. More... | |
JMenuItem | m_jMenuModelRun = new JMenuItem("Run", KeyEvent.VK_R) |
Model - Run menu item. More... | |
JMenuItem | m_jMenuModelRunBatch = new JMenuItem("Run Batch...") |
Model - Run batch menu item. More... | |
JMenuItem | m_jMenuModelPause = new JMenuItem("Pause", KeyEvent.VK_P) |
Model - Pause menu item. More... | |
JMenuItem | m_jMenuModelStop |
Model - Stop menu item. More... | |
JMenuItem | m_jMenuHelpContents |
Help - contents menu item. More... | |
JMenuItem | m_jMenuToolsRename |
Help - about menu item. More... | |
JMenuItem | m_jMenuToolsBatchOut |
Tools - batch detailed output data extraction. More... | |
GUIManager | m_oDataManager |
Manager controlling all functions related to creating and editing parameter files and running the model. More... | |
DataVisualizerManager | m_oDataVisualizerManager |
Manager controlling all functions related to output data visualization. More... | |
HelpSet | m_oHelpSet |
The HelpSet object for the help file - class is from JavaHelp. More... | |
SORTIEComboBox< String > | m_jFileChoicesComboBox = new SORTIEComboBox<String>() |
Holds the list of currently open output files. More... | |
SORTIEComboBox< ChartFrameInfo > | m_jWindowsComboBox = new SORTIEComboBox<ChartFrameInfo>() |
Holds the list of currently open display windows. More... | |
JTextField | m_jParameterFileField = new JTextField() |
Field in the status bar holding the parameter file. More... | |
JTextField | m_jModelStatusField = new JTextField() |
Field holding the model status. More... | |
JTextField | m_jMessagesField = new JTextField() |
Field holding model messages. More... | |
JButton | m_jModelRunButton |
Button for running model. More... | |
JButton | m_jModelStopButton |
Button for stopping model. More... | |
JButton | m_jModelPauseButton |
Button for pausing model. More... | |
JButton | m_jModelStepForwardButton |
Button for stepping model. More... | |
JButton | m_jModelLoadOutputButton |
Button for loading run's output. More... | |
Private Member Functions | |
void | loadHelp () throws ModelException |
Loads the SORTIE help file so that it can be opened from buttons and menu commands. More... | |
void | resizeGUI () |
Causes the GUI to resize in a smart way. More... | |
void | createMenu () |
Creates the menu bar. More... | |
JMenu | makeFileMenu () |
void | createGUI () |
Component initialization and GUI construction. More... | |
void | bringChartToFront (ChartFrameInfo oInfo) throws ModelException |
void | doFileExit () |
File | Exit action performed. More... | |
void | doFileNew () |
File | New Parameter File action performed. More... | |
void | doFileSetWorkingDirectory () |
File | Set Working Directory action performed. More... | |
void | doFileBatchNew () |
File | New Batch File action performed. More... | |
void | doToolsRename () |
Tools | Rename detailed output file action performed. More... | |
void | doToolsBatchOut () |
Tools | Batch extract detailed output file action performed. More... | |
void | doViewRunOutput () throws ModelException |
Responds to the click of the button for viewing the current run's output. More... | |
void | doFileOpenRecentFile (String sCommandString) |
File | recent file action performed. More... | |
void | doFileOpen () |
File | Open Parameter File action performed. More... | |
void | openFile (String sFileName, String sTarName) |
Opens a parameter file. More... | |
void | doModelRunBatch () |
Model | Run Batch action performed. More... | |
void | doFileOpenData () throws ModelException |
Opens an output file. More... | |
void | doFileOpenRecentData (String sCommandString) throws ModelException |
Opens an output file. More... | |
void | doEditModelFlow () |
Edit | Edit model flow action performed. More... | |
void | doEditParameters () |
Edit | Run parameters data action performed. More... | |
void | doEditOutput () |
Edit | Edit output options action performed. More... | |
void | doModelPause (boolean bAlert) throws ModelException |
Model | Pause action performed. More... | |
void | doModelStop () throws ModelException |
Model | Stop Run action performed. More... | |
void | doModelRun (int iNumStepsToRun) |
Model | Run action performed. More... | |
void | doEditTreeSpecies () |
Displays the tree species editing window. More... | |
void | doEditTreeDensityClasses () |
Displays the tree initial density classes window. More... | |
void | doEditTreeManageTreeMap () throws ModelException |
Displays the tree map management window. More... | |
void | doEditGrid () |
Displays the Grid editing window. More... | |
Private Attributes | |
Interface | m_oInterface = null |
Object managing the interface between this application and the C++ model core. More... | |
Timer | m_oTimer |
Object that allows us to update the GUI while the core model is running. More... | |
JPopupMenu | m_jLineGraphChoices |
Menu with the line graph choices for the current output file. More... | |
JButton | m_jLineGraphMenuButton |
Button which opens the line graph choices menu. More... | |
JPopupMenu | m_jHistogramChoices |
Menu with the histogram choices for the current output file. More... | |
JButton | m_jHistogramMenuButton |
Button which opens the histogram choices menu. More... | |
JPopupMenu | m_jTableChoices |
Menu with the table choices for the current output file. More... | |
JButton | m_jTableMenuButton |
Button which opens the table choices menu. More... | |
JPopupMenu | m_jMapChoices |
Menu with the map choices for the current output file. More... | |
JButton | m_jMapMenuButton |
Button which opens the map choices menu. More... | |
JPopupMenu | m_jRecentChoices |
Menu with the recent chart choices. More... | |
JButton | m_jRecentMenuButton |
Button which opens the recent choices menu. More... | |
int | m_iState |
File loaded, no file loaded, running, etc. More... | |
JDesktopPane | m_oDesktop |
Desktop pane - allows the use of JInternalFrames. More... | |
JScrollPane | m_jScroller |
Scroll pane for the desktop. More... | |
boolean | m_bViewingRunOutput = false |
Flag for whether or not the user is doing real-time data visualization of the current run. More... | |
boolean | m_bKeepRunning = false |
Flag for whether, during real-time data visualization, a new run timestep should be triggered after data updates. More... | |
int | m_iPanelHeight = -1 |
The height of the data visualizer panel when the window is constructed. More... | |
Main application window.
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: Cary Institute of Ecosystem Studies
Edit history:
---------------—
December 8, 2011: Wiped the slate clean for version 7 (LEM)
November 19, 2012: Changed the window closing event method because the old method stopped working (LEM)
sortie.gui.MainWindow.MainWindow | ( | ) |
Constructor.
Draws the window.
void sortie.gui.MainWindow.actionPerformed | ( | ActionEvent | oEvent | ) |
Manages window events.
oEvent | Event triggered. |
|
private |
void sortie.gui.MainWindow.closeOneDataFile | ( | String | sFileName | ) |
Closes a single output file and manages the file list.
sFileName | String File to close. |
|
private |
Component initialization and GUI construction.
|
private |
Creates the menu bar.
|
private |
Displays the Grid editing window.
|
private |
Edit | Edit model flow action performed.
|
private |
Edit | Edit output options action performed.
|
private |
Edit | Run parameters data action performed.
|
private |
Displays the tree initial density classes window.
|
private |
Displays the tree map management window.
|
private |
Displays the tree species editing window.
|
private |
File | New Batch File action performed.
|
protected |
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. Closes an open output file. All open windows related to this file are closed as well. |
|
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.
|
private |
File | New Parameter File action performed.
|
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. 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.
|
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. |
|
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. |
|
private |
File | recent file action performed.
sCommandString | Command string from action performed. This will let us know which file was chosen. |
|
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.
|
private |
File | Set Working Directory action performed.
|
protected |
File | Save Parameter File as text action performed.
This is a request to save a parameter file. The request is passed to the GUI manager for processing.
|
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. |
|
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. |
|
private |
Model | Run Batch action performed.
Allows the user to input a batch file and run it.
|
private |
Model | Stop Run action performed.
Stops the currently executing run.
ModelException | passed through from called functions. |
|
private |
Tools | Batch extract detailed output file action performed.
|
private |
Tools | Rename detailed output file action performed.
|
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. |
GUIManager sortie.gui.MainWindow.getDataManager | ( | ) |
Gets the GUI manager.
int sortie.gui.MainWindow.getModelState | ( | ) |
Gets the current window state.
void sortie.gui.MainWindow.internalFrameActivated | ( | InternalFrameEvent | e | ) |
When a chart window is activated, this also brings its legend to the top.
e | InternalFrameEvent |
void sortie.gui.MainWindow.internalFrameClosed | ( | InternalFrameEvent | e | ) |
Handles the closing of chart windows.
When a chart window is closed, this removes it from the list of open windows.
e | InternalFrameEvent |
void sortie.gui.MainWindow.internalFrameClosing | ( | InternalFrameEvent | e | ) |
void sortie.gui.MainWindow.internalFrameDeactivated | ( | InternalFrameEvent | e | ) |
void sortie.gui.MainWindow.internalFrameDeiconified | ( | InternalFrameEvent | e | ) |
void sortie.gui.MainWindow.internalFrameIconified | ( | InternalFrameEvent | e | ) |
void sortie.gui.MainWindow.internalFrameOpened | ( | InternalFrameEvent | e | ) |
|
private |
Loads the SORTIE help file so that it can be opened from buttons and menu commands.
ModelException | if the help is not found. |
|
private |
|
private |
Opens a parameter file.
This makes sure state setting, recent files, etc. are updated.
|
private |
Causes the GUI to resize in a smart way.
void sortie.gui.MainWindow.sendMessage | ( | ModelMessage | oMsg | ) |
SendMessage accepts a message from the interface.
oMsg | Message to accept. |
|
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 sortie.gui.MainWindow.setModelState | ( | int | iState | ) |
Sets the current window state.
iState | State to set to. Should be one of the choices in MainWindowStateSetter. |
void sortie.gui.MainWindow.updateChartChoices | ( | ) |
Updates the chart choices in the data visualization panel according to the file which is selected in the file list.
void sortie.gui.MainWindow.windowActivated | ( | WindowEvent | e | ) |
Not implemented.
void sortie.gui.MainWindow.windowClosed | ( | WindowEvent | e | ) |
Not implemented.
void sortie.gui.MainWindow.windowClosing | ( | WindowEvent | e | ) |
Ensures the application closes when this window closes.
void sortie.gui.MainWindow.windowDeactivated | ( | WindowEvent | e | ) |
Not implemented.
void sortie.gui.MainWindow.windowDeiconified | ( | WindowEvent | e | ) |
Not implemented.
void sortie.gui.MainWindow.windowIconified | ( | WindowEvent | e | ) |
Not implemented.
void sortie.gui.MainWindow.windowOpened | ( | WindowEvent | e | ) |
Not implemented.
|
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.
|
private |
Flag for whether or not the user is doing real-time data visualization of the current run.
|
private |
The height of the data visualizer panel when the window is constructed.
This will allow us to resize it if the user changes the size of the window. This is to avoid losing items off the screen.
|
private |
File loaded, no file loaded, running, etc.
|
protected |
Holds the list of currently open output files.
|
private |
Menu with the histogram choices for the current output file.
|
private |
Button which opens the histogram choices menu.
|
private |
Menu with the line graph choices for the current output file.
|
private |
Button which opens the line graph choices menu.
|
private |
Menu with the map choices for the current output file.
|
private |
Button which opens the map choices menu.
|
protected |
Edit - model flow menu item.
|
protected |
Edit - grid setup menu item.
|
protected |
Edit - output options menu item.
|
protected |
Edit - parameters menu item.
|
protected |
Edit - tree setup submenu.
|
protected |
File - new batch file menu item.
|
protected |
File - close output file menu item.
|
protected |
File - exit menu item.
|
protected |
File - new menu item.
|
protected |
File - open file menu item.
|
protected |
File - open output file menu item.
|
protected |
File - recent file 1 menu item.
|
protected |
File - recent file 2 menu item.
|
protected |
File - recent file 3 menu item.
|
protected |
File - recent file 4 menu item.
|
protected |
File - recent output file 1 menu item.
|
protected |
File - recent output file 2 menu item.
|
protected |
File - recent output file 3 menu item.
|
protected |
File - recent output file 4 menu item.
|
protected |
File - file save menu item.
|
protected |
File - set working directory menu item.
|
protected |
Help - contents menu item.
|
protected |
Model - Pause menu item.
|
protected |
Model - Run menu item.
|
protected |
Model - Run batch menu item.
|
protected |
Model - Stop menu item.
|
protected |
File - text file save menu item.
|
protected |
Tools - batch detailed output data extraction.
|
protected |
Help - about menu item.
Tools - rename detailed output file menu item
|
protected |
Tree submenu item - edit initial density size classes.
|
protected |
Tree submenu item - edit species list.
|
protected |
Tree submenu item - manage tree maps.
|
protected |
Field holding model messages.
|
protected |
Button for loading run's output.
|
protected |
Button for pausing model.
|
protected |
Button for running model.
|
protected |
Field holding the model status.
|
protected |
Button for stepping model.
|
protected |
Button for stopping model.
|
protected |
Field in the status bar holding the parameter file.
|
private |
Menu with the recent chart choices.
|
private |
Button which opens the recent choices menu.
|
private |
Scroll pane for the desktop.
|
private |
Menu with the table choices for the current output file.
|
private |
Button which opens the table choices menu.
|
protected |
Holds the list of currently open display windows.
|
protected |
Manager controlling all functions related to creating and editing parameter files and running the model.
|
protected |
Manager controlling all functions related to output data visualization.
|
private |
Desktop pane - allows the use of JInternalFrames.
HelpBroker sortie.gui.MainWindow.m_oHelpBroker |
JavaHelp class for managing help displays.
|
protected |
The HelpSet object for the help file - class is from JavaHelp.
|
private |
Object managing the interface between this application and the C++ model core.
|
private |
Object that allows us to update the GUI while the core model is running.