javawrapper::GUIManager Class Reference

The GUI manager provides all behind-the-scenes functionality for the Main Window. More...

List of all members.

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 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 ()
void InputHarvestRegime (String sFileName) throws ModelException
 Reads in a harvest regime.
BehaviorTypeBase[] GetAllBehaviorGroups ()
 Gets all of the objects descended from BehaviorTypeBase.
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.

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.
MainWindow m_oMainWindow
 Pointer to main application window.


Detailed Description

The GUI manager provides all behind-the-scenes functionality for the Main 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

Author:
Lora E. Murphy
Version:
1.0

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)


Constructor & Destructor Documentation

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.

Parameters:
oWindow Main application window.
Exceptions:
ModelException if something goes wrong with object setup.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)


Member Function Documentation

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.

Exceptions:
ModelException if there are any problems.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::GUIManager::CreateNewParameterFile  )  throws ModelException [inline]
 

Performs the actions necessary to start a new parameter file.

Exceptions:
ModelException if there is a problem with setup.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Exceptions:
ModelException passing through from called methods.
Returns:
The new window.

Edit history:
------------------
May 4, 2004: Created (LEM)

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::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.

Exceptions:
ModelException passed through from the BehaviorTypeBase objects.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::GUIManager::ExtractParameters JDialog  jDataWindow  )  throws ModelException [inline]
 

Extracts the data from the parameter window and passes it to objects.

Parameters:
jDataWindow Window holding parameters.
Exceptions:
ModelException if the data extracted is invalid.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

BehaviorTypeBase [] javawrapper::GUIManager::GetAllBehaviorGroups  )  [inline]
 

Gets all of the objects descended from BehaviorTypeBase.

Returns:
An array of behaviors.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

WorkerBase [] javawrapper::GUIManager::GetAllObjects  )  [inline]
 

Gets the array of managed objects.

Returns:
The array of managed objects.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

Allometry javawrapper::GUIManager::GetAllometry  )  [inline]
 

Gets the allometry object.

Returns:
Allometry object, or null if none exists.

Edit history:
------------------
April 25, 2005: Created (LEM)

AnalysisBehaviors javawrapper::GUIManager::GetAnalysisBehaviors  )  [inline]
 

Gets the AnalysisBehaviors object, or null if none exists.

Returns:
AnalysisBehaviors object.

Edit history:
------------------
October 27, 2004: Created in beta version (LEM)

String [] javawrapper::GUIManager::GetBehaviorList int  iSpecies,
int  iType
[inline]
 

Gets the descriptive names list of behaviors for a tree species/type combo.

Parameters:
iSpecies Species
iType Type
Returns:
String array of behavior names.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

DisperseBehaviors javawrapper::GUIManager::GetDisperseBehaviors  )  [inline]
 

Gets the DisperseBehaviors object, or null if none exists.

Returns:
DisperseBehaviors object.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

DisturbanceBehaviors javawrapper::GUIManager::GetDisturbanceBehaviors  )  [inline]
 

Gets the disturbance behaviors object, or null if none exists.

Returns:
DisturbanceBehaviors object, or null if none exists.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

EstablishmentBehaviors javawrapper::GUIManager::GetEstablishmentBehaviors  )  [inline]
 

Gets the EstablishmentBehaviors object, or null if none exists.

Returns:
EstablishmentBehaviors object.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

GrowthBehaviors javawrapper::GUIManager::GetGrowthBehaviors  )  [inline]
 

Gets the GrowthBehaviors object.

Returns:
GrowthBehaviors object, or null if none exists.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

HelpBroker javawrapper::GUIManager::GetHelpBroker  )  [inline]
 

Gets the HelpBroker object which manages help display for the entire application.

Returns:
System HelpBroker object.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

LightBehaviors javawrapper::GUIManager::GetLightBehaviors  )  [inline]
 

Gets the light behaviors object.

Returns:
LightBehaviors object, or null if none exists.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

MainWindow javawrapper::GUIManager::GetMainWindow  )  [inline]
 

Gets the MainWindow object.

Returns:
MainWindow MainWindow object.

MortalityBehaviors javawrapper::GUIManager::GetMortalityBehaviors  )  [inline]
 

Gets the MortalityBehaviors object.

Returns:
MortalityBehaviors object, or null if none exists.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

OutputBehaviors javawrapper::GUIManager::GetOutputBehaviors  )  [inline]
 

Gets the OutputBehaviors object, or null if none exists.

Returns:
OutputBehaviors object.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

String javawrapper::GUIManager::GetParameterFileName  )  [inline]
 

Gets the parameter file name.

Returns:
The parameter file name.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

PlantingBehaviors javawrapper::GUIManager::GetPlantingBehaviors  )  [inline]
 

Gets the planting behaviors object, or null if none exists.

Returns:
PlantingBehaviors object, or null if none exists.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

Plot javawrapper::GUIManager::GetPlot  )  [inline]
 

Gets the Plot object.

Returns:
Plot object, or null if none exists.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Returns:
True if the run has any snags anywhere; false if it doesn't.
Exceptions:
ModelException passed through from called methods. Should never be thrown.

SubstrateBehaviors javawrapper::GUIManager::GetSubstrateBehaviors  )  [inline]
 

Gets the Substrate object.

Returns:
Substrate object, or null if none exists.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

TreePopulation javawrapper::GUIManager::GetTreePopulation  )  [inline]
 

Gets the tree population object.

Returns:
TreePopulation object, or null if none exists.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

boolean javawrapper::GUIManager::HasParameterFileBeenModified  )  [inline]
 

Whether or not the current parameter file has been modified.

Returns:
true if modified, false if not.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
sFileName Harvest regime file name.
Exceptions:
ModelException If there is a problem reading the file.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::GUIManager::InputTreeMap String  sFileName  )  throws ModelException [inline]
 

This passes a tree map file on to the tree population.

Parameters:
sFileName Name of file.
Exceptions:
ModelException if the tree population rejects the file.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
sFileName XML parameter file name
oWindow Parent application window
Exceptions:
ModelException if the file cannot be parsed or is invalid.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
sFileName File name of file to input.
oWindow Parent window.
Exceptions:
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.
Returns:
boolean Whether the file that was read was a data file. A batch file causes this to be false; all else is true (assuming no errors).

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::GUIManager::InputXMLParameterFile String  sFileName  )  throws ModelException [inline, protected]
 

Inputs an XML parameter file.

Parameters:
sFileName XML parameter file name
Exceptions:
ModelException if the file cannot be parsed or is invalid.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Returns:
The filename of the parameter file which can be passed to the core code.
Exceptions:
ModelException if there are any data validation problems.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Exceptions:
ModelException if anything goes wrong with setup.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
oToSet Species/type combo to set behaviors for
p_sBehaviors String array of behavior DISPLAY names.
Exceptions:
ModelException if there is an unrecognized behavior present.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Exceptions:
ModelException if the dataset is not valid.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

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.

Parameters:
sFileName Filename of new file.
Returns:
Whether or not a file was saved.
Exceptions:
ModelException If there is a problem validating the data or writing the file.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)


Member Data Documentation

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".

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".


The documentation for this class was generated from the following file:
Generated on Mon Mar 27 15:15:39 2006 for SORTIE Java Interface by  doxygen 1.4.6-NO