SORTIE Java Interface
1
|
Allows users to make changes to the model flow and behavior order. More...
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< BehaviorTypeBase > | mp_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 |
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
Edit history:
---------------—
December 8, 2011: Wiped the slate clean for version 7 (LEM)
sortie.gui.modelflowsetup.ModelFlowSetup.ModelFlowSetup | ( | JFrame | oParent, |
GUIManager | oManager | ||
) |
Constructor.
oParent | Window which is the parent of this dialog. |
oManager | GUIManager object. |
void sortie.gui.modelflowsetup.ModelFlowSetup.actionPerformed | ( | ActionEvent | e | ) |
Controls actions for this window.
e | ActionEvent. |
|
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.
ModelException | if the settings are invalid. |
|
protected |
Builds a tree where the first level is behavior; the second is data, with trees being type first, then species.
jRoot | Node upon which to build the tree. |
ModelException | passed through from called methods. |
|
protected |
Builds the tree displayed in the window with data first; for trees, the branch levels are species, then type, then behavior list.
jRoot | Node upon which the tree is built. |
ModelException | passed through from called methods. |
|
protected |
Builds the tree displayed in the window.
If it already exists, it will be torn down and recreated.
ModelException | passed through from called methods. |
|
protected |
Builds the tree displayed in the window with data first; for trees, the branch levels are type, then species, then behavior list.
jRoot | Node upon which the tree is built. |
ModelException | passed through from called methods. |
|
protected |
Draws the window displaying the data as a tree.
ModelException | passed through from called methods. |
|
protected |
Gets a vector of behavior names for a type/species combo from our temporary behavior copy set.
iSpecies | Tree species. |
iType | Tree type. |
ModelException | passed through from called methods. |
|
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...
|
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.
|
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.
node | Node to test. |
childstring | String describing subnodes of behavior. |
|
private |
This causes a behavior-first tree to have the appropriate paths re-expanded.
|
private |
This causes a type- or species-first tree to have the appropriate paths re-expanded.
|
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.
p_oCombos | Species/type combos to set the behaviors for. |
p_oBehaviors | Behaviors to set to the combos. |
ModelException | passed through from called methods. |
|
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.
jBehaviorGroupBox | The combo box displaying the behavior groupings. |
jIndividualBehaviorListModel | The list model for the individual behavior choices list to be updated. |
void sortie.gui.modelflowsetup.ModelFlowSetup.valueChanged | ( | TreeSelectionEvent | e | ) |
Detects user clicks on the tree.
e | TreeSelectionEvent |
|
protected |
Flag indicating that the tree should display behaviors at the highest level.
|
protected |
Mode by which the tree should be built - will be one of the finals below.
|
protected |
Tree showing flow.
|
protected |
Data model of tree showing flow.
|
protected |
GUIManager object.
|
protected |
Max dimensions of the main program flow dialog.
|
protected |
TreePopulation object.
|
private |
The ID of the help topic corresponding to this window.
|
protected |
List of behavior groups.
|
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.
|
protected |
List of behavior groups.
|
private |