SORTIE Java Interface  1
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | Static Private Attributes | List of all members
sortie.datavisualizer.GridHistogramDataRequest Class Reference

This controls the drawing of a histogram for a single piece of grid information. More...

Inheritance diagram for sortie.datavisualizer.GridHistogramDataRequest:
sortie.datavisualizer.DataRequest

Public Member Functions

 GridHistogramDataRequest (String sLabel, boolean bIsFloat, DetailedOutputFileManager oManager, String sGraphName, String sGridName)
 Constructor. More...
 
void timestepParseFinished (boolean bBatchMode) throws ModelException
 Adds the series to the dataset. 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 getReadyForTimestepParse (int iTimestep, boolean bBatchMode)
 This nulls our dataset and recreates it, and clears all of our data vectors. More...
 
void addGridFloatDataMemberCode (String sGridName, String sLabel, int iCode)
 Captures the data member code if we're graphing a float. More...
 
void addGridIntDataMemberCode (String sGridName, String sLabel, int iCode)
 Captures the data member code if we're graphing an integer. More...
 
boolean wantAnyGridInts ()
 If our data piece that's being graphed is an integer, this returns true. More...
 
boolean wantAnyGridFloats ()
 If our data piece that's being graphed is a float, this returns true. More...
 
void addGridFloatData (String sGridName, int iX, int iY, int iCode, float fVal, boolean bBatchMode)
 Accepts the value of our data member from the parser, if float. More...
 
void addGridIntData (String sGridName, int iX, int iY, 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...
 
- 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...
 

Protected Member Functions

void writeChartDataToFile (java.io.FileWriter jOut) throws java.io. IOException
 Writes the histogram's data to tab-delimited text. More...
 
float getDatasetMean ()
 Calculates the mean value of all values currently in mp_oData. More...
 
void addSeriesToDataset ()
 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...
 

Private Attributes

String m_sLabel
 Data member's label, as it appears in the detailed output file. More...
 
String m_sGridName
 Name of grid. More...
 
boolean m_bIsFloat
 Whether our data member being graphed is a float. More...
 
boolean m_bIsInt
 Whether the data being graphed is an integer. 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...
 
JLabel m_jMean = new JLabel("")
 Label holding mean value of dataset. More...
 
int m_iDataMemberCode = -1
 The data member code for this data member. More...
 
ArrayList< Number > mp_oData = new ArrayList<Number>(0)
 The data. 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...
 
int m_iNumBins
 Number of bins in the histogram. 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...
 
java.text.NumberFormat m_jFormat = java.text.NumberFormat.getInstance()
 Formatter for big numbers. 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...
 

Detailed Description

This controls the drawing of a histogram for a single piece of grid 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.

Copyright: Copyright (c) Charles D. Canham 2003

Company: Cary Institute of Ecosystem Studies

Author
Lora E. Murphy
Version
1.0


Edit history:
---------------—
March 29, 2005: Created (LEM)
February 4, 2008: Updated to conform to Java 6 compliance (LEM)
June 10, 2011: Added min and max display (LEM)
September 6, 2011: Reconfigured to work with batch output (LEM)

Constructor & Destructor Documentation

◆ GridHistogramDataRequest()

sortie.datavisualizer.GridHistogramDataRequest.GridHistogramDataRequest ( String  sLabel,
boolean  bIsFloat,
DetailedOutputFileManager  oManager,
String  sGraphName,
String  sGridName 
)

Constructor.

Parameters
sLabelLabel of the piece of data, as it would be passed as a data member code.
bIsFloatWhether this is float data. If this is set to false, integer data is assumed.
oManagerThe parent detailed output file manager.
sGraphNameName of graph string.
sGridNameName of grid.

Member Function Documentation

◆ actionPerformed()

void sortie.datavisualizer.GridHistogramDataRequest.actionPerformed ( ActionEvent  oEvent)

Performs actions for the controls in the Histogram window.

Parameters
oEventEvent triggered.

◆ addGridFloatData()

void sortie.datavisualizer.GridHistogramDataRequest.addGridFloatData ( String  sGridName,
int  iX,
int  iY,
int  iCode,
float  fVal,
boolean  bBatchMode 
)

Accepts the value of our data member from the parser, if float.

Parameters
sGridNameName of the grid for this data
iXX number of the cell from which this value came
iYY number of the cell from which this value came
iCodeData member code of this value.
fValValue.
bBatchModeWhether not this is in the context of the batch utility.

◆ addGridFloatDataMemberCode()

void sortie.datavisualizer.GridHistogramDataRequest.addGridFloatDataMemberCode ( String  sGridName,
String  sLabel,
int  iCode 
)

Captures the data member code if we're graphing a float.

Parameters
sGridNameName of the grid
sLabelThe label of the data member.
iCodeThe data member code.

◆ addGridIntData()

void sortie.datavisualizer.GridHistogramDataRequest.addGridIntData ( String  sGridName,
int  iX,
int  iY,
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.

Parameters
sGridNameName of the grid for this data
iXX number of the cell from which this value came
iYY number of the cell from which this value came
iCodeData member code of this value.
iValValue.
bBatchModeWhether not this is in the context of the batch utility.

◆ addGridIntDataMemberCode()

void sortie.datavisualizer.GridHistogramDataRequest.addGridIntDataMemberCode ( String  sGridName,
String  sLabel,
int  iCode 
)

Captures the data member code if we're graphing an integer.

Parameters
sGridNameName of the grid
sLabelThe label of the data member.
iCodeThe data member code.

◆ addSeriesToDataset()

void sortie.datavisualizer.GridHistogramDataRequest.addSeriesToDataset ( )
protected

This will add all series to the dataset.

◆ extractBatchSetupInfo()

void sortie.datavisualizer.GridHistogramDataRequest.extractBatchSetupInfo ( ChartInfo  oInfo) throws ModelException

Extracts information needed by the data request from the controls panel displayed to the user.

Parameters
oInfoObject which contains the chart information.

◆ getBinSize()

float sortie.datavisualizer.GridHistogramDataRequest.getBinSize ( )

Gets the bin size for this data request's histogram.

Returns
The bin size.

◆ getDatasetMean()

float sortie.datavisualizer.GridHistogramDataRequest.getDatasetMean ( )
protected

Calculates the mean value of all values currently in mp_oData.

Returns
float Mean of all values.

◆ getReadyForTimestepParse()

void sortie.datavisualizer.GridHistogramDataRequest.getReadyForTimestepParse ( int  iTimestep,
boolean  bBatchMode 
)

This nulls our dataset and recreates it, and clears all of our data vectors.

◆ getUseLogarithmicAxis()

boolean sortie.datavisualizer.GridHistogramDataRequest.getUseLogarithmicAxis ( )

Gets whether or not to use a logarithmic axis.

Returns
True if a logarithmic axis should be used, or false if a linear axis should be used.

◆ makeBatchControlsPanel()

static JPanel sortie.datavisualizer.GridHistogramDataRequest.makeBatchControlsPanel ( )
static

Makes the control panel to show while in batch mode.

Returns
Panel with batch controls.

◆ timestepParseFinished()

void sortie.datavisualizer.GridHistogramDataRequest.timestepParseFinished ( boolean  bBatchMode) throws ModelException

Adds the series to the dataset.

Parameters
bBatchModeWhether or not this is batch mode.

◆ wantAnyGridFloats()

boolean sortie.datavisualizer.GridHistogramDataRequest.wantAnyGridFloats ( )

If our data piece that's being graphed is a float, this returns true.

Otherwise, false.

Returns
Whether this object's data piece is a float.

◆ wantAnyGridInts()

boolean sortie.datavisualizer.GridHistogramDataRequest.wantAnyGridInts ( )

If our data piece that's being graphed is an integer, this returns true.

Otherwise, false.

Returns
Whether this object's data piece is an integer.

◆ writeChartDataToFile()

void sortie.datavisualizer.GridHistogramDataRequest.writeChartDataToFile ( java.io.FileWriter  jOut) throws java.io. IOException
protected

Writes the histogram's data to tab-delimited text.

Parameters
jOutjava.io.FileWriter The file to write to.
Exceptions
java.io.IOExceptionif there's a problem writing the file.

Member Data Documentation

◆ BIN_SIZE_DEFAULT

double sortie.datavisualizer.GridHistogramDataRequest.BIN_SIZE_DEFAULT = 0
staticprivate

Default value for bin size.

◆ BIN_SIZE_NAME

final String sortie.datavisualizer.GridHistogramDataRequest.BIN_SIZE_NAME = "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.

◆ m_bIsFloat

boolean sortie.datavisualizer.GridHistogramDataRequest.m_bIsFloat
private

Whether our data member being graphed is a float.

◆ m_bIsInt

boolean sortie.datavisualizer.GridHistogramDataRequest.m_bIsInt
private

Whether the data being graphed is an integer.

◆ m_bRecalcBinsOnUpdate

boolean sortie.datavisualizer.GridHistogramDataRequest.m_bRecalcBinsOnUpdate
private

Whether or not we have to recalculate the bins on chart update (i.e.

we are charting an unknown data type without defaults)

◆ m_bUseLogarithmicAxis

boolean sortie.datavisualizer.GridHistogramDataRequest.m_bUseLogarithmicAxis
private

Whether or not to use a logarithmic axis on the Y.

◆ m_fBinSize

float sortie.datavisualizer.GridHistogramDataRequest.m_fBinSize
private

Size of the histogram bins.

◆ m_fDatasetMax

float sortie.datavisualizer.GridHistogramDataRequest.m_fDatasetMax = java.lang.Float.NEGATIVE_INFINITY
private

Maximum dataset value.

◆ m_fDatasetMin

float sortie.datavisualizer.GridHistogramDataRequest.m_fDatasetMin = java.lang.Float.POSITIVE_INFINITY
private

Minimum dataset value.

◆ m_iDataMemberCode

int sortie.datavisualizer.GridHistogramDataRequest.m_iDataMemberCode = -1
private

The data member code for this data member.

◆ m_iNumBins

int sortie.datavisualizer.GridHistogramDataRequest.m_iNumBins
private

Number of bins in the histogram.

◆ m_jFormat

java.text.NumberFormat sortie.datavisualizer.GridHistogramDataRequest.m_jFormat = java.text.NumberFormat.getInstance()
private

Formatter for big numbers.

◆ m_jMaxDatasetValue

JLabel sortie.datavisualizer.GridHistogramDataRequest.m_jMaxDatasetValue = new JLabel("")
private

Field displaying the maximum value for the dataset.

◆ m_jMean

JLabel sortie.datavisualizer.GridHistogramDataRequest.m_jMean = new JLabel("")
private

Label holding mean value of dataset.

◆ m_jMinDatasetValue

JLabel sortie.datavisualizer.GridHistogramDataRequest.m_jMinDatasetValue = new JLabel("")
private

Field displaying the minimum value for the dataset.

◆ m_oDataset

ModelHistogramDataset sortie.datavisualizer.GridHistogramDataRequest.m_oDataset
protected

The dataset that will be graphed.

◆ m_sGridName

String sortie.datavisualizer.GridHistogramDataRequest.m_sGridName
private

Name of grid.

◆ m_sLabel

String sortie.datavisualizer.GridHistogramDataRequest.m_sLabel
private

Data member's label, as it appears in the detailed output file.

◆ mp_oData

ArrayList<Number> sortie.datavisualizer.GridHistogramDataRequest.mp_oData = new ArrayList<Number>(0)
private

The data.

◆ NUMBER_BINS_DEFAULT

int sortie.datavisualizer.GridHistogramDataRequest.NUMBER_BINS_DEFAULT = 10
staticprivate

Default value for number of bins.

◆ NUMBER_BINS_NAME

final String sortie.datavisualizer.GridHistogramDataRequest.NUMBER_BINS_NAME = "Number Bins"
static

The name that is given to the text field holding the number of bins in the control panel for this data request.

◆ PANEL_NAME

final String sortie.datavisualizer.GridHistogramDataRequest.PANEL_NAME = "Histogram Panel"
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.


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