SORTIE Java Interface  1
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
sortie.datavisualizer.DetailedOutputLegend Class Reference

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...

Inheritance diagram for sortie.datavisualizer.DetailedOutputLegend:
sortie.datavisualizer.Legend

Public Member Functions

 DetailedOutputLegend (DetailedOutputFileManager oManager, String sTitle, String[] p_sSpeciesNames, int iMaxTimesteps) throws ModelException
 Constructor. More...
 
void actionPerformed (ActionEvent e)
 Responds to button presses. More...
 
void goToTimestep (int iTimestep) throws sortie.data.simpletypes.ModelException
 Changes the display to the desired timestep. More...
 
int getNumberOfTimesteps ()
 Gets the number of timesteps contained in this detailed output file. More...
 
void setNumberOfTimesteps (int iNumTimesteps)
 Updates the legend with a new maximum number of timesteps. More...
 
int getCurrentTimestep ()
 Gets the timestep currently being displayed. More...
 
- Public Member Functions inherited from sortie.datavisualizer.Legend
 Legend (DataFileManager oManager, String sTitle, String[] p_sSpeciesNames) throws ModelException
 Constructor. More...
 
Color getSpeciesColor (int iIndex) throws ModelException
 Gets the color associated with a particular species. More...
 
Color getSpeciesColor (String sName) throws ModelException
 Gets the color associated with a particular species. More...
 
boolean getIsSpeciesSelected (int iIndex) throws ModelException
 Get whether or not a species' checkbox indicates that it is selected. More...
 
int getNumberOfSpecies ()
 Gets the total number of species for this legend. More...
 
void actionPerformed (ActionEvent e)
 Triggered when a checkbox is toggled on or off. More...
 
String getSpeciesCodeName (int i) throws ModelException
 Gets the internal code species name for a given species index. More...
 
String getSpeciesDisplayName (int i) throws ModelException
 Gets the species display name for a given species index. More...
 
void chooseColor (ActionEvent e)
 Displays the color chooser when the user clicks the color chooser button, and extracts the chosen color. More...
 

Private Member Functions

void step (int iDirection) throws ModelException
 Steps the model in the desired direction. More...
 
void jump () throws ModelException
 Jumps the model to the timestep indicated in m_jJumpToTimestepField. More...
 
void run (int iDirection) throws ModelException
 Runs the detailed output file continuously through the timesteps. More...
 

Private Attributes

JLabel m_jCurrentTimestepLabel = new JLabel()
 Label displaying current timestep. More...
 
JTextField m_jRateField = new JTextField("1")
 Field for the rate at which to step or run through the detailed output file. More...
 
JTextField m_jJumpToTimestepField = new JTextField("0")
 Field for the user to enter a particular timestep to jump to. More...
 
int m_iCurrentTimestep
 The timestep of the data currently being displayed. More...
 
int m_iMaxTimestep
 The maximum timestep for this file. More...
 
boolean m_bStop = false
 Flag for whether to stop when the file is running through timesteps. More...
 
boolean m_bRunning = false
 Flag for whether or not we're currently running. More...
 

Static Private Attributes

static final int FORWARD = 1
 Flag for moving forward through timesteps. More...
 
static final int BACKWARD = 2
 Flag for moving backward through timesteps. More...
 

Additional Inherited Members

- Protected Member Functions inherited from sortie.datavisualizer.Legend
void createColorList ()
 Creates the GUI and lays out all the components. More...
 
- Protected Attributes inherited from sortie.datavisualizer.Legend
String [] mp_sSpeciesNames
 The names of each of the species. More...
 
String [] mp_sDisplayNames
 The names that will be displayed. More...
 
Color [] mp_oSpeciesColors
 The color for each species. More...
 
JButton [] mp_jSpeciesColorDisplays
 The color display for each species. More...
 
JCheckBox [] mp_jSpeciesChecks
 Checkboxes indicating whether or not a species should be visible. More...
 
DataFileManager m_oManager
 Parent data file manager. More...
 

Detailed Description

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

Author
Lora E. Murphy
Version
1.0


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)

Constructor & Destructor Documentation

◆ DetailedOutputLegend()

sortie.datavisualizer.DetailedOutputLegend.DetailedOutputLegend ( DetailedOutputFileManager  oManager,
String  sTitle,
String []  p_sSpeciesNames,
int  iMaxTimesteps 
) throws ModelException

Constructor.

Parameters
oManagerParent detailed output file manager.
sTitleTitle to display in window.
p_sSpeciesNamesList of species names.
iMaxTimestepsMaximum number of timesteps in this detailed output file.
Exceptions
ModelExceptionIf there is a problem drawing the window.

Member Function Documentation

◆ actionPerformed()

void sortie.datavisualizer.DetailedOutputLegend.actionPerformed ( ActionEvent  e)

Responds to button presses.

Parameters
eActionEvent

◆ getCurrentTimestep()

int sortie.datavisualizer.DetailedOutputLegend.getCurrentTimestep ( )

Gets the timestep currently being displayed.

Returns
int the timestep currently being displayed.

◆ getNumberOfTimesteps()

int sortie.datavisualizer.DetailedOutputLegend.getNumberOfTimesteps ( )

Gets the number of timesteps contained in this detailed output file.

Returns
int Number of timesteps for this detailed output file.

◆ goToTimestep()

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.

Parameters
iTimestepint Timestep to display.
Exceptions
ModelExceptionif there is a problem updating charts.

◆ jump()

void sortie.datavisualizer.DetailedOutputLegend.jump ( ) throws ModelException
private

Jumps the model to the timestep indicated in m_jJumpToTimestepField.

Exceptions
ModelExceptionif the value in the jump to field is not a positive number.

◆ run()

void sortie.datavisualizer.DetailedOutputLegend.run ( int  iDirection) throws ModelException
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.

Parameters
iDirectionint Direction to run in, either FORWARD or BACKWARD.
Exceptions
ModelExceptionif the value in the rate field is not a positive number.

◆ setNumberOfTimesteps()

void sortie.datavisualizer.DetailedOutputLegend.setNumberOfTimesteps ( int  iNumTimesteps)

Updates the legend with a new maximum number of timesteps.

Parameters
iNumTimestepsint The new maximum number of timesteps.

◆ step()

void sortie.datavisualizer.DetailedOutputLegend.step ( int  iDirection) throws ModelException
private

Steps the model in the desired direction.

The model will be stepped the number of timesteps indicated in the rate field.

Parameters
iDirectionint Either FORWARD or BACKWARD.
Exceptions
ModelExceptionif the value in the rate field is not a positive number.

Member Data Documentation

◆ BACKWARD

final int sortie.datavisualizer.DetailedOutputLegend.BACKWARD = 2
staticprivate

Flag for moving backward through timesteps.

◆ FORWARD

final int sortie.datavisualizer.DetailedOutputLegend.FORWARD = 1
staticprivate

Flag for moving forward through timesteps.

◆ m_bRunning

boolean sortie.datavisualizer.DetailedOutputLegend.m_bRunning = false
private

Flag for whether or not we're currently running.

◆ m_bStop

boolean sortie.datavisualizer.DetailedOutputLegend.m_bStop = false
private

Flag for whether to stop when the file is running through timesteps.

◆ m_iCurrentTimestep

int sortie.datavisualizer.DetailedOutputLegend.m_iCurrentTimestep
private

The timestep of the data currently being displayed.

◆ m_iMaxTimestep

int sortie.datavisualizer.DetailedOutputLegend.m_iMaxTimestep
private

The maximum timestep for this file.

◆ m_jCurrentTimestepLabel

JLabel sortie.datavisualizer.DetailedOutputLegend.m_jCurrentTimestepLabel = new JLabel()
private

Label displaying current timestep.

◆ m_jJumpToTimestepField

JTextField sortie.datavisualizer.DetailedOutputLegend.m_jJumpToTimestepField = new JTextField("0")
private

Field for the user to enter a particular timestep to jump to.

◆ m_jRateField

JTextField sortie.datavisualizer.DetailedOutputLegend.m_jRateField = new JTextField("1")
private

Field for the rate at which to step or run through the detailed output file.


The documentation for this class was generated from the following file: