SORTIE Java Interface  1
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
sortie.data.funcgroups.Plot Class Reference

Holds clPlot data. More...

Inheritance diagram for sortie.data.funcgroups.Plot:
sortie.data.funcgroups.Behavior

Public Member Functions

 Plot (GUIManager oManager, BehaviorTypeBase oParent, String sDescriptor, String sParFileTag, String sXMLRootString)
 Constructor. More...
 
void readDataFromDisplay (ArrayList< BehaviorParameterDisplay > p_oData, TreePopulation oPop) throws ModelException
 Checks for changes to plot size, and tells the GUIManager if there are any. More...
 
void setYearsPerTimestep (float fYears) throws ModelException
 Sets the number of years per timestep. More...
 
float getNumberOfYearsPerTimestep ()
 Gets the number of years per timestep. More...
 
void setPlotTitle (String sTitle)
 Sets the plot title. More...
 
void setNumberOfTimesteps (int i) throws ModelException
 Sets the number of timesteps for a run. More...
 
int getNumberOfTimesteps ()
 Gets the number of timesteps for a run. More...
 
void setRandomSeed (int i)
 Sets the random seed for the run. More...
 
void setPlotXLength (float f) throws ModelException
 Sets the plot length in the X (East-West) direction. More...
 
float getPlotXLength ()
 Gets the current plot X (East-West) length. More...
 
void setPlotYLength (float f) throws ModelException
 Sets the plot length in the Y (North-South) direction. More...
 
float getPlotYLength ()
 Gets the current plot Y (North-South) length. More...
 
void setLatitude (float f) throws ModelException
 Sets the latitude of the plot. More...
 
void validateData (TreePopulation oPop) throws ModelException
 Validates the data prior to running the model. More...
 
- Public Member Functions inherited from sortie.data.funcgroups.Behavior
GUIManager getGUIManager ()
 
 Behavior (GUIManager oManager, BehaviorTypeBase oParent, String sDescriptor, String sParFileTag, String sXMLRootString, String sHelpFileString)
 Constructor. More...
 
abstract void validateData (TreePopulation oPop) throws ModelException
 Override this to implement data checking. More...
 
void callSetupDialog (JDialog jParent, MainWindow oMain)
 Override this to call a specific setup dialog for this behavior. More...
 
int getNumberOfDataObjects ()
 Gets the number of managed data objects. More...
 
ModelData getDataObject (int iInd)
 Gets the managed data object at a particular index. More...
 
void validate () throws ModelException
 Behavior performs an internal check to make sure its settings are consistent and logical. More...
 
void setListPosition (int iListPosition) throws ModelException
 Sets the behavior list position. More...
 
int getListPosition ()
 Gets the behavior list position. More...
 
String getXMLParametersRoot ()
 Gets the XML parameter root string. More...
 
int getNumberNewDataMembers ()
 
DataMember getNewTreeDataMember (int iIndex) throws ModelException
 
void setCanApplyTo (int iType, boolean bCanApply)
 Sets whether this behavior can apply to a given tree type. More...
 
String getParameterFileBehaviorName ()
 Gets the parameter file name for this behavior. More...
 
double getVersion ()
 Gets behavior's parameter file version. More...
 
double getMinimumVersion ()
 Gets behavior's parameter file minimum version. More...
 
String getDescriptor ()
 Gets the descriptor string. More...
 
String getHelpFileString ()
 Gets the help file UD. More...
 
void setDescriptor (String s)
 Sets the descriptor string. More...
 
int getNumberOfCombos ()
 Gets the number of species/type combos to which this behavior applies. More...
 
int getNumberOfGrids ()
 Gets the number of grids to which this behavior applies. More...
 
void deleteSpeciesTypeCombo (int iIndex) throws ModelException
 Deletes the SpeciesTypeCombo at the given index. More...
 
void deleteSpeciesTypeCombo (SpeciesTypeCombo oCombo) throws ModelException
 Deletes a SpeciesTypeCombo. More...
 
void clearSpeciesTypeCombos ()
 Empties the species/type combo list. More...
 
SpeciesTypeCombo getSpeciesTypeCombo (int iIndex) throws ModelException
 Returns the SpeciesTypeCombo at the given index of the species/type combo list. More...
 
Grid getGrid (int iIndex) throws ModelException
 Returns the Grid at the given index of the grid applies to list. More...
 
ModelData getRequiredData (int iIndex)
 Returns the required data object at a given index. More...
 
int getNumberOfRequiredDataObjects ()
 Gets the number of required data objects for this behavior. More...
 
void addSpeciesTypeCombo (SpeciesTypeCombo oCombo) throws ModelException
 Adds a new species/type combo to the list to which this behavior applies. More...
 
void addGrid (Grid oGrid, boolean bReplace)
 Adds a new Grid to the list to which this behavior applies. More...
 
void addRequiredData (ModelData oData)
 Adds a piece of required data to the list. More...
 
boolean [] getWhichSpeciesUsed (TreePopulation oPop)
 Returns which species to which this behavior is applied. More...
 
boolean setVectorValueByXMLTag (String sXMLTag, String sXMLParentTag, ArrayList< String > p_oData, String[] p_sChildXMLTags, boolean[] p_bAppliesTo, Attributes oParentAttributes, Attributes[] p_oAttributes) throws ModelException
 Sets a data vector's value. More...
 
boolean setSingleValueByXMLTag (String sXMLTag, String sXMLParentTag, Attributes oAttributes, Object oData) throws ModelException
 Sets a data object's value. More...
 
ModelData findObjectByXMLTag (String sXMLTag)
 Finds an object based on its XML tag. More...
 
void copySpecies (int iSpeciesCopyFrom, int iSpeciesCopyTo) throws ModelException
 Copies one species to another. More...
 
void writeXML (BufferedWriter jOut, TreePopulation oPop) throws ModelException
 Writes the XML data to a parameter file for the behaviors owned by this object. More...
 
void writeSpeciesSpecificValue (BufferedWriter jOut, ModelVector p_oData, TreePopulation oPop) throws java.io.IOException, ModelException
 Writes a set of species-specific float values to a parameter file. More...
 
void writeSpeciesSpecificValue (BufferedWriter jOut, ModelVector p_oData, TreePopulation oPop, boolean[] p_bFlags) throws java.io.IOException, ModelException
 Writes a set of species-specific values to a parameter file for a certain subset of species. More...
 
void readXMLParentTag (String sXMLTag, Attributes oAttributes) throws ModelException
 Accepts an XML parent tag (empty, no data) from the parser. More...
 
void changeOfSpeciesName (String sOldSpecies, String sNewSpecies)
 Performs any necessary tasks associated with changing the name of a species. More...
 
void changeOfSpecies (int iOldNumSpecies, int[] p_iIndexer, String[] p_sNewSpecies) throws ModelException
 Triggered when there is a change in the species list. More...
 
boolean getMustHaveTrees ()
 Gets whether this behavior must have trees. More...
 
ModelData findObjectByDescriptor (String sDescriptor)
 Finds an object based on its descriptor. More...
 
void writeBehaviorNode (BufferedWriter out, TreePopulation oPop) throws ModelException
 Writes behavior tags to the parameter file. More...
 
ArrayList< BehaviorParameterDisplayformatDataForDisplay (TreePopulation oPop)
 Formats data for display in a set of JTables. More...
 
String getAppliedToForDisplay (TreePopulation oPop)
 Get which species/types this behavior applies to, in a display-friendly format truncated to 250 chars. More...
 
void readDataFromDisplay (ArrayList< BehaviorParameterDisplay > oData, TreePopulation oPop) throws ModelException
 Reads in data from the parameter display window. More...
 
boolean canBeDuplicated ()
 Whether or not this behavior can be duplicated in the run. More...
 
void endOfParameterFileRead ()
 Called at the end of the parameter file read process. More...
 
void changeOfPlotResolution (float fOldX, float fOldY, float fNewX, float fNewY) throws ModelException
 Performs any tasks associated with a change of plot resolution. More...
 
setupType getSetupType ()
 
void writeParametersToTextFile (FileWriter jOut, TreePopulation oPop) throws IOException
 Writes the parameters for the behavior to file, using the same system as the basic parameter display and entry system. More...
 

Static Public Attributes

static final float CELL_LENGTH = (float)8.0
 Length of cells, in meters. More...
 

Protected Attributes

ModelString m_sPlotTitle = new ModelString("", "Plot title", "plot_title")
 Plot title or comment. More...
 
ModelFloat m_fPlotLenX
 Length of plot in X direction. More...
 
ModelFloat m_fPlotLenY
 Length of plot in Y direction. More...
 
ModelFloat m_fLatitude
 Latitude of plot in decimal degrees. More...
 
ModelFloat m_fMeanAnnualPrecipMm
 Mean annual precipitation, mm. More...
 
ModelFloat m_fSeasonalPrecip
 Seasonal precipitation. More...
 
ModelFloat m_fWaterDeficit
 Water deficit. More...
 
ModelFloat m_fMeanAnnualTempC
 Mean annual temperature, degrees Celsius. More...
 
ModelFloat m_fAnnualNDep
 Annual nitrogen deposition. More...
 
ModelFloat m_fNumberOfYearsPerTimestep
 Number of years per timestep - default to 5, the old value. More...
 
ModelInt m_iNumTimesteps
 Number of timesteps for the run. More...
 
ModelInt m_iRandomSeed
 Run's random seed. More...
 
ModelInt m_iCurrentTimestep
 Current timestep, if a detailed output timestep file has been fed in. More...
 
- Protected Attributes inherited from sortie.data.funcgroups.Behavior
GUIManager m_oManager
 GUIManager object. More...
 
BehaviorTypeBase m_oParent
 Parent manager. More...
 
ArrayList< ModelDatamp_oAllData = new ArrayList<ModelData>()
 All data for this object. More...
 
ArrayList< SpeciesTypeCombomp_oTreesAppliesTo = new ArrayList<SpeciesTypeCombo>(0)
 A set of SpeciesTypeCombo objects to which this behavior is applied - or none if it is not applied to trees. More...
 
ArrayList< Integer > mp_iGridsAppliesTo = new ArrayList<Integer>(0)
 A set of hashcodes of the Grids to which this behavior is applied - or none if it is not applied to grids. More...
 
ArrayList< DataMembermp_oNewTreeDataMembers = new ArrayList<DataMember>(0)
 The new tree data members that this behavior adds, above and beyond the basic tree population data members. More...
 
boolean m_bCanBeDuplicated = true
 Whether or not this behavior can have multiple copies in a run or not. More...
 
String m_sDescriptor = ""
 This is what will be displayed as the name of a given behavior in the GUI. More...
 
String m_sParFileTag = ""
 String which is used to identify this behavior in the parameter file. More...
 
String m_sXMLRootString = ""
 XML tag to surround this behavior's data. More...
 
String m_sHelpFileString = ""
 Help file topic identifier string. More...
 
boolean [] mp_bCanApplyToTreeType
 For each tree type, whether or not this behavior can be applied to it. More...
 
double m_fVersion = 1.0
 Version of this behavior. More...
 
double m_fMinVersion = 1.0
 Minimum version of this behavior. More...
 
int m_iListPosition = -1
 This behavior's position in the behavior list. More...
 
setupType m_iBehaviorSetupType
 

Additional Inherited Members

- Static Public Member Functions inherited from sortie.data.funcgroups.Behavior
static void setVectorValues (ModelVector oData, Float[] p_fValuesToSet, boolean[] p_bAppliesTo)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, Float[] p_fValuesToSet)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, Double[] p_fValuesToSet, boolean[] p_bAppliesTo)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, Double[] p_fValuesToSet)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, Integer[] p_iValuesToSet, boolean[] p_bAppliesTo)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, String[] p_sValuesToSet)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, String[] p_sValuesToSet, boolean[] p_bAppliesTo)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, Integer[] p_iValuesToSet)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector p_oData, ArrayList< String > p_oValuesToSet, boolean[] p_bAppliesTo) throws ModelException
 Sets the values for vector variables. More...
 
static void writeDataToFile (BufferedWriter ojOut, ModelData oData) throws java.io. IOException
 Writes a piece of data to an XML file. More...
 
static Object [] formatBlankHeaderRow (Object[][] p_oTable)
 Creates a blank header row for a table. More...
 
static Object [][] formatDataAsComboBox (Object[][] p_oExisting, ModelEnum oToFormat)
 Adds a value with combo box formatting to an Object array for display in a JTable. More...
 
static String formatComboBoxString (ModelEnum oToFormat)
 Formats a combo box string from a ModelEnum. More...
 
static void addDataObjectToDisplayArrays (ModelData p_oDataObject, ArrayList< ModelData > p_oSingles, ArrayList< ArrayList< SpeciesSpecific >> p_oSpeciesSpecific, boolean[] p_bAppliesTo)
 Adds a data object to the arrays which will eventually display run parameters in a set of tables. More...
 
static Object [][] addDataToArray (Object[][] p_oExistingArray, Object[] p_oAddArray)
 Adds an Object array to an existing Object array. More...
 
static Object [][] formatDataForTable (Object[][] p_oExisting, ModelFloat oToFormat)
 Formats and adds a value into an Object array suitable for placing in a JTable. More...
 
static Object [][] formatDataForTable (Object[][] p_oExisting, ModelInt oToFormat)
 Formats and adds a value into an Object array suitable for placing in a JTable. More...
 
static Object [][] formatDataForTable (Object[][] p_oExisting, ModelString oToFormat)
 Formats and adds a value into an Object array suitable for placing in a JTable. More...
 
static Object [][] formatDataForTable (Object[][] p_oExisting, ModelVector oToFormat)
 Formats a vector of values into an object array and adds it to another Object array suitable for placing in a JTable. More...
 
static Object [][] formatDataForTable (Object[][] p_oExisting, ModelVector oToFormat, boolean[] p_bWhichSpecies)
 Formats a vector of values into a plain vector suitable for placing in a JTable and adds it to a vector of vectors at the end. More...
 
static Object [] formatSpeciesHeaderRow (boolean[] p_bUsed, TreePopulation oPop)
 Creates an object array of strings consisting of species names, suitable for including in the parameter entry table. More...
 
static void ensureSize (ArrayList<?> list, int size)
 Ensure an ArrayList is at least a specific size. More...
 
- Public Attributes inherited from sortie.data.funcgroups.Behavior
boolean m_bMustHaveTrees = true
 If true, and a tree has no species/type combos, it automatically becomes disabled. More...
 
- Protected Member Functions inherited from sortie.data.funcgroups.Behavior
void setSingleValue (ModelData oDataMember, Object oData) throws ModelException
 Sets the value of a single data member. More...
 
BehaviorParameterDisplay formatTable (ArrayList< ModelData > p_oSingles, ArrayList< ArrayList< SpeciesSpecific >> p_oSpeciesSpecific, TreePopulation oPop)
 Turns vector groups of data objects into a set of tables for display. More...
 
- Static Protected Member Functions inherited from sortie.data.funcgroups.Behavior
static boolean boolArraysEqual (boolean[] p_bArrayOne, boolean[] p_bArrayTwo)
 Tests two boolean arrays for equality. More...
 

Detailed Description

Holds clPlot data.

Author
LORA

Constructor & Destructor Documentation

◆ Plot()

sortie.data.funcgroups.Plot.Plot ( GUIManager  oManager,
BehaviorTypeBase  oParent,
String  sDescriptor,
String  sParFileTag,
String  sXMLRootString 
)

Constructor.

Parameters
oManagerGUIManager object
oParentParent managing object.
sDescriptorThe name of the behavior for the user.
sParFileTagString which is used to identify this behavior in the parameter file.
sXMLRootStringXML tag to surround this behavior's data.

Member Function Documentation

◆ getNumberOfTimesteps()

int sortie.data.funcgroups.Plot.getNumberOfTimesteps ( )

Gets the number of timesteps for a run.

Returns
The number of timesteps.

◆ getNumberOfYearsPerTimestep()

float sortie.data.funcgroups.Plot.getNumberOfYearsPerTimestep ( )

Gets the number of years per timestep.

Returns
Number of years per timestep.

◆ getPlotXLength()

float sortie.data.funcgroups.Plot.getPlotXLength ( )

Gets the current plot X (East-West) length.

Returns
Current plot X length.

◆ getPlotYLength()

float sortie.data.funcgroups.Plot.getPlotYLength ( )

Gets the current plot Y (North-South) length.

Returns
Current plot Y length.

◆ readDataFromDisplay()

void sortie.data.funcgroups.Plot.readDataFromDisplay ( ArrayList< BehaviorParameterDisplay p_oData,
TreePopulation  oPop 
) throws ModelException

Checks for changes to plot size, and tells the GUIManager if there are any.

Parameters
p_oDataVector Vector of data
oPopTreePopulation Tree population object
Exceptions
ModelExceptionwon't.

◆ setLatitude()

void sortie.data.funcgroups.Plot.setLatitude ( float  f) throws ModelException

Sets the latitude of the plot.

Parameters
fLatitude in decimal degrees.
Exceptions
ModelExceptionif latitude is not between -90 and 90.

◆ setNumberOfTimesteps()

void sortie.data.funcgroups.Plot.setNumberOfTimesteps ( int  i) throws ModelException

Sets the number of timesteps for a run.

Parameters
iThe number of timesteps.
Exceptions
ModelExceptionwhen the number of timesteps is less than or equal to zero.

◆ setPlotTitle()

void sortie.data.funcgroups.Plot.setPlotTitle ( String  sTitle)

Sets the plot title.

Parameters
sTitleTitle of the plot.

◆ setPlotXLength()

void sortie.data.funcgroups.Plot.setPlotXLength ( float  f) throws ModelException

Sets the plot length in the X (East-West) direction.

Parameters
fLength of the plot in the X direction.
Exceptions
ModelExceptionif the passed length is less than or equal to 0.

◆ setPlotYLength()

void sortie.data.funcgroups.Plot.setPlotYLength ( float  f) throws ModelException

Sets the plot length in the Y (North-South) direction.

Parameters
fLength of the plot in the Y direction.
Exceptions
ModelExceptionif the passed length is less than or equal to 0.

◆ setRandomSeed()

void sortie.data.funcgroups.Plot.setRandomSeed ( int  i)

Sets the random seed for the run.

A value of 0 means a new random seed each time a parameter file is run.

Parameters
iThe random seed value.

◆ setYearsPerTimestep()

void sortie.data.funcgroups.Plot.setYearsPerTimestep ( float  fYears) throws ModelException

Sets the number of years per timestep.

Parameters
fYearsNumber of years per timestep.
Exceptions
ModelExceptionif the number of years per timestep is not greater than 0.

◆ validateData()

void sortie.data.funcgroups.Plot.validateData ( TreePopulation  oPop) throws ModelException

Validates the data prior to running the model.

Exceptions
ModelExceptionif any of the following are not greater than zero:
  • m_fPlotLenX
  • m_fPlotLenY
  • m_iNumTimesteps
  • m_fNumberOfYearsPerTimestep
or if m_fLatitude is not between -90 and +90.
Parameters
oPopNot used.

Member Data Documentation

◆ CELL_LENGTH

final float sortie.data.funcgroups.Plot.CELL_LENGTH = (float)8.0
static

Length of cells, in meters.

◆ m_fAnnualNDep

ModelFloat sortie.data.funcgroups.Plot.m_fAnnualNDep
protected
Initial value:
= new ModelFloat(0,
"Annual Nitrogen Deposition", "plot_n_dep")

Annual nitrogen deposition.

◆ m_fLatitude

ModelFloat sortie.data.funcgroups.Plot.m_fLatitude
protected
Initial value:
= new ModelFloat(0,
"Plot Latitude, in decimal degrees", "plot_latitude")

Latitude of plot in decimal degrees.

◆ m_fMeanAnnualPrecipMm

ModelFloat sortie.data.funcgroups.Plot.m_fMeanAnnualPrecipMm
protected
Initial value:
= new ModelFloat(0,
"Annual Precipitation, mm", "plot_precip_mm_yr")

Mean annual precipitation, mm.

◆ m_fMeanAnnualTempC

ModelFloat sortie.data.funcgroups.Plot.m_fMeanAnnualTempC
protected
Initial value:
= new ModelFloat(0,
"Mean Annual Temperature, degrees C", "plot_temp_C")

Mean annual temperature, degrees Celsius.

◆ m_fNumberOfYearsPerTimestep

ModelFloat sortie.data.funcgroups.Plot.m_fNumberOfYearsPerTimestep
protected
Initial value:
= new ModelFloat(5,
"Number of years per timestep", "yearsPerTimestep")

Number of years per timestep - default to 5, the old value.

◆ m_fPlotLenX

ModelFloat sortie.data.funcgroups.Plot.m_fPlotLenX
protected
Initial value:
= new ModelFloat(0,
"Plot Length in the X (E-W) Direction, in meters", "plot_lenX")

Length of plot in X direction.

X is EW.

◆ m_fPlotLenY

ModelFloat sortie.data.funcgroups.Plot.m_fPlotLenY
protected
Initial value:
= new ModelFloat(0,
"Plot Length in the Y (N-S) Direction, in meters", "plot_lenY")

Length of plot in Y direction.

Y is NS.

◆ m_fSeasonalPrecip

ModelFloat sortie.data.funcgroups.Plot.m_fSeasonalPrecip
protected
Initial value:
= new ModelFloat(0,
"Seasonal Precipitation", "plot_seasonal_precipitation")

Seasonal precipitation.

◆ m_fWaterDeficit

ModelFloat sortie.data.funcgroups.Plot.m_fWaterDeficit
protected
Initial value:
= new ModelFloat(0,
"Water Deficit", "plot_water_deficit")

Water deficit.

◆ m_iCurrentTimestep

ModelInt sortie.data.funcgroups.Plot.m_iCurrentTimestep
protected
Initial value:
= new ModelInt(0, "Current Timestep",
"rt_timestep")

Current timestep, if a detailed output timestep file has been fed in.

Not required.

◆ m_iNumTimesteps

ModelInt sortie.data.funcgroups.Plot.m_iNumTimesteps
protected
Initial value:
= new ModelInt(0, "Number of Timesteps",
"timesteps")

Number of timesteps for the run.

◆ m_iRandomSeed

ModelInt sortie.data.funcgroups.Plot.m_iRandomSeed
protected
Initial value:
= new ModelInt(0, "Random Seed",
"randomSeed")

Run's random seed.

◆ m_sPlotTitle

ModelString sortie.data.funcgroups.Plot.m_sPlotTitle = new ModelString("", "Plot title", "plot_title")
protected

Plot title or comment.


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