datavisualizer.TreeListWriter Class Reference

This class will write a complete tree list for any desired time step. More...

Inheritance diagram for datavisualizer.TreeListWriter:

datavisualizer.DataRequest

List of all members.

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.
void EndTree () throws SAXException
 Writes out the accumulated tree data and resets it.
boolean WantAnyTreeFloats ()
 This object always wants tree float data members.
boolean WantAnyTreeInts ()
 This object always wants tree int data members.
boolean WantAnyTreeChars ()
 This object always wants tree char data members.
boolean WantAnyTreeBools ()
 This object always wants tree bool data members.
boolean WantAnyDeadTreeFloats ()
 This object always wants dead tree float data members.
boolean WantAnyDeadTreeInts ()
 This object always wants dead tree int data members.
boolean WantAnyDeadTreeChars ()
 This object always wants dead tree char data members.
boolean WantAnyDeadTreeBools ()
 This object always wants dead tree bool data members.
void AddTreeFloatData (int iSpecies, int iType, int iCode, float fVal)
 Accepts a piece of tree float data from the parser.
void AddTreeIntData (int iSpecies, int iType, int iCode, int iVal)
 Accepts a piece of tree int data from the parser.
void AddTreeCharData (int iSpecies, int iType, int iCode, String sVal)
 Accepts a piece of tree char data from the parser.
void AddTreeBoolData (int iSpecies, int iType, int iCode, boolean bVal)
 Accepts a piece of tree bool data from the parser.
void AddDeadTreeFloatData (int iSpecies, int iType, int iCode, int iDeadCode, float fVal)
 Accepts a piece of dead tree float data from the parser.
void AddDeadTreeIntData (int iSpecies, int iType, int iCode, int iDeadCode, int iVal)
 Accepts a piece of dead tree int data from the parser.
void AddDeadTreeCharData (int iSpecies, int iType, int iCode, int iDeadCode, String sVal)
 Accepts a piece of dead tree char data from the parser.
void AddDeadTreeBoolData (int iSpecies, int iType, int iCode, int iDeadCode, boolean bVal)
 Accepts a piece of dead tree bool data from the parser.
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.
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.
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.
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.

Protected Member Functions

void WriteChartDataToFile (FileWriter out) throws IOException, ModelException
 Does nothing.

Package Functions

void ClearData () throws ModelException
 Does nothing.
ModelInternalFrame DrawChart (Legend oLegend, String sChartTitle) throws javawrapper.ModelException
 Draws the panel allowing the user to select a timestep to save.
void UpdateChart (Legend legend) throws ModelException
 Does nothing.

Private Member Functions

void WriteTrees (int iTimestep)
 Writes the trees for a time step to file.
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.
int GetCodeForDataMember (int iDataType, int iSpecies, int iType, String sLabel) throws SAXException
 Get the code for a particular data member label.

Private Attributes

JTextField m_jOutputFileName = new JTextField()
 Field for output filename.
JTextField m_jTimestep = new JTextField()
 Field for timestep to save.
java.io.FileWriter m_jOut
 Text output file.
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.
Vector< Vector< Vector
< Integer > > > 
mp_iTreeIntTransforms
 Column positions for tree integer data members.
Vector< Vector< Vector
< Integer > > > 
mp_iTreeFloatTransforms
 Column positions for tree float data members.
Vector< Vector< Vector
< Integer > > > 
mp_iTreeCharTransforms
 Column positions for tree char data members.
Vector< Vector< Vector
< Integer > > > 
mp_iTreeBoolTransforms
 Column positions for tree bool data members.
int m_iCurrentTimestep = -1
 The current timestep.
String[] mp_sColumnsByCode
 The columns in our output text file.
String[] mp_sFileRow
 One tree's worth of data.
int m_iSpeciesIndex = 0
int m_iTypeIndex = 1
int m_iDeadCodeIndex = 2
int m_iTreeSpecies
int m_iTreeType
int m_iTreeDeadCode


Detailed Description

This class will write a complete tree list for any desired time step.

Author:
Lora E. Murphy
Version:
1.0
Edit history:
-----------------
March 24, 2011: Created (LEM)

Constructor & Destructor Documentation

datavisualizer.TreeListWriter.TreeListWriter ( String  chartName,
DetailedOutputFileManager  manager 
)


Member Function Documentation

void datavisualizer.TreeListWriter.ClearData (  )  throws ModelException [package, virtual]

Does nothing.

Implements datavisualizer.DataRequest.

void datavisualizer.TreeListWriter.actionPerformed ( java.awt.event.ActionEvent  oEvent  ) 

Respons to the button clicks for this class's chart window.

Parameters:
oEvent ActionEvent Event to process.

Reimplemented from datavisualizer.DataRequest.

void datavisualizer.TreeListWriter.WriteTrees ( int  iTimestep  )  [private]

Writes the trees for a time step to file.

This will set up the infrastructure for the file, and parse the output file.

void datavisualizer.TreeListWriter.EndTree (  )  throws SAXException

Writes out the accumulated tree data and resets it.

Reimplemented from datavisualizer.DataRequest.

ModelInternalFrame datavisualizer.TreeListWriter.DrawChart ( Legend  oLegend,
String  sChartTitle 
) throws javawrapper.ModelException [package, virtual]

Draws the panel allowing the user to select a timestep to save.

Parameters:
oLegend Legend Legend for this chart.
sChartTitle String Chart name for the window title.
Exceptions:
ModelException Passed through from other called methods - this method doesn't throw it.
Returns:
JInternalFrame The finished chart window.

Implements datavisualizer.DataRequest.

void datavisualizer.TreeListWriter.UpdateChart ( Legend  legend  )  throws ModelException [package, virtual]

Does nothing.

Implements datavisualizer.DataRequest.

void datavisualizer.TreeListWriter.WriteChartDataToFile ( FileWriter  out  )  throws IOException, ModelException [protected]

Does nothing.

boolean datavisualizer.TreeListWriter.WantAnyTreeFloats (  ) 

This object always wants tree float data members.

Returns:
True

Reimplemented from datavisualizer.DataRequest.

boolean datavisualizer.TreeListWriter.WantAnyTreeInts (  ) 

This object always wants tree int data members.

Returns:
True

Reimplemented from datavisualizer.DataRequest.

boolean datavisualizer.TreeListWriter.WantAnyTreeChars (  ) 

This object always wants tree char data members.

Returns:
True

Reimplemented from datavisualizer.DataRequest.

boolean datavisualizer.TreeListWriter.WantAnyTreeBools (  ) 

This object always wants tree bool data members.

Returns:
True

Reimplemented from datavisualizer.DataRequest.

boolean datavisualizer.TreeListWriter.WantAnyDeadTreeFloats (  ) 

This object always wants dead tree float data members.

Returns:
True.

Reimplemented from datavisualizer.DataRequest.

boolean datavisualizer.TreeListWriter.WantAnyDeadTreeInts (  ) 

This object always wants dead tree int data members.

Returns:
True.

Reimplemented from datavisualizer.DataRequest.

boolean datavisualizer.TreeListWriter.WantAnyDeadTreeChars (  ) 

This object always wants dead tree char data members.

Returns:
True.

Reimplemented from datavisualizer.DataRequest.

boolean datavisualizer.TreeListWriter.WantAnyDeadTreeBools (  ) 

This object always wants dead tree bool data members.

Returns:
True.

Reimplemented from datavisualizer.DataRequest.

void datavisualizer.TreeListWriter.AddDataToFileRow ( int  iSpecies,
int  iType,
int  iDeadCode,
int  iPos,
String  sVal 
) [private]

Adds a piece of tree data to the file row currently being built.

Parameters:
iSpecies Species number.
iType Type number.
iDeadCode Dead code reason number.
iPos Column position number.
sVal Value for the column.

void datavisualizer.TreeListWriter.AddTreeFloatData ( int  iSpecies,
int  iType,
int  iCode,
float  fVal 
)

Accepts a piece of tree float data from the parser.

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

void datavisualizer.TreeListWriter.AddTreeIntData ( int  iSpecies,
int  iType,
int  iCode,
int  iVal 
)

Accepts a piece of tree int data from the parser.

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

Reimplemented from datavisualizer.DataRequest.

void datavisualizer.TreeListWriter.AddTreeCharData ( int  iSpecies,
int  iType,
int  iCode,
String  sVal 
)

Accepts a piece of tree char data from the parser.

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

Reimplemented from datavisualizer.DataRequest.

void datavisualizer.TreeListWriter.AddTreeBoolData ( int  iSpecies,
int  iType,
int  iCode,
boolean  bVal 
)

Accepts a piece of tree bool data from the parser.

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

Reimplemented from datavisualizer.DataRequest.

void datavisualizer.TreeListWriter.AddDeadTreeFloatData ( int  iSpecies,
int  iType,
int  iCode,
int  iDeadCode,
float  fVal 
)

Accepts a piece of dead tree float data from the parser.

If this particular piece is not wanted, do nothing.

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

Reimplemented from datavisualizer.DataRequest.

void datavisualizer.TreeListWriter.AddDeadTreeIntData ( int  iSpecies,
int  iType,
int  iCode,
int  iDeadCode,
int  iVal 
)

Accepts a piece of dead tree int data from the parser.

If this particular piece is not wanted, do nothing.

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

Reimplemented from datavisualizer.DataRequest.

void datavisualizer.TreeListWriter.AddDeadTreeCharData ( int  iSpecies,
int  iType,
int  iCode,
int  iDeadCode,
String  sVal 
)

Accepts a piece of dead tree char data from the parser.

If this particular piece is not wanted, do nothing.

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

Reimplemented from datavisualizer.DataRequest.

void datavisualizer.TreeListWriter.AddDeadTreeBoolData ( int  iSpecies,
int  iType,
int  iCode,
int  iDeadCode,
boolean  bVal 
)

Accepts a piece of dead tree bool data from the parser.

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

Reimplemented from datavisualizer.DataRequest.

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

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

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

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

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

int datavisualizer.TreeListWriter.GetCodeForDataMember ( int  iDataType,
int  iSpecies,
int  iType,
String  sLabel 
) throws SAXException [private]

Get the code for a particular data member label.

Parameters:
iDataType One of the data type statics from DataMember
iSpecies Tree species
iType Tree type
sLabel Tree data member label
Returns:
Data member code
Exceptions:
ModelException If settings for the tree type and species cannot be found, or if the data type is invalid


Member Data Documentation

JTextField datavisualizer.TreeListWriter.m_jOutputFileName = new JTextField() [private]

Field for output filename.

JTextField datavisualizer.TreeListWriter.m_jTimestep = new JTextField() [private]

Field for timestep to save.

java.io.FileWriter datavisualizer.TreeListWriter.m_jOut [private]

Text output file.

String [] datavisualizer.TreeListWriter.mp_sTypeNames = new String[TreePopulation.GetNumberOfTypes()] [private]

Make our own copy because the one in DetailedOutputFileManager omits not dead.

Vector<Vector<Vector<Integer> > > datavisualizer.TreeListWriter.mp_iTreeIntTransforms [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.

Vector<Vector<Vector<Integer> > > datavisualizer.TreeListWriter.mp_iTreeFloatTransforms [private]

Column positions for tree float 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.

Vector<Vector<Vector<Integer> > > datavisualizer.TreeListWriter.mp_iTreeCharTransforms [private]

Column positions for tree char 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.

Vector<Vector<Vector<Integer> > > datavisualizer.TreeListWriter.mp_iTreeBoolTransforms [private]

Column positions for tree bool 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.

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.

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.

One tree's worth of data.

One space for each column in the output text file, even if they will not all be used.


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

Generated on Tue Apr 19 13:59:35 2011 for SORTIE Java Interface by  doxygen 1.5.6