SORTIE Java Interface
1
|
This controls the drawing of a histogram for a single piece of information. More...
Public Member Functions | |
HistogramDataRequest (String sLabel, boolean bIsFloat, DetailedOutputFileManager oManager, String sGraphName, int iDeadCode) | |
Constructor. More... | |
void | timestepParseFinished (boolean bBatchMode) throws ModelException |
Adds the series to the dataset and makes values per-hectare. More... | |
void | actionPerformed (ActionEvent oEvent) |
Performs actions for the controls in the Histogram window. More... | |
float | getBinSize () |
Gets the bin size for this data request's histogram. More... | |
boolean | getUseLogarithmicAxis () |
Gets whether or not to use a logarithmic axis. More... | |
void | extractBatchSetupInfo (ChartInfo oInfo) throws ModelException |
Extracts information needed by the data request from the controls panel displayed to the user. More... | |
void | addTreeIntData (int iSpecies, int iType, int iCode, int iVal, boolean bBatchMode) |
This will add the integer data, if the data for this chart is an int that matches the data member code. More... | |
void | addDeadTreeIntData (int iSpecies, int iType, int iCode, int iDeadCode, int iVal, boolean bBatchMode) |
This will add the integer data, if the data for this chart is an int that matches the data member code. More... | |
void | addTreeIntDataMemberCode (int iSpecies, int iType, String sLabel, int iCode) |
If the label matches the one given in the constructor, and the data being histogrammed is an int, this captures the values passed. More... | |
void | getReadyForTimestepParse (int iTimestep, boolean bBatchMode) |
This nulls our dataset and recreates it, and clears all of our data vectors. More... | |
void | addTreeFloatData (int iSpecies, int iType, int iCode, float fVal, boolean bBatchMode) |
This will add the float data, if the data for this chart is a float that matches the data member code. More... | |
void | addDeadTreeFloatData (int iSpecies, int iType, int iCode, int iDeadCode, float fVal, boolean bBatchMode) |
Accepts a tree float data member value. More... | |
boolean | wantAnyTreeInts () |
If our data piece that's being graphed is an integer, this returns true. More... | |
boolean | wantAnyDeadTreeInts () |
If our data piece that's being graphed is an integer, this returns true. More... | |
boolean | wantAnyTreeFloats () |
If our data piece that's being graphed is a float, this returns true. More... | |
boolean | wantAnyDeadTreeFloats () |
If our data piece that's being graphed is a float, this returns true. More... | |
void | addTreeFloatDataMemberCode (int iSpecies, int iType, String sLabel, int iCode) |
If the label matches the one given in the constructor, and the data being histogrammed is a float, this captures the values passed. 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 | makeBatchControlsPanel () |
Makes the control panel to show while in batch mode. More... | |
Static Public Attributes | |
static final String | PANEL_NAME = "Histogram 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_BINS_NAME = "Number Bins" |
The name that is given to the text field holding the number of bins in the control panel for this data request. More... | |
static final String | BIN_SIZE_NAME = "Bin Size" |
The name that is given to the text field holding the size of bins in the control panel for this data request. More... | |
static final String | INCLUDE_SEEDLINGS_NAME = "Include Seedlings" |
The name that is given to the check box for whether or not to include seedlings in the control panel for this data request. More... | |
static final String | INCLUDE_SAPLINGS_NAME = "Include Saplings" |
The name that is given to the check box for whether or not to include saplings in the control panel for this data request. More... | |
static final String | INCLUDE_ADULTS_NAME = "Include Adults" |
The name that is given to the check box for whether or not to include adults 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... | |
Protected Member Functions | |
void | writeChartDataToFile (java.io.FileWriter jOut) throws java.io. IOException |
Writes the histogram's data to tab-delimited text. More... | |
ModelHistogramDataset | updateForVisible (Legend oLegend) throws ModelException |
Copies our dataset and includes only species marked as visible in the legend. More... | |
void | addSeriesToDataset () throws ModelException |
This will add all series to the dataset. 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... | |
Protected Attributes | |
ModelHistogramDataset | m_oDataset |
The dataset that will be graphed. More... | |
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... | |
Static Private Member Functions | |
static JPanel | makeTypeShowControls (ActionListener jListener, boolean bShowSeedling, boolean bShowSapling, boolean bShowAdult, boolean bShowSnag) |
Makes the panel with checkboxes for which life history stages to include. More... | |
Private Attributes | |
String | m_sLabel |
Data member's label, as it appears in the detailed output file. More... | |
boolean | m_bIsFloat |
Whether our data member being graphed is a float. More... | |
boolean | m_bIsInt |
Whether our data member being graphed is an integer. More... | |
boolean [] | mp_bInclude |
Whether to include each tree type. More... | |
JLabel | m_jMinDatasetValue = new JLabel("") |
Field displaying the minimum value for the dataset. More... | |
JLabel | m_jMaxDatasetValue = new JLabel("") |
Field displaying the maximum value for the dataset. More... | |
int [][] | mp_iDataMemberCodes |
The data member codes for this data member - one per species / type. More... | |
ArrayList< ArrayList< ArrayList< Number > > > | mp_oData |
The data - kept in an array of vectors - one per species, per type. More... | |
float | m_fPlotAreaInHectares |
Plot area in hectares. More... | |
float | m_fBinSize |
Size of the histogram bins. More... | |
float | m_fDatasetMin = java.lang.Float.POSITIVE_INFINITY |
Minimum dataset value. More... | |
float | m_fDatasetMax = java.lang.Float.NEGATIVE_INFINITY |
Maximum dataset value. More... | |
NumberFormat | m_jFormat = NumberFormat.getInstance() |
int | m_iNumBins |
Number of bins in the histogram. More... | |
int | m_iDeadCode |
Dead code for trees (including NOTDEAD). More... | |
boolean | m_bUseLogarithmicAxis |
Whether or not to use a logarithmic axis on the Y. More... | |
boolean | m_bRecalcBinsOnUpdate |
Whether or not we have to recalculate the bins on chart update (i.e. More... | |
boolean | m_bShowTotal = true |
Whether or not to display a total bar in each bin. More... | |
Static Private Attributes | |
static int | NUMBER_BINS_DEFAULT = 10 |
Default value for number of bins. More... | |
static double | BIN_SIZE_DEFAULT = 0 |
Default value for bin size. More... | |
static boolean | INCLUDE_SEEDLINGS_DEFAULT = true |
static boolean | INCLUDE_SAPLINGS_DEFAULT = true |
static boolean | INCLUDE_ADULTS_DEFAULT = true |
static boolean | INCLUDE_SNAGS_DEFAULT = true |
This controls the drawing of a histogram for a single piece of information.
The label of the data is passed in the constructor. The histogram is defaulted to 10 divisions equally divided between their minimum and maximum values. This can graph either live or dead tree data values.
Copyright: Copyright (c) Charles D. Canham 2012 Company: Cary Institute of Ecosystem Studies
Edit history:
---------------—
December 8, 2011: Wiped the slate clean for version 7 (LEM)
sortie.datavisualizer.HistogramDataRequest.HistogramDataRequest | ( | String | sLabel, |
boolean | bIsFloat, | ||
DetailedOutputFileManager | oManager, | ||
String | sGraphName, | ||
int | iDeadCode | ||
) |
Constructor.
sLabel | Label of the piece of data, as it would be passed as a data member code. |
bIsFloat | Whether this is float data. If this is set to false, integer data is assumed. |
oManager | The parent detailed output file manager. |
sGraphName | Name of graph string. |
iDeadCode | Dead code for trees (including NOTDEAD). |
void sortie.datavisualizer.HistogramDataRequest.actionPerformed | ( | ActionEvent | oEvent | ) |
Performs actions for the controls in the Histogram window.
oEvent | Event triggered. |
void sortie.datavisualizer.HistogramDataRequest.addDeadTreeFloatData | ( | int | iSpecies, |
int | iType, | ||
int | iCode, | ||
int | iDeadCode, | ||
float | fVal, | ||
boolean | bBatchMode | ||
) |
Accepts a tree float data member value.
If it matches our code, we'll increment either the count or the total, depending on the chart type.
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. |
iDeadCode | Dead code for tree type. |
fVal | Value. |
bBatchMode | Whether not this is in the context of the batch utility. |
void sortie.datavisualizer.HistogramDataRequest.addDeadTreeIntData | ( | int | iSpecies, |
int | iType, | ||
int | iCode, | ||
int | iDeadCode, | ||
int | iVal, | ||
boolean | bBatchMode | ||
) |
This will add the integer data, if the data for this chart is an int that matches the data member code.
iSpecies | Species for this data. |
iType | Type for this data. We don't care, other than for matching codes. |
iCode | Data member code. |
iDeadCode | Dead code for tree type. |
iVal | Value. |
bBatchMode | Whether not this is in the context of the batch utility. |
|
protected |
This will add all series to the dataset.
ModelException | Passing through from underlying |
void sortie.datavisualizer.HistogramDataRequest.addTreeFloatData | ( | int | iSpecies, |
int | iType, | ||
int | iCode, | ||
float | fVal, | ||
boolean | bBatchMode | ||
) |
This will add the float data, if the data for this chart is a float that matches the data member code.
iSpecies | Species for this data. |
iType | Type for this data. We don't care, other than for matching codes. |
iCode | Data member code. |
fVal | Value. |
bBatchMode | Whether not this is in the context of the batch utility. |
void sortie.datavisualizer.HistogramDataRequest.addTreeFloatDataMemberCode | ( | int | iSpecies, |
int | iType, | ||
String | sLabel, | ||
int | iCode | ||
) |
If the label matches the one given in the constructor, and the data being histogrammed is a float, this captures the values passed.
iSpecies | Species for this data member |
iType | Type for this data member |
sLabel | Data member label. |
iCode | Data member code. |
void sortie.datavisualizer.HistogramDataRequest.addTreeIntData | ( | int | iSpecies, |
int | iType, | ||
int | iCode, | ||
int | iVal, | ||
boolean | bBatchMode | ||
) |
This will add the integer data, if the data for this chart is an int that matches the data member code.
iSpecies | Species for this data. |
iType | Type for this data. We don't care, other than for matching codes. |
iCode | Data member code. |
iVal | Value. |
bBatchMode | Whether not this is in the context of the batch utility. |
void sortie.datavisualizer.HistogramDataRequest.addTreeIntDataMemberCode | ( | int | iSpecies, |
int | iType, | ||
String | sLabel, | ||
int | iCode | ||
) |
If the label matches the one given in the constructor, and the data being histogrammed is an int, this captures the values passed.
iSpecies | Species for this data member |
iType | Type for this data member |
sLabel | Data member label. |
iCode | Data member code. |
void sortie.datavisualizer.HistogramDataRequest.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. |
float sortie.datavisualizer.HistogramDataRequest.getBinSize | ( | ) |
Gets the bin size for this data request's histogram.
void sortie.datavisualizer.HistogramDataRequest.getReadyForTimestepParse | ( | int | iTimestep, |
boolean | bBatchMode | ||
) |
This nulls our dataset and recreates it, and clears all of our data vectors.
boolean sortie.datavisualizer.HistogramDataRequest.getUseLogarithmicAxis | ( | ) |
Gets whether or not to use a logarithmic axis.
|
static |
Makes the control panel to show while in batch mode.
|
staticprivate |
Makes the panel with checkboxes for which life history stages to include.
jListener | Action listener to respond to check events. Can be null. |
bShowSeedling | Whether to show seedlings. |
bShowSapling | Whether to show saplings. |
bShowAdult | Whether to show adults. |
bShowSnag | Whether to show snags. |
void sortie.datavisualizer.HistogramDataRequest.timestepParseFinished | ( | boolean | bBatchMode | ) | throws ModelException |
Adds the series to the dataset and makes values per-hectare.
bBatchMode | Whether or not this is batch mode. |
|
protected |
Copies our dataset and includes only species marked as visible in the legend.
oLegend | Legend for this chart. |
ModelException | Passing through an underlying exception. |
boolean sortie.datavisualizer.HistogramDataRequest.wantAnyDeadTreeFloats | ( | ) |
If our data piece that's being graphed is a float, this returns true.
Otherwise, false.
boolean sortie.datavisualizer.HistogramDataRequest.wantAnyDeadTreeInts | ( | ) |
If our data piece that's being graphed is an integer, this returns true.
Otherwise, false.
boolean sortie.datavisualizer.HistogramDataRequest.wantAnyTreeFloats | ( | ) |
If our data piece that's being graphed is a float, this returns true.
Otherwise, false.
boolean sortie.datavisualizer.HistogramDataRequest.wantAnyTreeInts | ( | ) |
If our data piece that's being graphed is an integer, this returns true.
Otherwise, false.
|
protected |
Writes the histogram's data to tab-delimited text.
jOut | java.io.FileWriter The file to write to. |
java.io.IOException | if there's a problem writing the file. |
|
staticprivate |
Default value for bin size.
|
static |
The name that is given to the text field holding the size of bins in the control panel for this data request.
|
staticprivate |
|
static |
The name that is given to the check box for whether or not to include adults in the control panel for this data request.
|
staticprivate |
|
static |
The name that is given to the check box for whether or not to include saplings in the control panel for this data request.
|
staticprivate |
|
static |
The name that is given to the check box for whether or not to include seedlings in the control panel for this data request.
|
staticprivate |
|
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 our data member being graphed is a float.
|
private |
Whether our data member being graphed is an integer.
|
private |
Whether or not we have to recalculate the bins on chart update (i.e.
we are charting an unknown data type without defaults)
|
private |
Whether or not to display a total bar in each bin.
|
private |
Whether or not to use a logarithmic axis on the Y.
|
private |
Size of the histogram bins.
|
private |
Maximum dataset value.
|
private |
Minimum dataset value.
|
private |
Plot area in hectares.
|
private |
Dead code for trees (including NOTDEAD).
|
private |
Number of bins in the histogram.
|
private |
|
private |
Field displaying the maximum value for the dataset.
|
private |
Field displaying the minimum value for the dataset.
|
protected |
The dataset that will be graphed.
|
private |
Data member's label, as it appears in the detailed output file.
|
private |
Whether to include each tree type.
|
private |
The data member codes for this data member - one per species / type.
|
private |
The data - kept in an array of vectors - one per species, per type.
|
staticprivate |
Default value for number of bins.
|
static |
The name that is given to the text field holding the number of bins 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.