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

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

Inheritance diagram for sortie.gui.ModelFlowSetup:

Classes

class  BehaviorPackager
 Class for tracking behaviors. 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 Copyright: Copyright (c) Charles D.
 
class  TreeNodeInfo
 Objects set in tree nodes to give information about what to do when the user clicks a node.
 

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 createGUI () throws ModelException
 Draws the window displaying the data as a tree.
 
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.
 
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.
 
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< 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.
 

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.
 
ArrayList< String > mp_sBehaviorGroupNames = null
 List of behavior groups.
 
ArrayList< BehaviorTypeBasemp_oBehaviorGroups = null
 List of behavior groups.
 
ArrayList< ArrayList
< BehaviorPackager > > 
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.
 
int m_iMode = TYPE_FIRST
 Mode by which the tree should be built - will be one of the finals below.
 

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

Private Attributes

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

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

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

Constructor.

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

Member Function Documentation

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

Controls actions for this window.

Parameters
eActionEvent.
void sortie.gui.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.
void sortie.gui.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.
void sortie.gui.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.
void sortie.gui.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.
void sortie.gui.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.
void sortie.gui.ModelFlowSetup.createGUI ( ) throws ModelException
protected

Draws the window displaying the data as a tree.

Exceptions
ModelExceptionpassed through from called methods.
ArrayList<String> sortie.gui.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.
void sortie.gui.ModelFlowSetup.setBehaviorList ( ArrayList< SpeciesTypeCombo p_oCombos,
ArrayList< BehaviorPackager p_oBehaviors 
) throws ModelException
private

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.
void sortie.gui.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.
void sortie.gui.ModelFlowSetup.valueChanged ( javax.swing.event.TreeSelectionEvent  e)

Detects user clicks on the tree.

Parameters
eTreeSelectionEvent

Member Data Documentation

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

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

int sortie.gui.ModelFlowSetup.m_iMode = TYPE_FIRST
protected

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

JTree sortie.gui.ModelFlowSetup.m_jTree = null
protected

Tree showing flow.

DefaultTreeModel sortie.gui.ModelFlowSetup.m_jTreeModel
protected

Data model of tree showing flow.

GUIManager sortie.gui.ModelFlowSetup.m_oManager
protected

GUIManager object.

Dimension sortie.gui.ModelFlowSetup.m_oMaxDimension
protected

Max dimensions of the main program flow dialog.

TreePopulation sortie.gui.ModelFlowSetup.m_oPop
protected

TreePopulation object.

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

The ID of the help topic corresponding to this window.

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

List of behavior groups.

ArrayList<ArrayList<BehaviorPackager> > sortie.gui.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.

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

List of behavior groups.


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