javawrapper::ModelFlowSetup Class Reference

Allows users to make changes to the model flow and behavior order. More...

List of all members.

Public Member Functions

 ModelFlowSetup (JFrame oParent, GUIManager oManager)
 Constructor.
void actionPerformed (ActionEvent e)
 Controls actions for this window.
void valueChanged (javax.swing.event.TreeSelectionEvent e)
 Detects user clicks on the tree.

Protected Member Functions

void SetBehaviorList (int iSpecies, int iType, String[] p_sBehaviors) throws ModelException
 Sets the behavior list for a species/type combo in the temporary list held in this object.
void CreateGUI () throws ModelException
 Draws the window displaying the data as a tree.
Vector GetBehaviorList (int iSpecies, int iType) throws ModelException
 Gets a vector of behavior names for a type/species combo from our temporary behavior copy set.
Vector GetBehaviorList (String sGridName) throws ModelException
 Gets the enabled behaviors that apply to a grid from our temporary behavior copy set.
void BuildTypeFirstTree (DefaultMutableTreeNode jRoot) throws ModelException
 Builds the tree displayed in the window with data first; for trees, the branch levels are type, then species, then behavior list.
void BuildSpeciesFirstTree (DefaultMutableTreeNode jRoot) throws ModelException
 Builds the tree displayed in the window with data first; for trees, the branch levels are species, then type, then behavior list.
void BuildBehaviorFirstTree (DefaultMutableTreeNode jRoot) throws ModelException
 Builds a tree where the first level is behavior; the second is data, with trees being type first, then species.
DefaultMutableTreeNode BuildGridNode () throws ModelException
 Builds a node for Grid data.
void BuildTree () throws ModelException
 Builds the tree displayed in the window.
void AssignData () throws ModelException
 Assigns the changes made in this dialog back to the behavior groups.
void UpdateBehaviorChoices (JComboBox jBehaviorGroupBox, DefaultListModel jIndividualBehaviorListModel)
 A common function for those dialogs which contain a list of behavior groups, a choice upon which populates individual behaviors into another list.
String[] GetBehaviorAddName (JList jBehaviorList, DefaultListModel jBehaviorListModel, DefaultListModel jListToAddTo)
 Common function for those dialogs which add a behavior to a list.

Protected Attributes

GUIManager m_oManager
 GUIManager object.
JTree m_jTree = null
 Tree showing flow.
DefaultTreeModel m_jTreeModel
 Data model of tree showing flow.
TreePopulation m_oPop
 TreePopulation object.
String[] mp_sBehaviorGroupNames = null
 List of behavior groups.
String[] mp_sGridNames = null
 List of grid names.
Behavior[][] mp_oBehaviors
 Our copy of the Behaviors.
Dimension m_oMaxDimension
 Max dimensions of the main program flow dialog.
final int BEHAVIOR_FIRST = 0
 Flag indicating that the tree should display behaviors at the highest level.
final int TYPE_FIRST = 1
 Flag indicating that the tree should display data at the highest level, and for trees, type at a higher level than species.
final int SPECIES_FIRST = 2
 Flag indicating that the tree should display data at the highest level, and for trees, species at a higher level than type.
int m_iMode = TYPE_FIRST
 Mode by which the tree should be built - will be one of the finals below.

Private Attributes

String m_sHelpID = "windows.model_flow_window"
 The ID of the help topic corresponding to this window.

Classes

class  BehaviorIndexer
 Class which packages individual behavior names with an index number. More...
class  DisplayBehaviorComboEdit
 Displays an edit window for editing the tree species/type combos to which a single behavior applies. More...
class  DisplayBehaviorEdit
 Displays the edit window for editing behavior order. More...
class  DisplayComboEdit
 Displays the edit window for editing behavior flow for a tree species/ type combo. More...
class  ListRenderer
 Provides multi-line text wrapping to our list boxes. More...
class  TreeNodeInfo
 Objects set in tree nodes to give information about what to do when the user clicks a node. More...


Detailed Description

Allows users to make changes to the model flow and behavior order.

Copyright: Copyright (c) 2003 Charles D. Canham

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::ModelFlowSetup::ModelFlowSetup ( JFrame  oParent,
GUIManager  oManager 
) [inline]

Constructor.

Parameters:
oParent Window which is the parent of this dialog.
oManager GUIManager object.

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


Member Function Documentation

void javawrapper::ModelFlowSetup::actionPerformed ( ActionEvent  e  )  [inline]

Controls actions for this window.

Parameters:
e ActionEvent.

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

void javawrapper::ModelFlowSetup::AssignData (  )  throws ModelException [inline, protected]

Assigns the changes made in this dialog back to the behavior groups.

First the behavior settings are validated, and then they are copied back in order to the behavior groups.

Exceptions:
ModelException if the settings are invalid.

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

void javawrapper::ModelFlowSetup::BuildBehaviorFirstTree ( DefaultMutableTreeNode  jRoot  )  throws ModelException [inline, protected]

Builds a tree where the first level is behavior; the second is data, with trees being type first, then species.

Parameters:
jRoot Node upon which to build the tree.
Exceptions:
ModelException passed through from called methods.

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

DefaultMutableTreeNode javawrapper::ModelFlowSetup::BuildGridNode (  )  throws ModelException [inline, protected]

Builds a node for Grid data.

First level is grid name, second level is behavior.

Returns:
Root grid node.
Exceptions:
ModelException passed through from called methods.

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

void javawrapper::ModelFlowSetup::BuildSpeciesFirstTree ( DefaultMutableTreeNode  jRoot  )  throws ModelException [inline, protected]

Builds the tree displayed in the window with data first; for trees, the branch levels are species, then type, then behavior list.

Parameters:
jRoot Node upon which the tree is built.
Exceptions:
ModelException passed through from called methods.

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

void javawrapper::ModelFlowSetup::BuildTree (  )  throws ModelException [inline, protected]

Builds the tree displayed in the window.

If it already exists, it will be torn down and recreated.

Exceptions:
ModelException passed through from called methods.

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

void javawrapper::ModelFlowSetup::BuildTypeFirstTree ( DefaultMutableTreeNode  jRoot  )  throws ModelException [inline, protected]

Builds the tree displayed in the window with data first; for trees, the branch levels are type, then species, then behavior list.

Parameters:
jRoot Node upon which the tree is built.
Exceptions:
ModelException passed through from called methods.

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

void javawrapper::ModelFlowSetup::CreateGUI (  )  throws ModelException [inline, protected]

Draws the window displaying the data as a tree.

Exceptions:
ModelException passed through from called methods.

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

String [] javawrapper::ModelFlowSetup::GetBehaviorAddName ( JList  jBehaviorList,
DefaultListModel  jBehaviorListModel,
DefaultListModel  jListToAddTo 
) [inline, protected]

Common function for those dialogs which add a behavior to a list.

This extracts chosen behaviors' names, returning null if no behavior should be added. THIS DOES NOT ACTUALLY ADD THE NAME TO THE TARGET LIST.

The behavior name is left null if there is no index selected, or if no selection is eligible. Selections are ineligible if the behavior name starts with "--", or if the behavior is already on the target list.

Parameters:
jBehaviorList The list from which the new behavior name is coming.
jBehaviorListModel The list model from which the new behavior name is coming.
jListToAddTo The list that is the intended target for the new behavior.
Returns:
List of behavior names to add.

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

Vector javawrapper::ModelFlowSetup::GetBehaviorList ( String  sGridName  )  throws ModelException [inline, protected]

Gets the enabled behaviors that apply to a grid from our temporary behavior copy set.

Parameters:
sGridName Name of the grid.
Returns:
Vector of behavior names.
Exceptions:
ModelException passed through from called methods.

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

Vector javawrapper::ModelFlowSetup::GetBehaviorList ( int  iSpecies,
int  iType 
) throws ModelException [inline, protected]

Gets a vector of behavior names for a type/species combo from our temporary behavior copy set.

Parameters:
iSpecies Tree species.
iType Tree type.
Returns:
Vector of behavior names.
Exceptions:
ModelException passed through from called methods.

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

void javawrapper::ModelFlowSetup::SetBehaviorList ( int  iSpecies,
int  iType,
String[]  p_sBehaviors 
) throws ModelException [inline, protected]

Sets the behavior list for a species/type combo in the temporary list held in this object.

This does NOT make the changes in the official list held in the GUIManager object. The GUI is updated to reflect changes.

Parameters:
iSpecies Species to set for.
iType Type to set for.
p_sBehaviors List of behavior display names.
Exceptions:
ModelException passed through from called methods.

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

void javawrapper::ModelFlowSetup::UpdateBehaviorChoices ( JComboBox  jBehaviorGroupBox,
DefaultListModel  jIndividualBehaviorListModel 
) [inline, protected]

A common function for those dialogs which contain a list of behavior groups, a choice upon which populates individual behaviors into another list.

If there is no choice, nothing happens. If the behavior group is "Planting" or "Output", instead of behavior choices the string "--Use this behavior's own dialog" will be displayed.

Parameters:
jBehaviorGroupBox The combo box displaying the behavior groupings.
jIndividualBehaviorListModel The list model for the individual behavior choices list to be updated.

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

void javawrapper::ModelFlowSetup::valueChanged ( javax.swing.event.TreeSelectionEvent  e  )  [inline]

Detects user clicks on the tree.

Parameters:
e TreeSelectionEvent

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


Member Data Documentation

Behavior [][] javawrapper::ModelFlowSetup::mp_oBehaviors [protected]

Our copy of the Behaviors.

The first index is behavior group number; the second is a list of all Behaviors for that group, in order. These are clones, so we can mess with them here, and then load the data back when we're done.


The documentation for this class was generated from the following file:
Generated on Wed Nov 29 08:45:05 2006 for SORTIE Java Interface by  doxygen 1.4.7