SORTIE Java Interface
1
|
Writes a stand table for a detailed output file (basal area or density for each life history stage throughout the run). More...
Public Member Functions | |
StandTableDataRequest (DetailedOutputFileManager oManager, String sChartName, int iTableType) | |
Constructor. More... | |
void | actionPerformed (ActionEvent oEvent) |
Respons to the button clicks for this class's chart window. More... | |
void | outputFileParseFinished (boolean bBatchMode) |
This corrects basal area units after output file parsing is completed. More... | |
boolean | wantAnyTreeFloats () |
This wants diameter values for all trees. More... | |
void | extractBatchSetupInfo (ChartInfo oInfo) throws ModelException |
Extracts information needed by the data request from the controls panel displayed to the user. More... | |
void | addTreeFloatDataMemberCode (int iSpecies, int iType, String sLabel, int iCode) |
Accepts a tree float data member code. More... | |
void | addTreeFloatData (int iSpecies, int iType, int iCode, float fVal, boolean bBatchMode) |
Accepts a tree float data member value. More... | |
Public Member Functions inherited from sortie.datavisualizer.DataRequest | |
DataRequest (String sChartName, DetailedOutputFileManager oManager) | |
Constructor. More... | |
void | setCurrentTimestep (int iTimestep) |
Sets the current time step. More... | |
void | actionPerformed (java.awt.event.ActionEvent oEvent) |
If passed the order to write chart data, does it. More... | |
void | extractBatchSetupInfo (ChartInfo oInfo) throws ModelException |
Extracts information needed by the data request from the controls panel displayed to the user. More... | |
boolean | isFileWritingExternallyManaged () |
Gets whether or not file writing is externally managed for this data request or whether it takes care of everything itself. More... | |
void | getReadyForTimestepParse (int iTimestep, boolean bBatchMode) throws ModelException |
This will be called for all open data requests just before time step parsing begins. More... | |
void | timestepParseFinished (boolean bBatchMode) throws ModelException |
This will be called for all open data requests after time step parsing is completed. More... | |
void | outputFileParseFinished (boolean bBatchMode) |
This will be called for all open data requests after output file parsing is completed. More... | |
void | saveChartDataToFile (boolean bJustCurrTS) |
Writes a chart's data to a file. More... | |
String | getChartName () |
Get the name of the chart. More... | |
JInternalFrame | getChart () |
Get the chart frame. More... | |
boolean | wantAnyTreeFloats () |
Whether or not this object wants any tree float data members. More... | |
boolean | wantAnyTreeInts () |
Whether or not this object wants any tree int data members. More... | |
boolean | wantAnyTreeChars () |
Whether or not this object wants any tree char data members. More... | |
boolean | wantAnyTreeBools () |
Whether or not this object wants any tree bool data members. More... | |
boolean | wantAnyDeadTreeFloats () |
Whether or not this object wants any dead tree float data members. More... | |
boolean | wantAnyDeadTreeInts () |
Whether or not this object wants any dead tree int data members. More... | |
boolean | wantAnyDeadTreeChars () |
Whether or not this object wants any dead tree char data members. More... | |
boolean | wantAnyDeadTreeBools () |
Whether or not this object wants any dead tree bool data members. More... | |
boolean | wantAnyGridFloats () |
Whether or not this object wants any grid float data members. More... | |
boolean | wantAnyGridInts () |
Whether or not this object wants any grid int data members. More... | |
boolean | wantAnyGridChars () |
Whether or not this object wants any grid char data members. More... | |
boolean | wantAnyGridBools () |
Whether or not this object wants any grid bool data members. More... | |
boolean | wantAnyGridPackageFloats () |
Whether or not this object wants any grid package float data members. More... | |
boolean | wantAnyGridPackageInts () |
Whether or not this object wants any grid package int data members. More... | |
boolean | wantAnyGridPackageChars () |
Whether or not this object wants any grid package char data members. More... | |
boolean | wantAnyGridPackageBools () |
Whether or not this object wants any grid package bool data members. More... | |
void | addTreeFloatData (int iSpecies, int iType, int iCode, float fVal, boolean bBatchMode) throws SAXException |
Accepts a piece of tree float data from the parser. More... | |
void | addTreeIntData (int iSpecies, int iType, int iCode, int iVal, boolean bBatchMode) throws SAXException |
Accepts a piece of tree int data from the parser. More... | |
void | addTreeCharData (int iSpecies, int iType, int iCode, String sVal, boolean bBatchMode) throws SAXException |
Accepts a piece of tree char data from the parser. More... | |
void | addTreeBoolData (int iSpecies, int iType, int iCode, boolean bVal, boolean bBatchMode) throws SAXException |
Accepts a piece of tree bool data from the parser. More... | |
void | addDeadTreeFloatData (int iSpecies, int iType, int iCode, int iDeadCode, float fVal, boolean bBatchMode) throws SAXException |
Accepts a piece of dead tree float data from the parser. More... | |
void | addDeadTreeIntData (int iSpecies, int iType, int iCode, int iDeadCode, int iVal, boolean bBatchMode) throws SAXException |
Accepts a piece of dead tree int data from the parser. More... | |
void | addDeadTreeCharData (int iSpecies, int iType, int iCode, int iDeadCode, String sVal, boolean bBatchMode) throws SAXException |
Accepts a piece of dead tree char data from the parser. More... | |
void | addDeadTreeBoolData (int iSpecies, int iType, int iCode, int iDeadCode, boolean bVal, boolean bBatchMode) throws SAXException |
Accepts a piece of dead tree bool data from the parser. More... | |
void | addGridFloatData (String sGridName, int iX, int iY, int iCode, float fVal, boolean bBatchMode) throws SAXException |
Accepts a piece of grid float data from the parser. More... | |
void | addGridIntData (String sGridName, int iX, int iY, int iCode, int iVal, boolean bBatchMode) throws SAXException |
Accepts a piece of grid int data from the parser. More... | |
void | addGridCharData (String sGridName, int iX, int iY, int iCode, String sVal, boolean bBatchMode) throws SAXException |
Accepts a piece of grid char data from the parser. More... | |
void | addGridBoolData (String sGridName, int iX, int iY, int iCode, boolean bVal, boolean bBatchMode) throws SAXException |
Accepts a piece of grid bool data from the parser. More... | |
void | addGridPackageFloatData (String sGridName, int iX, int iY, int iCode, float fVal, boolean bBatchMode) throws SAXException |
Accepts a piece of grid package float data from the parser. More... | |
void | addGridPackageIntData (String sGridName, int iX, int iY, int iCode, int iVal, boolean bBatchMode) throws SAXException |
Accepts a piece of grid package int data from the parser. More... | |
void | addGridPackageCharData (String sGridName, int iX, int iY, int iCode, String sVal, boolean bBatchMode) throws SAXException |
Accepts a piece of grid package char data from the parser. More... | |
void | addGridPackageBoolData (String sGridName, int iX, int iY, int iCode, boolean bVal, boolean bBatchMode) throws SAXException |
Accepts a piece of grid package bool data from the parser. More... | |
void | endPackage () throws SAXException |
Announces a package has ended. More... | |
void | endTree (boolean bBatchMode) throws SAXException |
Announces a tree record has ended. More... | |
void | addTreeFloatDataMemberCode (int iSpecies, int iType, String sLabel, int iCode) throws SAXException |
Accepts a tree float data member code for future reference when passed float data members. More... | |
void | addTreeIntDataMemberCode (int iSpecies, int iType, String sLabel, int iCode) throws SAXException |
Accepts a tree int data member code for future reference when passed int data members. More... | |
void | addTreeCharDataMemberCode (int iSpecies, int iType, String sLabel, int iCode) throws SAXException |
Accepts a tree char data member code for future reference when passed char data members. More... | |
void | addTreeBoolDataMemberCode (int iSpecies, int iType, String sLabel, int iCode) throws SAXException |
Accepts a tree bool data member code for future reference when passed bool data members. More... | |
void | addGridFloatDataMemberCode (String sGridName, String sLabel, int iCode) throws SAXException |
Accepts a grid float data member code for future reference when passed float data members. More... | |
void | addGridIntDataMemberCode (String sGridName, String sLabel, int iCode) throws SAXException |
Accepts a grid int data member code for future reference when passed int data members. More... | |
void | addGridCharDataMemberCode (String sGridName, String sLabel, int iCode) throws SAXException |
Accepts a grid char data member code for future reference when passed char data members. More... | |
void | addGridBoolDataMemberCode (String sGridName, String sLabel, int iCode) throws SAXException |
Accepts a grid bool data member code for future reference when passed bool data members. More... | |
void | addGridPackageFloatDataMemberCode (String sGridName, String sLabel, int iCode) throws SAXException |
Accepts a grid package float data member code for future reference when passed float data members. More... | |
void | addGridPackageIntDataMemberCode (String sGridName, String sLabel, int iCode) throws SAXException |
Accepts a grid package int data member code for future reference when passed int data members. More... | |
void | addGridPackageCharDataMemberCode (String sGridName, String sLabel, int iCode) throws SAXException |
Accepts a grid package char data member code for future reference when passed char data members. More... | |
void | addGridPackageBoolDataMemberCode (String sGridName, String sLabel, int iCode) throws SAXException |
Accepts a grid package bool data member code for future reference when passed bool data members. More... | |
Static Public Member Functions | |
static JPanel | makeSizeClassPanel (ActionListener oListener, String[] p_sSpeciesNames, int iNumSizeClasses, double fSizeClassSize, int iSelectedSpecies, boolean bIncludeLive, boolean bIncludeSnags) throws ModelException |
Makes the panel containing the size class and species controls. More... | |
static JPanel | makeSizeClassPanel () throws ModelException |
This makes the size class panel using default values. More... | |
Static Public Attributes | |
static final int | BASAL_AREA = 1 |
Basal area stand table. More... | |
static final int | DENSITY = 2 |
Density stand table. More... | |
static final String | PANEL_NAME = "Stand Table Panel" |
The name that is given to the control panel for this data request, which can be used with the named components finder to get access. More... | |
static final String | NUMBER_SIZE_CLASS_NAME = "Number Size Classes" |
The name that is given to the text field holding the number of size classes in the control panel for this data request. More... | |
static final String | SIZE_CLASS_SIZE_NAME = "Size Class Size" |
The name that is given to the text field holding the size of size classes in the control panel for this data request. More... | |
static final String | INCLUDE_LIVE_NAME = "Include Live" |
The name that is given to the check box for whether or not to include live trees in the control panel for this data request. More... | |
static final String | INCLUDE_SNAGS_NAME = "Include Snags" |
The name that is given to the check box for whether or not to include snags in the control panel for this data request. More... | |
static final String | SPECIES_COMBO_BOX_NAME = "Species Combo Box" |
The name that is given to the species combo box in the control panel. More... | |
Protected Member Functions | |
void | getDataAndMakeTables () throws ModelException |
This writes the tables. More... | |
void | writeChartDataToFile (FileWriter jOut) throws IOException |
Saves the data in the current table as a tab-delimited text file. More... | |
Protected Member Functions inherited from sortie.datavisualizer.DataRequest | |
abstract void | writeChartDataToFile (java.io.FileWriter jOut) throws java.io.IOException, ModelException |
Child classes override this to write the data behind their chart to tab-delimited text. More... | |
Private Member Functions | |
void | declareArrays () |
Declare arrays for holding data. More... | |
Object [][] | createTable (int iSpecies) |
Creates the table for display. More... | |
JPanel | makeTablePanel (int iSpecies) throws sortie.data.simpletypes.ModelException |
Makes a panel with a table for a species. More... | |
Private Attributes | |
DetailedOutputLegend | m_oLegend = null |
The legend for the detailed output file whose data goes in the table. More... | |
double [][][] | mp_fLiveTreeBATotals = null |
Live tree BA totals (if needed) - species by timesteps by size classes. More... | |
double [][][] | mp_fSnagBATotals = null |
Snag BA totals (if needed)) - species by timesteps by size classes. More... | |
long [][][] | mp_iLiveTreeCounts = null |
Live tree counts - species by timesteps by size classes. More... | |
long [][][] | mp_iSnagCounts = null |
Snag counts - species by timesteps by size classes. More... | |
double [][] | mp_fLiveTreeDBHTotal |
Live tree DBH totals, for mean DBH - species by timesteps. More... | |
double [][] | mp_fSnagDBHTotal |
Snag DBH totals, for mean DBH - species by timesteps. More... | |
float [][][] | mp_fTallestLiveTrees |
Sorted list of the tallest trees: array 1 = species, array 2 = timesteps, array 3 = list of tree heights. More... | |
float [][][] | mp_fTallestSnags |
Sorted list of the tallest trees: array 1 = species, array 2 = timesteps, array 3 = list of tree heights. More... | |
int [][] | mp_iDbhCode |
Holds the data codes for DBH. More... | |
int [][] | mp_iHeightCode |
Holds the data codes for height. More... | |
String [] | mp_sSpeciesNames |
The species names that will appear in the combo box. More... | |
String [] | mp_sHeaders |
Column headers. More... | |
double [] | mp_fSizeClasses |
List of size class upper boundaries. More... | |
float | m_fPlotAreaInHectares |
Area of the plot, in hectares. More... | |
double | m_fSizeClassSize = SIZE_CLASS_SIZE_DEFAULT |
Size of DBH size classes, in cm. More... | |
int | m_iNumSpecies |
Number of total species. More... | |
int | m_iNumSizeClasses = NUM_SIZE_CLASS_DEFAULT |
Number of DBH size classes to display in table. More... | |
boolean | m_bCurrentProcessing = false |
Whether or not the current processing was triggered by this object. More... | |
int | m_iNumTimesteps = -1 |
The total number of timesteps. More... | |
int | m_iTableType |
The type of table - either basal area or density. More... | |
boolean | m_bFirstTime = true |
So we can display the first time. More... | |
boolean | m_bIncludeLive = true |
Whether to include live trees. More... | |
boolean | m_bIncludeSnags = true |
Whether to include snags. More... | |
Static Private Attributes | |
static int | NUM_SIZE_CLASS_DEFAULT = 10 |
Default value for the number of size classes in the control box. More... | |
static double | SIZE_CLASS_SIZE_DEFAULT = 5.0 |
Default value for the size of the size classes in the control box. More... | |
static boolean | INCLUDE_LIVE_DEFAULT = true |
Whether to include live trees - default value. More... | |
static boolean | INCLUDE_SNAGS_DEFAULT = true |
Whether to include snags - default value. More... | |
Additional Inherited Members | |
Protected Attributes inherited from sortie.datavisualizer.DataRequest | |
String | m_sBatchFilename = "" |
File name for batch data extraction. More... | |
int | m_iCurrentTimestep |
Current time step being parsed. More... | |
boolean | m_bShowOneTimestep = true |
Whether this chart shows one timestep at a time (true) or all timesteps (false). More... | |
boolean | m_bExternallyManageWriting = true |
Whether or not this data request gets its file writing managed externally. More... | |
ModelInternalFrame | m_oChartFrame |
Chart for this request. More... | |
String | m_sChartName |
Name string of chart. More... | |
Writes a stand table for a detailed output file (basal area or density for each life history stage throughout the run).
The tabulation of density and basal area data is based on the DBH value for each tree life history stage (so seedlings aren't allowed). For density, the number of diameter values encountered is counted; for basal area, the individual basal areas calculated from DBH are totaled. All values are displayed in per hectare units. These values are broken up by size class as specified by the user. The average height of the tallest trees will also be included in the table if height was saved in the detailed output file.
This chart is different from other charts in that it displays data from all timesteps at once, instead of one timestep at a time. Thus, it tends to ignore normal chart drawing requests and has its own code to force parsing of all timestep files in a detailed output package at once.
Technically, density data could be extracted from any tree data member, since counting up the total is all that is required. I didn't do it that way because I'm a little lazy, and I'll wait for a hue and cry from the users before unnecessarily complicating my code.
Copyright: Copyright (c) Charles D. Canham 2003 Company: Cary Institute of Ecosystem Studies
Edit history:
---------------—
October 29, 2004: Created (LEM)
November 18, 2004: Updated for real-time data visualization (LEM)
June 14, 2005: Added mean DBH column (LEM)
March 23, 2006: Added species-specific tables (LEM)
February 21, 2011: Added split of snags and live trees (LEM)
August 31, 2011: Reconfigured to work with batch output (LEM)
sortie.datavisualizer.StandTableDataRequest.StandTableDataRequest | ( | DetailedOutputFileManager | oManager, |
String | sChartName, | ||
int | iTableType | ||
) |
Constructor.
Declares all the arrays.
oManager | Parent detailed output file manager |
sChartName | Name of the table being drawn. |
iTableType | Type of table, either density or basal area. The value must be either BASAL_AREA or DENSITY. |
void sortie.datavisualizer.StandTableDataRequest.actionPerformed | ( | ActionEvent | oEvent | ) |
Respons to the button clicks for this class's chart window.
oEvent | ActionEvent Event to process. |
void sortie.datavisualizer.StandTableDataRequest.addTreeFloatData | ( | int | iSpecies, |
int | iType, | ||
int | iCode, | ||
float | fVal, | ||
boolean | bBatchMode | ||
) |
Accepts a tree float data member value.
If it matches our code, we'll increment either the density count (if m_iTableType = DENSITY) or the basal area total.
iSpecies | Species of the tree from which this value came. |
iType | Type of the tree from which this value came. |
iCode | Data member code of this value. |
fVal | Value. |
bBatchMode | Whether not this is in the context of the batch utility. |
void sortie.datavisualizer.StandTableDataRequest.addTreeFloatDataMemberCode | ( | int | iSpecies, |
int | iType, | ||
String | sLabel, | ||
int | iCode | ||
) |
Accepts a tree float data member code.
We're looking for DBH and height.
iSpecies | The species for which this is a data member. |
iType | The tree type for which this is a data member. |
sLabel | The label of the data member. |
iCode | The data member code. |
|
private |
Creates the table for display.
|
private |
Declare arrays for holding data.
void sortie.datavisualizer.StandTableDataRequest.extractBatchSetupInfo | ( | ChartInfo | oInfo | ) | throws ModelException |
Extracts information needed by the data request from the controls panel displayed to the user.
oInfo | Object which contains the chart information. |
|
protected |
This writes the tables.
It forces the DetailedOutputFileManager to move through each timestep so the data can be collected. Then it formats the table into the chart window.
ModelException | if there is a problem parsing the data. |
|
static |
Makes the panel containing the size class and species controls.
This will change what is displayed based on whether this is meant for live interaction are in the context of batch output file extraction mode. If the action listener is null, this assumes batch extraction mode. In this case, the "Display" button and the species combo box will not appear.
ModelException | passing through from called functions; shouldn't ever be thrown. |
|
static |
This makes the size class panel using default values.
ModelException | passing through from called functions; shouldn't ever be thrown. |
|
private |
Makes a panel with a table for a species.
iSpecies | int iSpecies; if equal to m_iNumSpecies, shows the plot totals. |
sortie.data.simpletypes.ModelException | if there is an unrecognized species number |
void sortie.datavisualizer.StandTableDataRequest.outputFileParseFinished | ( | boolean | bBatchMode | ) |
This corrects basal area units after output file parsing is completed.
bBatchMode | Whether or not this is in the context of batch extraction mode. |
boolean sortie.datavisualizer.StandTableDataRequest.wantAnyTreeFloats | ( | ) |
This wants diameter values for all trees.
|
protected |
Saves the data in the current table as a tab-delimited text file.
jOut | java.io.FileWriter The file to write to. |
java.io.IOException | if there is a problem writing the file. |
|
static |
Basal area stand table.
|
static |
Density stand table.
|
staticprivate |
Whether to include live trees - default value.
|
static |
The name that is given to the check box for whether or not to include live trees in the control panel for this data request.
|
staticprivate |
Whether to include snags - default value.
|
static |
The name that is given to the check box for whether or not to include snags in the control panel for this data request.
|
private |
Whether or not the current processing was triggered by this object.
This lets this class know when to ignore offered data - whenever this value is set to false, some other chart event triggered the parse.
|
private |
So we can display the first time.
|
private |
Whether to include live trees.
|
private |
Whether to include snags.
|
private |
Area of the plot, in hectares.
|
private |
Size of DBH size classes, in cm.
|
private |
Number of DBH size classes to display in table.
|
private |
Number of total species.
|
private |
The total number of timesteps.
We keep track of this so we know if something has changed (as in real-time data visualization) so we can update appropriately.
|
private |
The type of table - either basal area or density.
The value is either BASAL_AREA or DENSITY.
|
private |
The legend for the detailed output file whose data goes in the table.
|
private |
Live tree BA totals (if needed) - species by timesteps by size classes.
|
private |
Live tree DBH totals, for mean DBH - species by timesteps.
|
private |
List of size class upper boundaries.
Sized m_iNumSizeClasses.
|
private |
Snag BA totals (if needed)) - species by timesteps by size classes.
|
private |
Snag DBH totals, for mean DBH - species by timesteps.
|
private |
Sorted list of the tallest trees: array 1 = species, array 2 = timesteps, array 3 = list of tree heights.
|
private |
Sorted list of the tallest trees: array 1 = species, array 2 = timesteps, array 3 = list of tree heights.
|
private |
Holds the data codes for DBH.
Array indexes are #1 - type and #2 - species.
|
private |
Holds the data codes for height.
Array indexes are #1 - type and #2 - species.
|
private |
Live tree counts - species by timesteps by size classes.
|
private |
Snag counts - species by timesteps by size classes.
|
private |
Column headers.
|
private |
The species names that will appear in the combo box.
|
staticprivate |
Default value for the number of size classes in the control box.
|
static |
The name that is given to the text field holding the number of size classes in the control panel for this data request.
|
static |
The name that is given to the control panel for this data request, which can be used with the named components finder to get access.
|
staticprivate |
Default value for the size of the size classes in the control box.
|
static |
The name that is given to the text field holding the size of size classes in the control panel for this data request.
|
static |
The name that is given to the species combo box in the control panel.