SORTIE Java Interface
1
|
This class will write a complete tree list for any desired time step. More...
Public Member Functions | |
TreeListWriter (String chartName, DetailedOutputFileManager manager) | |
void | actionPerformed (java.awt.event.ActionEvent oEvent) |
Respons to the button clicks for this class's chart window. More... | |
void | endTree (boolean bBatchMode) throws SAXException |
Writes out the accumulated tree data and resets it. More... | |
void | timestepParseFinished (boolean bBatchMode) throws ModelException |
void | getReadyForTimestepParse (int iTimestep, boolean bBatchMode) throws ModelException |
boolean | wantAnyTreeFloats () |
This object always wants tree float data members. More... | |
boolean | wantAnyTreeInts () |
This object always wants tree int data members. More... | |
boolean | wantAnyTreeChars () |
This object always wants tree char data members. More... | |
boolean | wantAnyTreeBools () |
This object always wants tree bool data members. More... | |
boolean | wantAnyDeadTreeFloats () |
This object always wants dead tree float data members. More... | |
boolean | wantAnyDeadTreeInts () |
This object always wants dead tree int data members. More... | |
boolean | wantAnyDeadTreeChars () |
This object always wants dead tree char data members. More... | |
boolean | wantAnyDeadTreeBools () |
This object always wants dead tree bool data members. More... | |
void | addTreeFloatData (int iSpecies, int iType, int iCode, float fVal, boolean bBatchMode) |
Accepts a piece of tree float data from the parser. More... | |
void | addTreeIntData (int iSpecies, int iType, int iCode, int iVal, boolean bBatchMode) |
Accepts a piece of tree int data from the parser. More... | |
void | addTreeCharData (int iSpecies, int iType, int iCode, String sVal, boolean bBatchMode) |
Accepts a piece of tree char data from the parser. More... | |
void | addTreeBoolData (int iSpecies, int iType, int iCode, boolean bVal, boolean bBatchMode) |
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) |
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) |
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) |
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) |
Accepts a piece of dead tree bool data from the parser. 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... | |
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... | |
Protected Member Functions | |
void | writeChartDataToFile (FileWriter out) throws IOException, ModelException |
Does nothing. 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 | writeTrees (int iTimestep) |
Writes the trees for a time step to file. More... | |
void | addDataToFileRow (int iSpecies, int iType, int iDeadCode, int iPos, String sVal) |
Adds a piece of tree data to the file row currently being built. More... | |
int | getCodeForDataMember (int iDataType, int iSpecies, int iType, String sLabel) throws SAXException |
Get the code for a particular data member label. More... | |
Private Attributes | |
JTextField | m_jOutputFileName = new JTextField() |
Field for output filename. More... | |
JTextField | m_jTimestep = new JTextField() |
Field for timestep to save. More... | |
FileWriter | m_jOut |
Text output file. More... | |
String [] | mp_sTypeNames = new String[TreePopulation.getNumberOfTypes()] |
String [] | mp_sDeadCodeNames = new String[OutputBehaviors.NUMCODES] |
Make our own copy because the one in DetailedOutputFileManager omits not dead. More... | |
ArrayList< ArrayList< ArrayList< Integer > > > | mp_iTreeIntTransforms |
Column positions for tree integer data members. More... | |
boolean | m_bCurrentProcessing = false |
Whether or not the current processing was triggered by this object. More... | |
String [] | mp_sColumnsByCode |
The columns in our output text file. More... | |
String [] | mp_sColumnHeader |
The header row for the output text file. More... | |
String [] | mp_sFileRow |
One tree's worth of data. More... | |
int | m_iSpeciesIndex = 0 |
int | m_iTypeIndex = 1 |
int | m_iDeadCodeIndex = 2 |
int | m_iTreeSpecies |
int | m_iTreeType |
int | m_iTreeDeadCode |
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... | |
This class will write a complete tree list for any desired time step.
Edit history:
--------------—
March 24, 2011: Created (LEM)
sortie.datavisualizer.TreeListWriter.TreeListWriter | ( | String | chartName, |
DetailedOutputFileManager | manager | ||
) |
void sortie.datavisualizer.TreeListWriter.actionPerformed | ( | java.awt.event.ActionEvent | oEvent | ) |
Respons to the button clicks for this class's chart window.
oEvent | ActionEvent Event to process. |
|
private |
Adds a piece of tree data to the file row currently being built.
iSpecies | Species number. |
iType | Type number. |
iDeadCode | Dead code reason number. |
iPos | Column position number. |
sVal | Value for the column. |
void sortie.datavisualizer.TreeListWriter.addDeadTreeBoolData | ( | int | iSpecies, |
int | iType, | ||
int | iCode, | ||
int | iDeadCode, | ||
boolean | bVal, | ||
boolean | bBatchMode | ||
) |
Accepts a piece of dead tree bool data from the parser.
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 this tree. |
bVal | Value. |
bBatchMode | Whether not this is in the context of the batch utility. |
void sortie.datavisualizer.TreeListWriter.addDeadTreeCharData | ( | int | iSpecies, |
int | iType, | ||
int | iCode, | ||
int | iDeadCode, | ||
String | sVal, | ||
boolean | bBatchMode | ||
) |
Accepts a piece of dead tree char data from the parser.
If this particular piece is not wanted, do nothing.
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 this tree. |
sVal | Value. |
bBatchMode | Whether not this is in the context of the batch utility. |
void sortie.datavisualizer.TreeListWriter.addDeadTreeFloatData | ( | int | iSpecies, |
int | iType, | ||
int | iCode, | ||
int | iDeadCode, | ||
float | fVal, | ||
boolean | bBatchMode | ||
) |
Accepts a piece of dead tree float data from the parser.
If this particular piece is not wanted, do nothing.
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 this tree. |
fVal | Value. |
bBatchMode | Whether not this is in the context of the batch utility. |
void sortie.datavisualizer.TreeListWriter.addDeadTreeIntData | ( | int | iSpecies, |
int | iType, | ||
int | iCode, | ||
int | iDeadCode, | ||
int | iVal, | ||
boolean | bBatchMode | ||
) |
Accepts a piece of dead tree int data from the parser.
If this particular piece is not wanted, do nothing.
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 this tree. |
iVal | Value. |
bBatchMode | Whether not this is in the context of the batch utility. |
void sortie.datavisualizer.TreeListWriter.addTreeBoolData | ( | int | iSpecies, |
int | iType, | ||
int | iCode, | ||
boolean | bVal, | ||
boolean | bBatchMode | ||
) |
Accepts a piece of tree bool data from the parser.
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. |
bVal | Value. |
bBatchMode | Whether not this is in the context of the batch utility. |
void sortie.datavisualizer.TreeListWriter.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.
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. |
void sortie.datavisualizer.TreeListWriter.addTreeCharData | ( | int | iSpecies, |
int | iType, | ||
int | iCode, | ||
String | sVal, | ||
boolean | bBatchMode | ||
) |
Accepts a piece of tree char data from the parser.
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. |
sVal | Value. |
bBatchMode | Whether not this is in the context of the batch utility. |
void sortie.datavisualizer.TreeListWriter.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.
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. |
void sortie.datavisualizer.TreeListWriter.addTreeFloatData | ( | int | iSpecies, |
int | iType, | ||
int | iCode, | ||
float | fVal, | ||
boolean | bBatchMode | ||
) |
Accepts a piece of tree float data from the parser.
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.TreeListWriter.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.
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. |
void sortie.datavisualizer.TreeListWriter.addTreeIntData | ( | int | iSpecies, |
int | iType, | ||
int | iCode, | ||
int | iVal, | ||
boolean | bBatchMode | ||
) |
Accepts a piece of tree int data from the parser.
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. |
iVal | Value. |
bBatchMode | Whether not this is in the context of the batch utility. |
void sortie.datavisualizer.TreeListWriter.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.
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. |
void sortie.datavisualizer.TreeListWriter.endTree | ( | boolean | bBatchMode | ) | throws SAXException |
Writes out the accumulated tree data and resets it.
bBatchMode | Whether not this is in the context of the batch utility. |
|
private |
Get the code for a particular data member label.
iDataType | One of the data type statics from DataMember |
iSpecies | Tree species |
iType | Tree type |
sLabel | Tree data member label |
ModelException | If settings for the tree type and species cannot be found, or if the data type is invalid |
void sortie.datavisualizer.TreeListWriter.getReadyForTimestepParse | ( | int | iTimestep, |
boolean | bBatchMode | ||
) | throws ModelException |
void sortie.datavisualizer.TreeListWriter.timestepParseFinished | ( | boolean | bBatchMode | ) | throws ModelException |
boolean sortie.datavisualizer.TreeListWriter.wantAnyDeadTreeBools | ( | ) |
This object always wants dead tree bool data members.
boolean sortie.datavisualizer.TreeListWriter.wantAnyDeadTreeChars | ( | ) |
This object always wants dead tree char data members.
boolean sortie.datavisualizer.TreeListWriter.wantAnyDeadTreeFloats | ( | ) |
This object always wants dead tree float data members.
boolean sortie.datavisualizer.TreeListWriter.wantAnyDeadTreeInts | ( | ) |
This object always wants dead tree int data members.
boolean sortie.datavisualizer.TreeListWriter.wantAnyTreeBools | ( | ) |
This object always wants tree bool data members.
boolean sortie.datavisualizer.TreeListWriter.wantAnyTreeChars | ( | ) |
This object always wants tree char data members.
boolean sortie.datavisualizer.TreeListWriter.wantAnyTreeFloats | ( | ) |
This object always wants tree float data members.
boolean sortie.datavisualizer.TreeListWriter.wantAnyTreeInts | ( | ) |
This object always wants tree int data members.
|
protected |
Does nothing.
|
private |
Writes the trees for a time step to file.
This will set up the infrastructure for the file, and parse the output file.
|
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 |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Text output file.
|
private |
Field for output filename.
|
private |
Field for timestep to save.
|
private |
Column positions for tree integer data members.
First index is species, second is type. Vector position equals the data member position in the map being read, and vector value is the position in the column of the file being written.
|
private |
The header row for the output text file.
|
private |
The columns in our output text file.
The columns will depend on the data members available in the tree map of the output file. This is a unique list of the code names of all available tree data members.
|
private |
Make our own copy because the one in DetailedOutputFileManager omits not dead.
|
private |
One tree's worth of data.
One space for each column in the output text file, even if they will not all be used.
|
private |