Public Member Functions | |
GUIManager (MainWindow oWindow) throws ModelException | |
Constructor. | |
boolean | HasParameterFileBeenModified () |
Whether or not the current parameter file has been modified. | |
HelpBroker | GetHelpBroker () |
Gets the HelpBroker object which manages help display for the entire application. | |
void | ProposeNewParameterFile () throws ModelException |
This can be used to propose that a new parameter file is being created. | |
String | GetParameterFileName () |
Gets the parameter file name. | |
void | DisplayOutputWindow () |
Display the window which allows the user to set up output options. | |
void | DisplayTreeSetupWindow () |
Displays the window which allows the user to set up trees. | |
void | DisplayGridSetupWindow () |
Displays the window which allows the user to set up grids. | |
void | DisplayHarvestInterfaceWindow () throws ModelException |
Displays the window which allows the user to set up the harvest interface. | |
void | InputTreeMap (String sFileName) throws ModelException |
This passes a tree map file on to the tree population. | |
boolean | InputXMLFile (String sFileName, JFrame oWindow) throws ModelException |
Accepts an XML file for input. | |
boolean | GetSnagAwareness () throws ModelException |
Gets whether or not the run is snag-aware. | |
boolean | WriteParameterFile (String sFileName) throws ModelException |
Writes out the XML parameter file with the current settings. | |
MainWindow | GetMainWindow () |
Gets the MainWindow object. | |
String[] | GetBehaviorList (int iSpecies, int iType) |
Gets the descriptive names list of behaviors for a tree species/type combo. | |
void | SetBehaviorList (SpeciesTypeCombo oToSet, String[] p_sBehaviors) throws ModelException |
Sets the list of behaviors for a tree species/type combo. | |
String | PrepToRun () throws ModelException |
Takes all loaded data and prepares a parameter file to pass to the core to run, returning the filename of the parameter file. | |
void | CreateNewParameterFile () throws ModelException |
Performs the actions necessary to start a new parameter file. | |
OutputBehaviors | GetOutputBehaviors () |
Gets the OutputBehaviors object, or null if none exists. | |
DisperseBehaviors | GetDisperseBehaviors () |
Gets the DisperseBehaviors object, or null if none exists. | |
AnalysisBehaviors | GetAnalysisBehaviors () |
Gets the AnalysisBehaviors object, or null if none exists. | |
EstablishmentBehaviors | GetEstablishmentBehaviors () |
Gets the EstablishmentBehaviors object, or null if none exists. | |
SubstrateBehaviors | GetSubstrateBehaviors () |
Gets the Substrate object. | |
MortalityBehaviors | GetMortalityBehaviors () |
Gets the MortalityBehaviors object. | |
GrowthBehaviors | GetGrowthBehaviors () |
Gets the GrowthBehaviors object. | |
Plot | GetPlot () |
Gets the Plot object. | |
TreePopulation | GetTreePopulation () |
Gets the tree population object. | |
Allometry | GetAllometry () |
Gets the allometry object. | |
DisturbanceBehaviors | GetDisturbanceBehaviors () |
Gets the disturbance behaviors object, or null if none exists. | |
PlantingBehaviors | GetPlantingBehaviors () |
Gets the planting behaviors object, or null if none exists. | |
LightBehaviors | GetLightBehaviors () |
Gets the light behaviors object. | |
RemoveDeadBehaviors | GetRemoveDeadBehaviors () |
Gets the remove dead behaviors object. | |
void | InputHarvestRegime (String sFileName) throws ModelException |
Reads in a harvest regime. | |
BehaviorTypeBase[] | GetAllBehaviorGroups () |
Gets all of the objects descended from BehaviorTypeBase. | |
Grid[] | GetAllGrids () |
Gets all of the Grid objects. | |
WorkerBase[] | GetAllObjects () |
Gets the array of managed objects. | |
void | DisplayRunParameters () |
Allows the user to edit parameters. | |
void | DisplayModelFlowWindow () |
Allows the user to edit simulation flow and behavior order. | |
JDialog | DisplayEpisodicEventsWindow () throws ModelException |
Allows the user to edit episodic event data. | |
void | ExtractParameters (JDialog jDataWindow) throws ModelException |
Extracts the data from the parameter window and passes it to objects. | |
void | DoSetup () throws ModelException |
Triggers the DoSetup() methods of all BehaviorTypeBase objects under management. | |
Grid | AddGrid (Grid oNewGrid) |
This adds a new grid object to the list. | |
Grid | GetGridByName (String sName) |
Finds a grid when provided with the grid's name. | |
void | ChangeOfSpeciesName (String sOldSpecies, String sNewSpecies) throws ModelException |
Changes the list of species names. | |
Protected Member Functions | |
void | InputXMLParameterFile (String sFileName) throws ModelException |
Inputs an XML parameter file. | |
void | InputXMLDataFile (String sFileName, JFrame oWindow) throws ModelException |
Inputs an XML file which is not a parameter type. | |
void | ValidateDataSet () throws ModelException |
Checks to see if the currently loaded dataset is adequate for creating a run and internally valid. | |
void | ClearCurrentData () throws ModelException |
This clears old settings in order to accept a new parameter file. | |
Protected Attributes | |
final String | PARAMETER_FILE = "01" |
This stands for the parameter file XML file type. | |
final String | DETAILED_OUTPUT_FILE = "06" |
This stands for the detailed output file XML file type. | |
final String | DETAILED_OUTPUT_TIMESTEP = "07" |
This stands for the detailed output timestep file XML file type. | |
final String | BATCH_FILE = "04" |
This stands for the batch file XML file type. | |
Private Attributes | |
String | m_sParameterFile |
Path and name of parameter currently loaded, if any. | |
boolean | m_bWasParameterFileModified |
Flag for whether or not a loaded parameter file was modified. | |
WorkerBase[] | mp_oManagedObjects |
This is an array of behaviors and populations, in the order in which they would appear in the parameter file. | |
Vector | mp_oManagedGrids = new Vector(0) |
Array of grid objects. | |
MainWindow | m_oMainWindow |
Pointer to main application window. |
It performs a function very similar to the Simulation Manager in the C++ code.
Copyright: Copyright (c) Charles D. Canham 2003
Company: Institute of Ecosystem Studies
javawrapper::GUIManager::GUIManager | ( | MainWindow | oWindow | ) | throws ModelException [inline] |
Constructor.
This creates the objects with no data in them so they can be filled during a new parameter file setup.
oWindow | Main application window. |
ModelException | if something goes wrong with object setup. |
void javawrapper::GUIManager::ChangeOfSpeciesName | ( | String | sOldSpecies, | |
String | sNewSpecies | |||
) | throws ModelException [inline] |
Changes the list of species names.
This will change any names on the grids and then call the same function for all WorkerBase-descended objects. This is called when 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 javawrapper::GUIManager::ClearCurrentData | ( | ) | throws ModelException [inline, protected] |
This clears old settings in order to accept a new parameter file.
If there's no current data, this will make sure everything is set up to accept new data.
The parameter file string is set to empty, and the parameter file modified flag is set to false.
ModelException | if there are any problems. |
void javawrapper::GUIManager::CreateNewParameterFile | ( | ) | throws ModelException [inline] |
Performs the actions necessary to start a new parameter file.
ModelException | if there is a problem with setup. |
JDialog javawrapper::GUIManager::DisplayEpisodicEventsWindow | ( | ) | throws ModelException [inline] |
Allows the user to edit episodic event data.
This specifically doesn't actually display the window. The MainWindow object that called this gets the option to resize it because it's so big. If I had lots of time, I'd do this for all windows.
ModelException | passing through from called methods. |
void javawrapper::GUIManager::DisplayGridSetupWindow | ( | ) | [inline] |
Displays the window which allows the user to set up grids.
Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
void javawrapper::GUIManager::DisplayHarvestInterfaceWindow | ( | ) | throws ModelException [inline] |
Displays the window which allows the user to set up the harvest interface.
ModelException | passing through from called functions |
void javawrapper::GUIManager::DisplayModelFlowWindow | ( | ) | [inline] |
Allows the user to edit simulation flow and behavior order.
Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
void javawrapper::GUIManager::DisplayOutputWindow | ( | ) | [inline] |
Display the window which allows the user to set up output options.
Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
void javawrapper::GUIManager::DisplayRunParameters | ( | ) | [inline] |
Allows the user to edit parameters.
Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
void javawrapper::GUIManager::DisplayTreeSetupWindow | ( | ) | [inline] |
Displays the window which allows the user to set up trees.
Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
void javawrapper::GUIManager::DoSetup | ( | ) | throws ModelException [inline] |
Triggers the DoSetup() methods of all BehaviorTypeBase objects under management.
ModelException | passed through from the BehaviorTypeBase objects. |
void javawrapper::GUIManager::ExtractParameters | ( | JDialog | jDataWindow | ) | throws ModelException [inline] |
Extracts the data from the parameter window and passes it to objects.
jDataWindow | Window holding parameters. |
ModelException | if the data extracted is invalid. |
BehaviorTypeBase [] javawrapper::GUIManager::GetAllBehaviorGroups | ( | ) | [inline] |
Gets all of the objects descended from BehaviorTypeBase.
Grid [] javawrapper::GUIManager::GetAllGrids | ( | ) | [inline] |
Gets all of the Grid objects.
WorkerBase [] javawrapper::GUIManager::GetAllObjects | ( | ) | [inline] |
Gets the array of managed objects.
Allometry javawrapper::GUIManager::GetAllometry | ( | ) | [inline] |
Gets the allometry object.
AnalysisBehaviors javawrapper::GUIManager::GetAnalysisBehaviors | ( | ) | [inline] |
Gets the AnalysisBehaviors object, or null if none exists.
String [] javawrapper::GUIManager::GetBehaviorList | ( | int | iSpecies, | |
int | iType | |||
) | [inline] |
Gets the descriptive names list of behaviors for a tree species/type combo.
iSpecies | Species | |
iType | Type |
DisperseBehaviors javawrapper::GUIManager::GetDisperseBehaviors | ( | ) | [inline] |
Gets the DisperseBehaviors object, or null if none exists.
DisturbanceBehaviors javawrapper::GUIManager::GetDisturbanceBehaviors | ( | ) | [inline] |
Gets the disturbance behaviors object, or null if none exists.
EstablishmentBehaviors javawrapper::GUIManager::GetEstablishmentBehaviors | ( | ) | [inline] |
Gets the EstablishmentBehaviors object, or null if none exists.
Grid javawrapper::GUIManager::GetGridByName | ( | String | sName | ) | [inline] |
GrowthBehaviors javawrapper::GUIManager::GetGrowthBehaviors | ( | ) | [inline] |
Gets the GrowthBehaviors object.
HelpBroker javawrapper::GUIManager::GetHelpBroker | ( | ) | [inline] |
Gets the HelpBroker object which manages help display for the entire application.
LightBehaviors javawrapper::GUIManager::GetLightBehaviors | ( | ) | [inline] |
Gets the light behaviors object.
MainWindow javawrapper::GUIManager::GetMainWindow | ( | ) | [inline] |
MortalityBehaviors javawrapper::GUIManager::GetMortalityBehaviors | ( | ) | [inline] |
Gets the MortalityBehaviors object.
OutputBehaviors javawrapper::GUIManager::GetOutputBehaviors | ( | ) | [inline] |
Gets the OutputBehaviors object, or null if none exists.
String javawrapper::GUIManager::GetParameterFileName | ( | ) | [inline] |
Gets the parameter file name.
PlantingBehaviors javawrapper::GUIManager::GetPlantingBehaviors | ( | ) | [inline] |
Gets the planting behaviors object, or null if none exists.
Plot javawrapper::GUIManager::GetPlot | ( | ) | [inline] |
RemoveDeadBehaviors javawrapper::GUIManager::GetRemoveDeadBehaviors | ( | ) | [inline] |
boolean javawrapper::GUIManager::GetSnagAwareness | ( | ) | throws ModelException [inline] |
Gets whether or not the run is snag-aware.
This searches through all behaviors looking for any that are applied to snags. If none, then the run is not snag-aware.
ModelException | passed through from called methods. Should never be thrown. |
SubstrateBehaviors javawrapper::GUIManager::GetSubstrateBehaviors | ( | ) | [inline] |
Gets the Substrate object.
TreePopulation javawrapper::GUIManager::GetTreePopulation | ( | ) | [inline] |
Gets the tree population object.
boolean javawrapper::GUIManager::HasParameterFileBeenModified | ( | ) | [inline] |
Whether or not the current parameter file has been modified.
void javawrapper::GUIManager::InputHarvestRegime | ( | String | sFileName | ) | throws ModelException [inline] |
Reads in a harvest regime.
Passes it off to the harvest and planting behaviors to do with it what they will. Currently this is not supported if the currently loaded parameter file is XML.
sFileName | Harvest regime file name. |
ModelException | If there is a problem reading the file. |
void javawrapper::GUIManager::InputTreeMap | ( | String | sFileName | ) | throws ModelException [inline] |
This passes a tree map file on to the tree population.
sFileName | Name of file. |
ModelException | if the tree population rejects the file. |
void javawrapper::GUIManager::InputXMLDataFile | ( | String | sFileName, | |
JFrame | oWindow | |||
) | throws ModelException [inline, protected] |
Inputs an XML file which is not a parameter type.
This would probably be a detailed output timestep file, a tree map, or a grid map. This method does not clear out existing data before parsing the file.
sFileName | XML parameter file name | |
oWindow | Parent application window |
ModelException | if the file cannot be parsed or is invalid. |
boolean javawrapper::GUIManager::InputXMLFile | ( | String | sFileName, | |
JFrame | oWindow | |||
) | throws ModelException [inline] |
Accepts an XML file for input.
The file type is determined, and then action is taken depending on type. If the file type is a parameter file or a detailed output setup file, existing data is cleared and then the file is parsed. If the file type is detailed output timestep, the user is asked whether they want to replace or add to existing data. The appropriate step is then taken.
sFileName | File name of file to input. | |
oWindow | Parent window. |
ModelException | if the file cannot be recognized, cannot be parsed, or is invalid; or if this is a data file and there is no parameter file loaded. |
void javawrapper::GUIManager::InputXMLParameterFile | ( | String | sFileName | ) | throws ModelException [inline, protected] |
Inputs an XML parameter file.
sFileName | XML parameter file name |
ModelException | if the file cannot be parsed or is invalid. |
String javawrapper::GUIManager::PrepToRun | ( | ) | throws ModelException [inline] |
Takes all loaded data and prepares a parameter file to pass to the core to run, returning the filename of the parameter file.
ModelException | if there are any data validation problems. |
void javawrapper::GUIManager::ProposeNewParameterFile | ( | ) | throws ModelException [inline] |
This can be used to propose that a new parameter file is being created.
If there is currently no parameter file name, this will accept the proposal and place the key "<New>" in the parameter file name. Then, everything is set as through there is a parameter file entered. All objects are allowed to DoSetup().
If it is not time to create a new parameter file, nothing happens.
This is called by the TreeSetup dialog when changes have been made because it's the first step in creating a new file. It does not know whether it's modifying an existing file or creating a new one, so it calls this so the GUIManager object can decide.
ModelException | if anything goes wrong with setup. |
void javawrapper::GUIManager::SetBehaviorList | ( | SpeciesTypeCombo | oToSet, | |
String[] | p_sBehaviors | |||
) | throws ModelException [inline] |
Sets the list of behaviors for a tree species/type combo.
This replaces any existing assignments.
oToSet | Species/type combo to set behaviors for | |
p_sBehaviors | String array of behavior DISPLAY names. |
ModelException | if there is an unrecognized behavior present. |
void javawrapper::GUIManager::ValidateDataSet | ( | ) | throws ModelException [inline, protected] |
Checks to see if the currently loaded dataset is adequate for creating a run and internally valid.
The dataset is valid if there is at least one behavior enabled, and each managed object successfully validates its internal data.
ModelException | if the dataset is not valid. |
boolean javawrapper::GUIManager::WriteParameterFile | ( | String | sFileName | ) | throws ModelException [inline] |
Writes out the XML parameter file with the current settings.
Note that it is not required that the data set be adequate or valid; this way work can be saved in progress. However, if the dataset is invalid, the user will be warned of that fact.
sFileName | Filename of new file. |
ModelException | If there is a problem validating the data or writing the file. |
final String javawrapper::GUIManager::BATCH_FILE = "04" [protected] |
This stands for the batch file XML file type.
This matches the value in the C++ file "DataTypes.h".
final String javawrapper::GUIManager::DETAILED_OUTPUT_FILE = "06" [protected] |
This stands for the detailed output file XML file type.
This matches the value in the C++ file "DataTypes.h".
final String javawrapper::GUIManager::DETAILED_OUTPUT_TIMESTEP = "07" [protected] |
This stands for the detailed output timestep file XML file type.
This matches the value in the C++ file "DataTypes.h".
Vector javawrapper::GUIManager::mp_oManagedGrids = new Vector(0) [private] |
Array of grid objects.
BehaviorTypeBase objects create the members of this grid.
final String javawrapper::GUIManager::PARAMETER_FILE = "01" [protected] |
This stands for the parameter file XML file type.
This matches the value in the C++ file "DataTypes.h".