Public Member Functions | |
StandTableDataRequest (DetailedOutputFileManager oManager, String sChartName, int iTableType) | |
Constructor. | |
void | actionPerformed (java.awt.event.ActionEvent oEvent) |
Respons to the button clicks for this class's chart window. | |
boolean | WantAnyTreeFloats () |
This wants diameter values for all trees. | |
void | AddTreeFloatDataMemberCode (int iSpecies, int iType, String sLabel, int iCode) |
Accepts a tree float data member code. | |
void | AddTreeFloatData (int iSpecies, int iType, int iCode, float fVal) |
Accepts a tree float data member value. | |
Static Public Attributes | |
static final int | BASAL_AREA = 1 |
Basal area stand table. | |
static final int | DENSITY = 2 |
Density stand table. | |
Protected Member Functions | |
void | GetDataAndMakeTables () throws javawrapper.ModelException |
This writes the tables. | |
void | WriteChartDataToFile (java.io.FileWriter jOut) throws java.io. IOException |
Saves the data in the current table as a tab-delimited text file. | |
Package Functions | |
void | UpdateChart (Legend oLegend) throws javawrapper.ModelException |
Does nothing unless the number of timesteps is different, in which case the table is recreated. | |
ModelInternalFrame | DrawChart (Legend oLegend, String sChartTitle) throws javawrapper.ModelException |
Draws the table. | |
void | ClearData () throws javawrapper.ModelException |
Does nothing, because this table doesn't operate on the detailed output file timescale. | |
Private Member Functions | |
Object[][] | CreateTable (int iSpecies) |
Creates the table for display. | |
JPanel | MakeTablePanel (int iSpecies) throws javawrapper.ModelException |
Makes a panel with a table for a species. | |
JPanel | MakeSizeClassPanel () throws javawrapper.ModelException |
Makes the panel containing the size class and species controls. | |
Private Attributes | |
DetailedOutputLegend | m_oLegend = null |
The legend for the detailed output file whose data goes in the table. | |
double[][][] | mp_fLiveTreeBATotals = null |
Live tree BA totals (if needed) - species by timesteps by size classes. | |
double[][][] | mp_fSnagBATotals = null |
Snag BA totals (if needed)) - species by timesteps by size classes. | |
long[][][] | mp_iLiveTreeCounts = null |
Live tree counts - species by timesteps by size classes. | |
long[][][] | mp_iSnagCounts = null |
Snag counts - species by timesteps by size classes. | |
double[][] | mp_fLiveTreeDBHTotal |
Live tree DBH totals, for mean DBH - species by timesteps. | |
double[][] | mp_fSnagDBHTotal |
Snag DBH totals, for mean DBH - species by timesteps. | |
float[][][] | mp_fTallestLiveTrees |
Sorted list of the tallest trees: array 1 = species, array 2 = timesteps, array 3 = list of tree heights. | |
float[][][] | mp_fTallestSnags |
Sorted list of the tallest trees: array 1 = species, array 2 = timesteps, array 3 = list of tree heights. | |
int[][] | mp_iDbhCode |
Holds the data codes for DBH. | |
int[][] | mp_iHeightCode |
Holds the data codes for height. | |
JComboBox | m_jSpeciesBox |
Box that holds our species list. | |
String[] | mp_sHeaders |
Column headers. | |
JTextField | m_jNumSizeClasses = new JTextField("10") |
Field displaying the number of bins in the histogram. | |
JTextField | m_jSizeClassSize = new JTextField("5.0") |
Field displaying the bin size in the histogram. | |
float[] | mp_fSizeClasses |
List of size class upper boundaries. | |
float | m_fPlotAreaInHectares |
Area of the plot, in hectares. | |
float | m_fSizeClassSize = (float) 5.0 |
Size of DBH size classes, in cm. | |
int | m_iNumSpecies |
Number of total species. | |
int | m_iNumSizeClasses = 10 |
Number of DBH size classes to display in table. | |
int | m_iCurrentTimestep = -1 |
The current timestep. | |
int | m_iNumTimesteps = -1 |
The total number of timesteps. | |
int | m_iTableType |
The type of table - either basal area or density. | |
boolean | m_bFirstTime = true |
So we can display the first time. | |
boolean | m_bIncludeLive = true |
Whether to include live trees. | |
boolean | m_bIncludeSnags = true |
Whether to include snags. |
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: Institute of Ecosystem Studies
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 datavisualizer.StandTableDataRequest.actionPerformed | ( | java.awt.event.ActionEvent | oEvent | ) |
Respons to the button clicks for this class's chart window.
oEvent | ActionEvent Event to process. |
Reimplemented from datavisualizer.DataRequest.
void datavisualizer.StandTableDataRequest.GetDataAndMakeTables | ( | ) | throws javawrapper.ModelException [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. |
Object [][] datavisualizer.StandTableDataRequest.CreateTable | ( | int | iSpecies | ) | [private] |
Creates the table for display.
JPanel datavisualizer.StandTableDataRequest.MakeTablePanel | ( | int | iSpecies | ) | throws javawrapper.ModelException [private] |
Makes a panel with a table for a species.
iSpecies | int iSpecies; if equal to m_iNumSpecies, shows the plot totals. |
javawrapper.ModelException | if there is an unrecognized species number |
void datavisualizer.StandTableDataRequest.UpdateChart | ( | Legend | oLegend | ) | throws javawrapper.ModelException [package, virtual] |
Does nothing unless the number of timesteps is different, in which case the table is recreated.
This chart does not respond to regular chart update events, since it already shows data for all timesteps.
oLegend | Legend The legend for this chart. |
ModelException | Won't be thrown. |
Implements datavisualizer.DataRequest.
void datavisualizer.StandTableDataRequest.WriteChartDataToFile | ( | java.io.FileWriter | jOut | ) | throws java.io. IOException [protected, virtual] |
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. |
Implements datavisualizer.DataRequest.
ModelInternalFrame datavisualizer.StandTableDataRequest.DrawChart | ( | Legend | oLegend, | |
String | sChartTitle | |||
) | throws javawrapper.ModelException [package, virtual] |
Draws the table.
Initially, there will be no table; just a place for a user to enter size class information.
oLegend | Legend Legend for this chart. | |
sChartTitle | String Chart name for the window title. |
ModelException | Passed through from other called methods - this method doesn't throw it. |
Implements datavisualizer.DataRequest.
void datavisualizer.StandTableDataRequest.ClearData | ( | ) | throws javawrapper.ModelException [package, virtual] |
Does nothing, because this table doesn't operate on the detailed output file timescale.
ModelException | Won't throw it. |
Implements datavisualizer.DataRequest.
JPanel datavisualizer.StandTableDataRequest.MakeSizeClassPanel | ( | ) | throws javawrapper.ModelException [private] |
Makes the panel containing the size class and species controls.
javawrapper.ModelException | passing through from called functions; shouldn't ever be thrown. |
boolean datavisualizer.StandTableDataRequest.WantAnyTreeFloats | ( | ) |
This wants diameter values for all trees.
Reimplemented from datavisualizer.DataRequest.
void 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. |
Reimplemented from datavisualizer.DataRequest.
void datavisualizer.StandTableDataRequest.AddTreeFloatData | ( | int | iSpecies, | |
int | iType, | |||
int | iCode, | |||
float | fVal | |||
) |
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. |
Reimplemented from datavisualizer.DataRequest.
final int datavisualizer.StandTableDataRequest.BASAL_AREA = 1 [static] |
Basal area stand table.
final int datavisualizer.StandTableDataRequest.DENSITY = 2 [static] |
Density stand table.
DetailedOutputLegend datavisualizer.StandTableDataRequest.m_oLegend = null [private] |
The legend for the detailed output file whose data goes in the table.
double [][][] datavisualizer.StandTableDataRequest.mp_fLiveTreeBATotals = null [private] |
Live tree BA totals (if needed) - species by timesteps by size classes.
double [][][] datavisualizer.StandTableDataRequest.mp_fSnagBATotals = null [private] |
Snag BA totals (if needed)) - species by timesteps by size classes.
long [][][] datavisualizer.StandTableDataRequest.mp_iLiveTreeCounts = null [private] |
Live tree counts - species by timesteps by size classes.
long [][][] datavisualizer.StandTableDataRequest.mp_iSnagCounts = null [private] |
Snag counts - species by timesteps by size classes.
double [][] datavisualizer.StandTableDataRequest.mp_fLiveTreeDBHTotal [private] |
Live tree DBH totals, for mean DBH - species by timesteps.
double [][] datavisualizer.StandTableDataRequest.mp_fSnagDBHTotal [private] |
Snag DBH totals, for mean DBH - species by timesteps.
float [][][] datavisualizer.StandTableDataRequest.mp_fTallestLiveTrees [private] |
Sorted list of the tallest trees: array 1 = species, array 2 = timesteps, array 3 = list of tree heights.
float [][][] datavisualizer.StandTableDataRequest.mp_fTallestSnags [private] |
Sorted list of the tallest trees: array 1 = species, array 2 = timesteps, array 3 = list of tree heights.
int [][] datavisualizer.StandTableDataRequest.mp_iDbhCode [private] |
Holds the data codes for DBH.
Array indexes are #1 - type and #2 - species.
int [][] datavisualizer.StandTableDataRequest.mp_iHeightCode [private] |
Holds the data codes for height.
Array indexes are #1 - type and #2 - species.
JComboBox datavisualizer.StandTableDataRequest.m_jSpeciesBox [private] |
Box that holds our species list.
String [] datavisualizer.StandTableDataRequest.mp_sHeaders [private] |
Column headers.
JTextField datavisualizer.StandTableDataRequest.m_jNumSizeClasses = new JTextField("10") [private] |
Field displaying the number of bins in the histogram.
JTextField datavisualizer.StandTableDataRequest.m_jSizeClassSize = new JTextField("5.0") [private] |
Field displaying the bin size in the histogram.
float [] datavisualizer.StandTableDataRequest.mp_fSizeClasses [private] |
List of size class upper boundaries.
Sized m_iNumSizeClasses.
float datavisualizer.StandTableDataRequest.m_fPlotAreaInHectares [private] |
Area of the plot, in hectares.
float datavisualizer.StandTableDataRequest.m_fSizeClassSize = (float) 5.0 [private] |
Size of DBH size classes, in cm.
int datavisualizer.StandTableDataRequest.m_iNumSpecies [private] |
Number of total species.
int datavisualizer.StandTableDataRequest.m_iNumSizeClasses = 10 [private] |
Number of DBH size classes to display in table.
int datavisualizer.StandTableDataRequest.m_iCurrentTimestep = -1 [private] |
The current timestep.
This helps process an entire detailed output file. It also lets this class know when to ignore offered data - whenever this value is set to -1, some other chart event triggered the parse.
Reimplemented from datavisualizer.DataRequest.
int datavisualizer.StandTableDataRequest.m_iNumTimesteps = -1 [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.
int datavisualizer.StandTableDataRequest.m_iTableType [private] |
The type of table - either basal area or density.
The value is either BASAL_AREA or DENSITY.
boolean datavisualizer.StandTableDataRequest.m_bFirstTime = true [private] |
So we can display the first time.
boolean datavisualizer.StandTableDataRequest.m_bIncludeLive = true [private] |
Whether to include live trees.
boolean datavisualizer.StandTableDataRequest.m_bIncludeSnags = true [private] |
Whether to include snags.