|
SORTIE Java Interface
1
|
This extends the legend class and adds some features specific to the viewing of detailed output files - specifically the ability to step through timesteps. More...
Public Member Functions | |
| DetailedOutputLegend (DetailedOutputFileManager oManager, String sTitle, String[] p_sSpeciesNames, int iMaxTimesteps) throws ModelException | |
| Constructor. | |
| void | actionPerformed (ActionEvent e) |
| Responds to button presses. | |
| void | goToTimestep (int iTimestep) throws sortie.data.simpletypes.ModelException |
| Changes the display to the desired timestep. | |
| int | getNumberOfTimesteps () |
| Gets the number of timesteps contained in this detailed output file. | |
| void | setNumberOfTimesteps (int iNumTimesteps) |
| Updates the legend with a new maximum number of timesteps. | |
| int | getCurrentTimestep () |
| Gets the timestep currently being displayed. | |
Public Member Functions inherited from sortie.datavisualizer.Legend | |
| Legend (DataFileManager oManager, String sTitle, String[] p_sSpeciesNames) throws ModelException | |
| Constructor. | |
| Color | getSpeciesColor (int iIndex) throws ModelException |
| Gets the color associated with a particular species. | |
| Color | getSpeciesColor (String sName) throws ModelException |
| Gets the color associated with a particular species. | |
| boolean | getIsSpeciesSelected (int iIndex) throws ModelException |
| Get whether or not a species' checkbox indicates that it is selected. | |
| int | getNumberOfSpecies () |
| Gets the total number of species for this legend. | |
| void | checkBox_actionPerformed (ActionEvent e) |
| Triggered when a checkbox is toggled on or off. | |
| String | getSpeciesCodeName (int i) throws ModelException |
| Gets the internal code species name for a given species index. | |
| String | getSpeciesDisplayName (int i) throws ModelException |
| Gets the species display name for a given species index. | |
| void | chooseColor (ActionEvent e) |
| Displays the color chooser when the user clicks the color chooser button, and extracts the chosen color. | |
Private Member Functions | |
| void | step (int iDirection) throws ModelException |
| Steps the model in the desired direction. | |
| void | jump () throws ModelException |
| Jumps the model to the timestep indicated in m_jJumpToTimestepField. | |
| void | run (int iDirection) throws ModelException |
| Runs the detailed output file continuously through the timesteps. | |
Private Attributes | |
| JLabel | m_jCurrentTimestepLabel = new JLabel() |
| Label displaying current timestep. | |
| JTextField | m_jRateField = new JTextField("1") |
| Field for the rate at which to step or run through the detailed output file. | |
| JTextField | m_jJumpToTimestepField = new JTextField("0") |
| Field for the user to enter a particular timestep to jump to. | |
| int | m_iCurrentTimestep |
| The timestep of the data currently being displayed. | |
| int | m_iMaxTimestep |
| The maximum timestep for this file. | |
| boolean | m_bStop = false |
| Flag for whether to stop when the file is running through timesteps. | |
| boolean | m_bRunning = false |
| Flag for whether or not we're currently running. | |
Static Private Attributes | |
| static final int | FORWARD = 1 |
| Flag for moving forward through timesteps. | |
| static final int | BACKWARD = 2 |
| Flag for moving backward through timesteps. | |
Additional Inherited Members | |
Protected Member Functions inherited from sortie.datavisualizer.Legend | |
| void | createColorList () |
| Creates the GUI and lays out all the components. | |
Protected Attributes inherited from sortie.datavisualizer.Legend | |
| String[] | mp_sSpeciesNames |
| The names of each of the species. | |
| String[] | mp_sDisplayNames |
| The names that will be displayed. | |
| Color[] | mp_oSpeciesColors |
| The color for each species. | |
| JButton[] | mp_jSpeciesColorDisplays |
| The color display for each species. | |
| JCheckBox[] | mp_jSpeciesChecks |
| Checkboxes indicating whether or not a species should be visible. | |
| DataFileManager | m_oManager |
| Parent data file manager. | |
This extends the legend class and adds some features specific to the viewing of detailed output files - specifically the ability to step through timesteps.
Copyright: Copyright (c) Charles D. Canham 2003
Company: Cary Institute of Ecosystem Studies
Edit history:
---------------—
April 28, 2004: Submitted in beta version (LEM)
December 8, 2004: Added more run controls (LEM)
February 4, 2008: Updated to conform to Java 6 compliance (LEM)
| sortie.datavisualizer.DetailedOutputLegend.DetailedOutputLegend | ( | DetailedOutputFileManager | oManager, |
| String | sTitle, | ||
| String[] | p_sSpeciesNames, | ||
| int | iMaxTimesteps | ||
| ) | throws ModelException |
Constructor.
| oManager | Parent detailed output file manager. |
| sTitle | Title to display in window. |
| p_sSpeciesNames | List of species names. |
| iMaxTimesteps | Maximum number of timesteps in this detailed output file. |
| ModelException | If there is a problem drawing the window. |
| void sortie.datavisualizer.DetailedOutputLegend.actionPerformed | ( | ActionEvent | e | ) |
Responds to button presses.
| e | ActionEvent |
| int sortie.datavisualizer.DetailedOutputLegend.getCurrentTimestep | ( | ) |
Gets the timestep currently being displayed.
| int sortie.datavisualizer.DetailedOutputLegend.getNumberOfTimesteps | ( | ) |
Gets the number of timesteps contained in this detailed output file.
| void sortie.datavisualizer.DetailedOutputLegend.goToTimestep | ( | int | iTimestep | ) | throws sortie.data.simpletypes.ModelException |
Changes the display to the desired timestep.
If the requested timestep is beyond the boundaries of possible timesteps, nothing happens.
| iTimestep | int Timestep to display. |
| ModelException | if there is a problem updating charts. |
|
private |
Jumps the model to the timestep indicated in m_jJumpToTimestepField.
| ModelException | if the value in the jump to field is not a positive number. |
|
private |
Runs the detailed output file continuously through the timesteps.
It will jump at the rate specified in the m_jRateField field. This will put the running in a separate thread so we can listen if the user wants to stop.
| iDirection | int Direction to run in, either FORWARD or BACKWARD. |
| ModelException | if the value in the rate field is not a positive number. |
| void sortie.datavisualizer.DetailedOutputLegend.setNumberOfTimesteps | ( | int | iNumTimesteps | ) |
Updates the legend with a new maximum number of timesteps.
| iNumTimesteps | int The new maximum number of timesteps. |
|
private |
Steps the model in the desired direction.
The model will be stepped the number of timesteps indicated in the rate field.
| iDirection | int Either FORWARD or BACKWARD. |
| ModelException | if the value in the rate field is not a positive number. |
|
staticprivate |
Flag for moving backward through timesteps.
|
staticprivate |
Flag for moving forward through timesteps.
|
private |
Flag for whether or not we're currently running.
|
private |
Flag for whether to stop when the file is running through timesteps.
|
private |
The timestep of the data currently being displayed.
|
private |
The maximum timestep for this file.
|
private |
Label displaying current timestep.
|
private |
Field for the user to enter a particular timestep to jump to.
|
private |
Field for the rate at which to step or run through the detailed output file.
1.8.2