SORTIE Java Interface  1
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
sortie.gui.modelflowsetup.ModelFlowSetup Class Reference

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

Inheritance diagram for sortie.gui.modelflowsetup.ModelFlowSetup:

Public Member Functions

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

Protected Member Functions

void setBehaviorList (ArrayList< SpeciesTypeCombo > p_oCombos, ArrayList< BehaviorPackager > p_oBehaviors) throws ModelException
 Sets the behavior list for a set of species/type combo in the temporary list held in this object. More...
 
void createGUI () throws ModelException
 Draws the window displaying the data as a tree. More...
 
ArrayList< String > getBehaviorList (int iSpecies, int iType) throws ModelException
 Gets a vector of behavior names for a type/species combo from our temporary behavior copy set. More...
 
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. More...
 
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. More...
 
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. More...
 
void buildTree () throws ModelException
 Builds the tree displayed in the window. More...
 
void assignData () throws ModelException
 Assigns the changes made in this dialog back to the behavior groups. More...
 
void updateBehaviorChoices (JComboBox< String > jBehaviorGroupBox, DefaultListModel< BehaviorPackager > jIndividualBehaviorListModel)
 A common function for those dialogs which contain a list of behavior groups, a choice upon which populates individual behaviors into another list. More...
 

Protected Attributes

GUIManager m_oManager
 GUIManager object. More...
 
JTree m_jTree = null
 Tree showing flow. More...
 
DefaultTreeModel m_jTreeModel
 Data model of tree showing flow. More...
 
TreePopulation m_oPop
 TreePopulation object. More...
 
ArrayList< String > mp_sBehaviorGroupNames = null
 List of behavior groups. More...
 
ArrayList< BehaviorTypeBasemp_oBehaviorGroups = null
 List of behavior groups. More...
 
ArrayList< ArrayList< BehaviorPackager > > mp_oBehaviors
 Our copy of the Behaviors. More...
 
Dimension m_oMaxDimension
 Max dimensions of the main program flow dialog. More...
 
final int BEHAVIOR_FIRST = 0
 Flag indicating that the tree should display behaviors at the highest level. More...
 
int m_iMode = TYPE_FIRST
 Mode by which the tree should be built - will be one of the finals below. More...
 

Private Member Functions

void getDataTreeExpandedPaths ()
 This method will identify the expanded nodes in a type- or species-first tree. More...
 
void getBehaviorTreeExpandedPaths ()
 This method saves the expanded nodes in a behavior-first tree. More...
 
void restoreDataTreeExpandedPaths ()
 This causes a type- or species-first tree to have the appropriate paths re-expanded. More...
 
void restoreBehaviorTreeExpandedPaths ()
 This causes a behavior-first tree to have the appropriate paths re-expanded. More...
 
boolean isRightNode (DefaultMutableTreeNode node, String childstring)
 Determines if a chosen behavior node matches the string describing the nodes. More...
 

Private Attributes

String m_sHelpID = "windows.model_flow_window"
 The ID of the help topic corresponding to this window. More...
 
ArrayList< String > treeState = null
 

Detailed Description

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

Copyright: Copyright (c) 2003 Charles D. Canham

Company: Cary Institute of Ecosystem Studies

Author
Lora E. Murphy
Version
1.0


Edit history:
---------------—
December 8, 2011: Wiped the slate clean for version 7 (LEM)

Constructor & Destructor Documentation

◆ ModelFlowSetup()

sortie.gui.modelflowsetup.ModelFlowSetup.ModelFlowSetup ( JFrame  oParent,
GUIManager  oManager 
)

Constructor.

Parameters
oParentWindow which is the parent of this dialog.
oManagerGUIManager object.

Member Function Documentation

◆ actionPerformed()

void sortie.gui.modelflowsetup.ModelFlowSetup.actionPerformed ( ActionEvent  e)

Controls actions for this window.

Parameters
eActionEvent.

◆ assignData()

void sortie.gui.modelflowsetup.ModelFlowSetup.assignData ( ) throws ModelException
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
ModelExceptionif the settings are invalid.

◆ buildBehaviorFirstTree()

void sortie.gui.modelflowsetup.ModelFlowSetup.buildBehaviorFirstTree ( DefaultMutableTreeNode  jRoot) throws ModelException
protected

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

Parameters
jRootNode upon which to build the tree.
Exceptions
ModelExceptionpassed through from called methods.

◆ buildSpeciesFirstTree()

void sortie.gui.modelflowsetup.ModelFlowSetup.buildSpeciesFirstTree ( DefaultMutableTreeNode  jRoot) throws ModelException
protected

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

Parameters
jRootNode upon which the tree is built.
Exceptions
ModelExceptionpassed through from called methods.

◆ buildTree()

void sortie.gui.modelflowsetup.ModelFlowSetup.buildTree ( ) throws ModelException
protected

Builds the tree displayed in the window.

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

Exceptions
ModelExceptionpassed through from called methods.

◆ buildTypeFirstTree()

void sortie.gui.modelflowsetup.ModelFlowSetup.buildTypeFirstTree ( DefaultMutableTreeNode  jRoot) throws ModelException
protected

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

Parameters
jRootNode upon which the tree is built.
Exceptions
ModelExceptionpassed through from called methods.

◆ createGUI()

void sortie.gui.modelflowsetup.ModelFlowSetup.createGUI ( ) throws ModelException
protected

Draws the window displaying the data as a tree.

Exceptions
ModelExceptionpassed through from called methods.

◆ getBehaviorList()

ArrayList<String> sortie.gui.modelflowsetup.ModelFlowSetup.getBehaviorList ( int  iSpecies,
int  iType 
) throws ModelException
protected

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

Parameters
iSpeciesTree species.
iTypeTree type.
Returns
Vector of behavior names.
Exceptions
ModelExceptionpassed through from called methods.

◆ getBehaviorTreeExpandedPaths()

void sortie.gui.modelflowsetup.ModelFlowSetup.getBehaviorTreeExpandedPaths ( )
private

This method saves the expanded nodes in a behavior-first tree.

Behaviors must be uniquely identified by their applied trees, since there might be multiple instances. In some cases we simply cannot uniquely identify behaviors. All behaviors matching a given string will be expanded. That's just gotta be fine.

To identify a behavior with no applied trees: behaviorname

To identify a behavior with applied trees: behaviorname|type*species|type*species...

To identify a type expanded below a behavior: ?type|behaviorname|type*species|type*species...

◆ getDataTreeExpandedPaths()

void sortie.gui.modelflowsetup.ModelFlowSetup.getDataTreeExpandedPaths ( )
private

This method will identify the expanded nodes in a type- or species-first tree.

First-level nodes will be listed as just node name. Second-level nodes will be listed as firstnode*secondnode.

◆ isRightNode()

boolean sortie.gui.modelflowsetup.ModelFlowSetup.isRightNode ( DefaultMutableTreeNode  node,
String  childstring 
)
private

Determines if a chosen behavior node matches the string describing the nodes.

This string was built by getBehaviorTreeExpandedPaths() and has the behavior name trimmed off of it.

Parameters
nodeNode to test.
childstringString describing subnodes of behavior.
Returns
True if it's a match, false if not.

◆ restoreBehaviorTreeExpandedPaths()

void sortie.gui.modelflowsetup.ModelFlowSetup.restoreBehaviorTreeExpandedPaths ( )
private

This causes a behavior-first tree to have the appropriate paths re-expanded.

◆ restoreDataTreeExpandedPaths()

void sortie.gui.modelflowsetup.ModelFlowSetup.restoreDataTreeExpandedPaths ( )
private

This causes a type- or species-first tree to have the appropriate paths re-expanded.

◆ setBehaviorList()

void sortie.gui.modelflowsetup.ModelFlowSetup.setBehaviorList ( ArrayList< SpeciesTypeCombo p_oCombos,
ArrayList< BehaviorPackager p_oBehaviors 
) throws ModelException
protected

Sets the behavior list for a set of 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
p_oCombosSpecies/type combos to set the behaviors for.
p_oBehaviorsBehaviors to set to the combos.
Exceptions
ModelExceptionpassed through from called methods.

◆ updateBehaviorChoices()

void sortie.gui.modelflowsetup.ModelFlowSetup.updateBehaviorChoices ( JComboBox< String >  jBehaviorGroupBox,
DefaultListModel< BehaviorPackager jIndividualBehaviorListModel 
)
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.

Parameters
jBehaviorGroupBoxThe combo box displaying the behavior groupings.
jIndividualBehaviorListModelThe list model for the individual behavior choices list to be updated.

◆ valueChanged()

void sortie.gui.modelflowsetup.ModelFlowSetup.valueChanged ( TreeSelectionEvent  e)

Detects user clicks on the tree.

Parameters
eTreeSelectionEvent

Member Data Documentation

◆ BEHAVIOR_FIRST

final int sortie.gui.modelflowsetup.ModelFlowSetup.BEHAVIOR_FIRST = 0
protected

Flag indicating that the tree should display behaviors at the highest level.

◆ m_iMode

int sortie.gui.modelflowsetup.ModelFlowSetup.m_iMode = TYPE_FIRST
protected

Mode by which the tree should be built - will be one of the finals below.

◆ m_jTree

JTree sortie.gui.modelflowsetup.ModelFlowSetup.m_jTree = null
protected

Tree showing flow.

◆ m_jTreeModel

DefaultTreeModel sortie.gui.modelflowsetup.ModelFlowSetup.m_jTreeModel
protected

Data model of tree showing flow.

◆ m_oManager

GUIManager sortie.gui.modelflowsetup.ModelFlowSetup.m_oManager
protected

GUIManager object.

◆ m_oMaxDimension

Dimension sortie.gui.modelflowsetup.ModelFlowSetup.m_oMaxDimension
protected

Max dimensions of the main program flow dialog.

◆ m_oPop

TreePopulation sortie.gui.modelflowsetup.ModelFlowSetup.m_oPop
protected

TreePopulation object.

◆ m_sHelpID

String sortie.gui.modelflowsetup.ModelFlowSetup.m_sHelpID = "windows.model_flow_window"
private

The ID of the help topic corresponding to this window.

◆ mp_oBehaviorGroups

ArrayList<BehaviorTypeBase> sortie.gui.modelflowsetup.ModelFlowSetup.mp_oBehaviorGroups = null
protected

List of behavior groups.

◆ mp_oBehaviors

ArrayList<ArrayList<BehaviorPackager> > sortie.gui.modelflowsetup.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. The BehaviorPackager class contains all the information we need to display and track behaviors, including ones that haven't been instantiated yet.

◆ mp_sBehaviorGroupNames

ArrayList<String> sortie.gui.modelflowsetup.ModelFlowSetup.mp_sBehaviorGroupNames = null
protected

List of behavior groups.

◆ treeState

ArrayList<String> sortie.gui.modelflowsetup.ModelFlowSetup.treeState = null
private

The documentation for this class was generated from the following file: