SORTIE Java Interface
1
|
This class functions as an organizer for model-level behaviors. More...
Public Member Functions | |
BehaviorTypeBase (GUIManager oManager, String sName) | |
Constructor. More... | |
boolean | anyBehaviorsEnabled () |
Determines if any of the child behaviors are currently enabled. More... | |
void | validateData (TreePopulation oPop) throws ModelException |
Implements data checking. More... | |
Behavior | createBehaviorFromParameterFileTag (String sParameterFileTag) throws ModelException |
Creates a new behavior from an XML parameter file name tag and inserts it into the child behaviors list. More... | |
void | sortBehaviors () |
Sorts the behaviors by list position. More... | |
boolean | canBehaviorBeDuplicated (String sParameterFileTag) throws ModelException |
Whether or not a behavior of a certain class can be duplicated in a run. More... | |
boolean | doesBehaviorNeedTrees (String sParameterFileTag) throws ModelException |
Whether or not a behavior of a certain class can be duplicated in a run. More... | |
ArrayList< BehaviorInstantiator > | getAllPossibleBehaviors () |
Gets all possible behaviors. More... | |
Behavior | getBehaviorByXMLParametersParentTag (String sXMLTag, int iPos) |
Finds a behavior by its XML parameters parent tag. More... | |
String | getDescriptor (String sParameterFileTag) |
Gets the descriptor for a behavior based on its parameter file tag. More... | |
Grid [] | getEnabledGridObjects () throws ModelException |
Gets the list of grid objects which the currently enabled behaviors would be expected to create - and thus would be available to output, etc. More... | |
ArrayList< Behavior > | getAllInstantiatedBehaviors () |
Get the list of child behaviors currently selected for the run. More... | |
void | writeBehaviorNodes (BufferedWriter out, TreePopulation oPop) throws ModelException |
Writes behavior tags to the parameter file. More... | |
ArrayList< Behavior > | getBehaviorByDisplayName (String sDescriptor) |
Convenience method for getting an instantiated behavior. More... | |
ArrayList< Behavior > | getBehaviorByParameterFileTag (String sParameterFileTag) |
Finds an instantiated behavior by its XML parameter file tag. More... | |
void | changeOfSpecies (int iOldNumSpecies, int[] p_iIndexer, String[] p_sNewSpecies) throws ModelException |
Triggered when there is a change in the species list. More... | |
void | copySpecies (int iSpeciesCopyFrom, int iSpeciesCopyTo) throws ModelException |
Copies one species to another. More... | |
void | endOfParameterFileRead () |
Allows child behaviors to do end-of-parameter-file tasks. More... | |
void | changeOfSpeciesName (String sOldSpecies, String sNewSpecies) throws ModelException |
Performs any necessary tasks associated with changing the name of a species. More... | |
GUIManager | getGUIManager () |
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 | removeBehavior (Behavior oBeh) |
Removes a behavior from the instantiated list. More... | |
String | getName () |
Returns the user-acceptable name for this object. More... | |
void | changeOfPlotResolution (float fOldX, float fOldY, float fNewX, float fNewY) throws ModelException |
Allows instantiated behaviors to perform any tasks associated with a change of plot resolution. More... | |
void | doSetup (TreePopulation oPop) throws ModelException |
Does any needed setup once the tree population object has data. More... | |
Static Public Member Functions | |
static boolean [] | mergeBooleans (boolean[] p_oMergeOne, boolean[] p_oMergeTwo) |
Merges two boolean arrays and returns an array where there is a true in each array bucket where EITHER array is true. More... | |
Protected Attributes | |
ArrayList< Behavior > | mp_oInstantiatedBehaviors |
List of child behaviors currently selected for the run. More... | |
ArrayList< BehaviorInstantiator > | mp_oAvailableBehaviors |
List of possible behaviors that can be created. More... | |
GUIManager | m_oManager |
GUIManager object. More... | |
String | m_sName |
User-consumable name for this object. More... | |
This class functions as an organizer for model-level behaviors.
Each object of this class manages a group of similar behavior objects.
This is the behavior level of which the GUIManager is aware. It keeps a known set of these objects around, which can respond to a common set of requests, and relies on them to manage the complexity of the individual behaviors which they own. Copyright: Copyright (c) 2011 Charles D. Canham Company: Cary Institute of Ecosystem Studies
Edit history:
---------------—
December 8, 2011: Wiped the slate clean for version 7 (LEM)
sortie.data.funcgroups.BehaviorTypeBase.BehaviorTypeBase | ( | GUIManager | oManager, |
String | sName | ||
) |
Constructor.
oManager | GUIManager object. |
sName | Name of this object to display to the user. |
boolean sortie.data.funcgroups.BehaviorTypeBase.anyBehaviorsEnabled | ( | ) |
Determines if any of the child behaviors are currently enabled.
boolean sortie.data.funcgroups.BehaviorTypeBase.canBehaviorBeDuplicated | ( | String | sParameterFileTag | ) | throws ModelException |
Whether or not a behavior of a certain class can be duplicated in a run.
sParameterFileTag | Parameter file tag of behavior to create. |
void sortie.data.funcgroups.BehaviorTypeBase.changeOfPlotResolution | ( | float | fOldX, |
float | fOldY, | ||
float | fNewX, | ||
float | fNewY | ||
) | throws ModelException |
Allows instantiated behaviors to perform any tasks associated with a change of plot resolution.
fOldX | float Old plot X length. |
fOldY | float Old plot Y length. |
fNewX | float New plot X length. |
fNewY | float New plot Y length. |
ModelException | if anything goes wrong. |
void sortie.data.funcgroups.BehaviorTypeBase.changeOfSpecies | ( | int | iOldNumSpecies, |
int [] | p_iIndexer, | ||
String [] | p_sNewSpecies | ||
) | throws ModelException |
Triggered when there is a change in the species list.
This goes through all behaviors and updates their assignments.
iOldNumSpecies | says how many species there used to be. |
p_iIndexer | is an array, sized to the new number of species. For each bucket (representing the index number of a species on the new list), the value is either the index of that same species in the old species list, or -1 if the species is new. |
p_sNewSpecies | The new species list. |
ModelException | if there's a problem. |
void sortie.data.funcgroups.BehaviorTypeBase.changeOfSpeciesName | ( | String | sOldSpecies, |
String | sNewSpecies | ||
) | throws ModelException |
Performs any necessary tasks associated with changing the name of a species.
Everything about the species remains the same except for the name. This is an easier process than actually changing the species list.
sOldSpecies | String Old name of the species, with underscores instead of spaces (like the species names would come from the tree population) |
sNewSpecies | String New name of the species, with underscores instead of spaces (like the species names would come from the tree population) |
ModelException | if there is a problem. |
void sortie.data.funcgroups.BehaviorTypeBase.copySpecies | ( | int | iSpeciesCopyFrom, |
int | iSpeciesCopyTo | ||
) | throws ModelException |
Copies one species to another.
This makes sure behavior assignments are the same.
iSpeciesCopyFrom | int Species to copy. |
iSpeciesCopyTo | int Species that is the copy. |
ModelException | if there is a problem. |
Behavior sortie.data.funcgroups.BehaviorTypeBase.createBehaviorFromParameterFileTag | ( | String | sParameterFileTag | ) | throws ModelException |
boolean sortie.data.funcgroups.BehaviorTypeBase.doesBehaviorNeedTrees | ( | String | sParameterFileTag | ) | throws ModelException |
Whether or not a behavior of a certain class can be duplicated in a run.
sParameterFileTag | Parameter file tag of behavior to create. |
void sortie.data.funcgroups.BehaviorTypeBase.doSetup | ( | TreePopulation | oPop | ) | throws ModelException |
Does any needed setup once the tree population object has data.
This will be called once the tree population has its data.
oPop | TreePopulation object. |
ModelException | if there are problems with setup. |
void sortie.data.funcgroups.BehaviorTypeBase.endOfParameterFileRead | ( | ) |
Allows child behaviors to do end-of-parameter-file tasks.
ArrayList<Behavior> sortie.data.funcgroups.BehaviorTypeBase.getAllInstantiatedBehaviors | ( | ) |
Get the list of child behaviors currently selected for the run.
ArrayList<BehaviorInstantiator> sortie.data.funcgroups.BehaviorTypeBase.getAllPossibleBehaviors | ( | ) |
Gets all possible behaviors.
ArrayList<Behavior> sortie.data.funcgroups.BehaviorTypeBase.getBehaviorByDisplayName | ( | String | sDescriptor | ) |
Convenience method for getting an instantiated behavior.
If there is more than one, all will be returned.
sDescriptor | The descriptive name of the behavior. |
ArrayList<Behavior> sortie.data.funcgroups.BehaviorTypeBase.getBehaviorByParameterFileTag | ( | String | sParameterFileTag | ) |
Finds an instantiated behavior by its XML parameter file tag.
If there is more than one, all will be returned.
sParameterFileTag | String The XML tag for which to find a behavior. |
Behavior sortie.data.funcgroups.BehaviorTypeBase.getBehaviorByXMLParametersParentTag | ( | String | sXMLTag, |
int | iPos | ||
) |
String sortie.data.funcgroups.BehaviorTypeBase.getDescriptor | ( | String | sParameterFileTag | ) |
Gets the descriptor for a behavior based on its parameter file tag.
The behavior does not have to be instantiated.
sParameterFileTag | Parameter file tag. |
Grid [] sortie.data.funcgroups.BehaviorTypeBase.getEnabledGridObjects | ( | ) | throws ModelException |
Gets the list of grid objects which the currently enabled behaviors would be expected to create - and thus would be available to output, etc.
ModelException | passing through from called methods. |
GUIManager sortie.data.funcgroups.BehaviorTypeBase.getGUIManager | ( | ) |
String sortie.data.funcgroups.BehaviorTypeBase.getName | ( | ) |
Returns the user-acceptable name for this object.
|
static |
Merges two boolean arrays and returns an array where there is a true in each array bucket where EITHER array is true.
If either array is null, the other array is returned. This will not make sure the arrays are the same length.
p_oMergeOne | First array to merge. |
p_oMergeTwo | Second array to merge. |
void sortie.data.funcgroups.BehaviorTypeBase.removeBehavior | ( | Behavior | oBeh | ) |
Removes a behavior from the instantiated list.
oBeh | Behavior to remove. |
void sortie.data.funcgroups.BehaviorTypeBase.sortBehaviors | ( | ) |
Sorts the behaviors by list position.
void sortie.data.funcgroups.BehaviorTypeBase.validateData | ( | TreePopulation | oPop | ) | throws ModelException |
Implements data checking.
This will be called after data has been set.
oPop | TreePopulation object. |
ModelException | if data doesn't pass validation. |
void sortie.data.funcgroups.BehaviorTypeBase.writeBehaviorNodes | ( | BufferedWriter | out, |
TreePopulation | oPop | ||
) | throws ModelException |
Writes behavior tags to the parameter file.
For all enabled behaviors, writes them in order along with their appropriate applyTo tags.
out | File stream to write to. |
oPop | Tree population object. |
ModelException | if there is a problem writing the file. |
void sortie.data.funcgroups.BehaviorTypeBase.writeXML | ( | BufferedWriter | jOut, |
TreePopulation | oPop | ||
) | throws ModelException |
Writes the XML data to a parameter file for the behaviors owned by this object.
jOut | File stream to write to. |
oPop | TreePopulation object. |
ModelException | if there is a problem writing the file or validating the data. |
|
protected |
GUIManager object.
|
protected |
User-consumable name for this object.
|
protected |
List of possible behaviors that can be created.
|
protected |
List of child behaviors currently selected for the run.
They are kept in the order in which they are arranged for the run.