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 | DisplayTreeSpeciesSetupWindow () |
Displays the window which allows the user to set up tree species. | |
void | DisplayTreeSizeClassEditor () |
Displays the window which allows the user to set up tree initial density size classes. | |
void | DisplayTreeAllometryFunctionEditor () |
Displays the window which allows the user to edit the allometry functions. | |
void | DisplayManageTreeMap () throws ModelException |
Displays the window which allows the user to manage tree maps. | |
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 | DisplayScheduleStormsWindow () throws ModelException |
Displays the window which allows the user to schedule storms. | |
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. | |
SeedPredationBehaviors | GetSeedPredationBehaviors () |
Gets the SeedPredationBehaviors object, or null if none exists. | |
SnagDynamicsBehaviors | GetSnagDynamicsBehaviors () |
Gets the SnagDynamicsBehaviors 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. | |
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. | |
void | CopySpecies (int iSpeciesCopyFrom, int iSpeciesCopyTo) throws ModelException |
Performs any necessary tasks associated with copying one species to another. | |
void | ChangeOfSpecies (int iOldNumSpecies, int[] p_iIndexer, String[] p_sNewSpecies) throws ModelException |
Changes the list of species names. | |
void | ChangeOfPlotResolution (float fOldX, float fOldY, float fNewX, float fNewY) throws ModelException |
This takes a change of plot resolution and deals with any grid maps found. | |
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 | |
WorkerBase[] | mp_oManagedObjects |
This is an array of behaviors and populations, in the order in which they would appear in the parameter file. | |
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. | |
Vector< Grid > | mp_oManagedGrids = new Vector<Grid>(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 |
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. |
boolean javawrapper.GUIManager.HasParameterFileBeenModified | ( | ) |
Whether or not the current parameter file has been modified.
HelpBroker javawrapper.GUIManager.GetHelpBroker | ( | ) |
Gets the HelpBroker object which manages help display for the entire application.
void javawrapper.GUIManager.ProposeNewParameterFile | ( | ) | throws ModelException |
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. |
String javawrapper.GUIManager.GetParameterFileName | ( | ) |
Gets the parameter file name.
void javawrapper.GUIManager.DisplayOutputWindow | ( | ) |
Display the window which allows the user to set up output options.
void javawrapper.GUIManager.DisplayTreeSpeciesSetupWindow | ( | ) |
Displays the window which allows the user to set up tree species.
void javawrapper.GUIManager.DisplayTreeSizeClassEditor | ( | ) |
Displays the window which allows the user to set up tree initial density size classes.
void javawrapper.GUIManager.DisplayTreeAllometryFunctionEditor | ( | ) |
Displays the window which allows the user to edit the allometry functions.
void javawrapper.GUIManager.DisplayManageTreeMap | ( | ) | throws ModelException |
Displays the window which allows the user to manage tree maps.
void javawrapper.GUIManager.DisplayGridSetupWindow | ( | ) |
Displays the window which allows the user to set up grids.
void javawrapper.GUIManager.DisplayHarvestInterfaceWindow | ( | ) | throws ModelException |
Displays the window which allows the user to set up the harvest interface.
ModelException | passing through from called functions |
void javawrapper.GUIManager.DisplayScheduleStormsWindow | ( | ) | throws ModelException |
Displays the window which allows the user to schedule storms.
ModelException | passing through from called functions |
void javawrapper.GUIManager.InputTreeMap | ( | String | sFileName | ) | throws ModelException |
This passes a tree map file on to the tree population.
sFileName | Name of file. |
ModelException | if the tree population rejects the file. |
boolean javawrapper.GUIManager.InputXMLFile | ( | String | sFileName, | |
JFrame | oWindow | |||
) | throws ModelException |
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 [protected] |
Inputs an XML parameter file.
sFileName | XML parameter file name |
ModelException | if the file cannot be parsed or is invalid. |
void javawrapper.GUIManager.InputXMLDataFile | ( | String | sFileName, | |
JFrame | oWindow | |||
) | throws ModelException [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.GetSnagAwareness | ( | ) | throws ModelException |
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. |
void javawrapper.GUIManager.ValidateDataSet | ( | ) | throws ModelException [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 |
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. |
MainWindow javawrapper.GUIManager.GetMainWindow | ( | ) |
String [] javawrapper.GUIManager.GetBehaviorList | ( | int | iSpecies, | |
int | iType | |||
) |
Gets the descriptive names list of behaviors for a tree species/type combo.
iSpecies | Species | |
iType | Type |
void javawrapper.GUIManager.SetBehaviorList | ( | SpeciesTypeCombo | oToSet, | |
String[] | p_sBehaviors | |||
) | throws ModelException |
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. |
String javawrapper.GUIManager.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.
ModelException | if there are any data validation problems. |
void javawrapper.GUIManager.CreateNewParameterFile | ( | ) | throws ModelException |
Performs the actions necessary to start a new parameter file.
ModelException | if there is a problem with setup. |
void javawrapper.GUIManager.ClearCurrentData | ( | ) | throws ModelException [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. |
OutputBehaviors javawrapper.GUIManager.GetOutputBehaviors | ( | ) |
DisperseBehaviors javawrapper.GUIManager.GetDisperseBehaviors | ( | ) |
SeedPredationBehaviors javawrapper.GUIManager.GetSeedPredationBehaviors | ( | ) |
Gets the SeedPredationBehaviors object, or null if none exists.
SnagDynamicsBehaviors javawrapper.GUIManager.GetSnagDynamicsBehaviors | ( | ) |
Gets the SnagDynamicsBehaviors object, or null if none exists.
AnalysisBehaviors javawrapper.GUIManager.GetAnalysisBehaviors | ( | ) |
EstablishmentBehaviors javawrapper.GUIManager.GetEstablishmentBehaviors | ( | ) |
Gets the EstablishmentBehaviors object, or null if none exists.
SubstrateBehaviors javawrapper.GUIManager.GetSubstrateBehaviors | ( | ) |
Gets the Substrate object.
MortalityBehaviors javawrapper.GUIManager.GetMortalityBehaviors | ( | ) |
GrowthBehaviors javawrapper.GUIManager.GetGrowthBehaviors | ( | ) |
Plot javawrapper.GUIManager.GetPlot | ( | ) |
TreePopulation javawrapper.GUIManager.GetTreePopulation | ( | ) |
Allometry javawrapper.GUIManager.GetAllometry | ( | ) |
DisturbanceBehaviors javawrapper.GUIManager.GetDisturbanceBehaviors | ( | ) |
Gets the disturbance behaviors object, or null if none exists.
PlantingBehaviors javawrapper.GUIManager.GetPlantingBehaviors | ( | ) |
Gets the planting behaviors object, or null if none exists.
LightBehaviors javawrapper.GUIManager.GetLightBehaviors | ( | ) |
RemoveDeadBehaviors javawrapper.GUIManager.GetRemoveDeadBehaviors | ( | ) |
BehaviorTypeBase [] javawrapper.GUIManager.GetAllBehaviorGroups | ( | ) |
Grid [] javawrapper.GUIManager.GetAllGrids | ( | ) |
WorkerBase [] javawrapper.GUIManager.GetAllObjects | ( | ) |
Gets the array of managed objects.
void javawrapper.GUIManager.DisplayRunParameters | ( | ) |
Allows the user to edit parameters.
void javawrapper.GUIManager.DisplayModelFlowWindow | ( | ) |
Allows the user to edit simulation flow and behavior order.
JDialog javawrapper.GUIManager.DisplayEpisodicEventsWindow | ( | ) | throws ModelException |
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.ExtractParameters | ( | JDialog | jDataWindow | ) | throws ModelException |
Extracts the data from the parameter window and passes it to objects.
jDataWindow | Window holding parameters. |
ModelException | if the data extracted is invalid. |
void javawrapper.GUIManager.DoSetup | ( | ) | throws ModelException |
Triggers the DoSetup() methods of all BehaviorTypeBase objects under management.
ModelException | passed through from the BehaviorTypeBase objects. |
Grid javawrapper.GUIManager.GetGridByName | ( | String | sName | ) |
void javawrapper.GUIManager.ChangeOfSpeciesName | ( | String | sOldSpecies, | |
String | sNewSpecies | |||
) | throws ModelException |
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.CopySpecies | ( | int | iSpeciesCopyFrom, | |
int | iSpeciesCopyTo | |||
) | throws ModelException |
Performs any necessary tasks associated with copying one species to another.
This causes the change to propagate throughout the WorkerBase objects.
iSpeciesCopyFrom | int Species to copy. | |
iSpeciesCopyTo | int Species that is the copy. |
ModelException | if there is a problem. |
void javawrapper.GUIManager.ChangeOfSpecies | ( | int | iOldNumSpecies, | |
int[] | p_iIndexer, | |||
String[] | p_sNewSpecies | |||
) | throws ModelException |
Changes the list of species names.
This will call the same function for all WorkerBase-descended objects.
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, as the tree population would use it, with underscores instead of spaces. |
ModelException | if there is a problem. |
void javawrapper.GUIManager.ChangeOfPlotResolution | ( | float | fOldX, | |
float | fOldY, | |||
float | fNewX, | |||
float | fNewY | |||
) | throws ModelException |
This takes a change of plot resolution and deals with any grid maps found.
If the plot shrinks, the maps are trimmed to fit.
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 there is a problem. |
String javawrapper.GUIManager.m_sParameterFile [private] |
Path and name of parameter currently loaded, if any.
boolean javawrapper.GUIManager.m_bWasParameterFileModified [private] |
Flag for whether or not a loaded parameter file was modified.
WorkerBase [] javawrapper.GUIManager.mp_oManagedObjects [protected] |
This is an array of behaviors and populations, in the order in which they would appear in the parameter file.
I have this as protected instead of private so I can do outrageous testing manipulations
Vector<Grid> javawrapper.GUIManager.mp_oManagedGrids = new Vector<Grid>(0) [private] |
Array of grid objects.
BehaviorTypeBase objects create the members of this grid.
Pointer to main application window.
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".
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".
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".