All Packages Class Hierarchy This Package Previous Next Index
Class org.globus.explorer.awt.MDSTreeArea
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----com.sun.java.swing.JComponent
|
+----com.sun.java.swing.JPanel
|
+----org.globus.explorer.awt.GPanel
|
+----org.globus.explorer.awt.MDSTreeArea
- public class MDSTreeArea
- extends GPanel
The MDSTreeArea
BUG Note: is not an awt component since based on swing,
james please put it in the correct directory.
BUG all methods are wrong documented read javadoc manpage, james corect this.
The MDSTreeArea is a composite component that consists of two basic
components, an MDSTree and a JTextField. However, the MDSTreeArea
adds a tree model, tree selection listener, and tree selection
model. The various models are components that allow programmers to
modify the tree for specific tasks without ruining the MDSTree's
generality. The model provides the tree's logical representation.
The following example demonstrates how to create an instance of
MDSTreeArea:
//The first step is to create an instance of MDS. This is used
//to communicate with the database.
MDS mds = new MDS("www.globus.org","389");
try{
mds.connect("www.globus.org","389", "o=globus, c=us");
}
catch(Exception e){
}
MDSTreeArea ta = new MDSTreeArea(mds);
JFrame frame = new JFrame("MDSTreeArea");
//getContentPane returns the panel that is used to display the
//tree area.
frame.getContentPane().add(ta.getContentPane());
frame.setSize( new Dimension(1000,1000));
frame.show();
The concepts behind the design of this class, as well as many others
in the globus package and the Swing set in general, are built on the
BUG Note: james make a propper reference to the java swing set WWW
Model
View Control paradigm. The previous link is a definite must
read for those unfamiliar with the term.
-
descriptionBL
- Determines if a description of the distinguished name will be
displayed.
-
dnSet
- A subset of distinguished names to be displayed.
-
hostname
- The string that is displayed in the Tree Area's text field.
-
longDistinguishedNameBL
- Determines if the entire distinguished name will be displayed.
-
mds
- A reference to an instance of class MDS.
-
port
- The port the tree is connecting to.
-
textArea
- Figure out a way to take this out.
-
tree
- A reference to an instance of class MDSTree.
-
treeAreaTF
- Displays a string that represents the current distinguished name.
-
treeModel
- The DefaultTreeModel determines the tree's application specific
behavior.
-
treePane
- Contains the tree and the text field.
-
treeSP
- Displays a portion of a viewport.
-
tsl
- The TreeSelectionListener customizes the tree's selection behavior.
-
tsm
-
-
MDSTreeArea(MDS)
- Allocates an MDSTreeArea object with a reference to an MDS object
-
MDSTreeArea(MDS, boolean, boolean, MDSTextArea)
- Allocates an MDSTreeArea object with a reference to an MDS
object.
-
addTreeExpansionListener(TreeExpansionListener)
- Adds a tree expansion listner to the tree's listener list.
-
addTreeSelectionListener(TreeSelectionListener)
- Adds a tree selection listner to the tree's listener list.
-
clear()
- Removes all of the nodes from the current tree.
-
expandPath(TreeNode[], String)
- This method expands the selected path and places the attributes for this
paths distinguished name in the text area.
-
find(String)
- Finds nodes in the tree
-
findPath(String[])
- This method is used to find paths in the tree.
-
findPath(String[], int)
- Recursively inserts paths into the tree until the specified path is
found and inserted.
-
getContentPane()
- Returns the pane that contains the treeAreaTF and the MDSTree.
-
getDescriptionBL()
-
-
getLongBL()
-
-
getPathToRoot(DefaultMutableTreeNode)
- Finds a path from the current selected node to the root
-
getRoot()
- Returns the root of the tree.
-
getTree()
-
Returns a reference to the tree component
-
main(String[])
-
-
reconnect()
- Refreshes the currently displayed tree.
-
setDNSet(Object[])
- Sets the distinguished names that will be displayed in the tree.
-
setDNSet(String[])
- Sets the distinguished names that will be displayed in the tree.
-
setGeneralPreferences(boolean, boolean)
- This method listens for changes to the GeneralPreferences dialog.
-
setMaximumTreeSize(Dimension)
- This method allows the programmer to set the maximum size of the tree
component
-
setMinimumTreeSize(Dimension)
- This method allows the programmer to set the minimum size of the tree
component
-
setPreferredTreeSize(Dimension)
- This method allows the programmer to set the preferred size of the tree
component
-
setRoot(String)
- Sets the distinguished names that will be displayed in the tree.
-
setSelectionModel(TreeSelectionModel)
- Sets the tree selection model.
-
setTree(MDSTree)
- Sets the TreeArea's tree variable
-
setTreeAreaTF(String)
- Sets the text for the treeArea text field.
-
setTreeSize(Dimension)
- This method allows the programmer to set the size of the tree
component
hostname
protected String hostname
- The string that is displayed in the Tree Area's text field.
This should be renamed so as to improve reusability
port
protected String port
- The port the tree is connecting to.
dnSet
protected String dnSet[]
- A subset of distinguished names to be displayed.
longDistinguishedNameBL
protected boolean longDistinguishedNameBL
- Determines if the entire distinguished name will be displayed.
descriptionBL
protected boolean descriptionBL
- Determines if a description of the distinguished name will be
displayed.
mds
protected MDS mds
- A reference to an instance of class MDS.
tree
protected MDSTree tree
- A reference to an instance of class MDSTree.
textArea
protected MDSTextArea textArea
- Figure out a way to take this out.
tsl
protected TreeSelectionListener tsl
- The TreeSelectionListener customizes the tree's selection behavior.
tsm
protected TreeSelectionModel tsm
treeModel
protected DefaultTreeModel treeModel
- The DefaultTreeModel determines the tree's application specific
behavior.
treeAreaTF
protected JTextField treeAreaTF
- Displays a string that represents the current distinguished name.
treeSP
protected JScrollPane treeSP
- Displays a portion of a viewport.
treePane
protected JPanel treePane
- Contains the tree and the text field.
MDSTreeArea
public MDSTreeArea(MDS mds)
- Allocates an MDSTreeArea object with a reference to an MDS object
- Parameters:
- MDS - mds performs queries to the database
MDSTreeArea
public MDSTreeArea(MDS mds,
boolean descriptionBL,
boolean longDistinguishedNameBL,
MDSTextArea textArea)
- Allocates an MDSTreeArea object with a reference to an MDS
object. This constructor also accepts two boolean flags and
reference to an instance of MDSTextArea. The description boolean
flag determines if a description string will be added to the
distinguished name that is displayed in the tree. The long
boolean flag determines if the entire distinguished name will be
displayed. The MDSTextArea is where the attributes of
distinguished name's are displayed.
- Parameters:
- MDS - mds performs MDS queries
- boolean - descriptionBL determines if a description of the \
distinguished will be displayed BUG
- boolean - longDistinguishedNameBL determines if the full \
istinguished name will be displayed BUG
- MDSTextArea - textArea this reference passes messages to the text area
clear
public void clear()
- Removes all of the nodes from the current tree.
setRoot
public void setRoot(String root)
- Sets the distinguished names that will be displayed in the tree.
- Parameters:
- String - rootDistinguishedName BUG
getRoot
public DefaultMutableTreeNode getRoot()
- Returns the root of the tree.
- Returns:
- a reference to the root of the tree
setDNSet
public void setDNSet(String dnSet[])
- Sets the distinguished names that will be displayed in the tree.
- Parameters:
- String - dnSet BUG
setDNSet
public void setDNSet(Object dnset[])
- Sets the distinguished names that will be displayed in the tree.
- Parameters:
- String - dnSet BUG
setMinimumTreeSize
public void setMinimumTreeSize(Dimension dim)
- This method allows the programmer to set the minimum size of the tree
component
- Parameters:
- Dimension - dim the minimum dimension BUG
setPreferredTreeSize
public void setPreferredTreeSize(Dimension dim)
- This method allows the programmer to set the preferred size of the tree
component
- Parameters:
- Dimension - dim the preferred dimension BUG
setMaximumTreeSize
public void setMaximumTreeSize(Dimension dim)
- This method allows the programmer to set the maximum size of the tree
component
- Parameters:
- Dimension - dim the maximum dimension
setTreeSize
public void setTreeSize(Dimension dim)
- This method allows the programmer to set the size of the tree
component
- Parameters:
- Dimension - dim the tree components dimension BUG
addTreeExpansionListener
public void addTreeExpansionListener(TreeExpansionListener tel)
- Adds a tree expansion listner to the tree's listener list.
addTreeSelectionListener
public void addTreeSelectionListener(TreeSelectionListener tsl)
- Adds a tree selection listner to the tree's listener list.
setSelectionModel
public void setSelectionModel(TreeSelectionModel tsm)
- Sets the tree selection model. The selection model determines the tree's
beheavior during selection events. For example, it determines if the
tree allows single or multiple selection.
- Parameters:
- TreeSelectionModel - tsm
setTreeAreaTF
public void setTreeAreaTF(String string)
- Sets the text for the treeArea text field.
- Parameters:
- String - string value displayed in the text field
getContentPane
public JPanel getContentPane()
- Returns the pane that contains the treeAreaTF and the MDSTree.
- Returns:
- treePane a reference to the panel that contains the tree and text \
field
reconnect
public void reconnect()
- Refreshes the currently displayed tree.
setGeneralPreferences
public void setGeneralPreferences(boolean longDistinguishedNameBL,
boolean descriptionBL)
- This method listens for changes to the GeneralPreferences dialog. It
should be replaced by a method that is more conducive to the MVC
architecture.
- Parameters:
- boolean - longDistinguishedNameBL
- boolean - descriptionBL
getLongBL
public boolean getLongBL()
getDescriptionBL
public boolean getDescriptionBL()
getTree
public MDSTree getTree()
- Returns a reference to the tree component
- Returns:
- MDSTree tree a reference to the tree component
setTree
public void setTree(MDSTree tree)
- Sets the TreeArea's tree variable
- Parameters:
- MDSTree - tree
find
public DefaultMutableTreeNode find(String key)
- Finds nodes in the tree
- Parameters:
- String - key the node to find
- Returns:
- DefaultMutableTreeNode
getPathToRoot
public TreeNode[] getPathToRoot(DefaultMutableTreeNode node)
- Finds a path from the current selected node to the root
- Parameters:
- DefaultMutableTreeNode - the beginning of the path
- Returns:
- TreeNode[] a path from the current selected node to the root
findPath
public TreeNode[] findPath(String paths[])
- This method is used to find paths in the tree. If the path is not
in the tree then it invokes a method that recursively inserts paths
in the tree until the specified path is found. This method is invoked
by the TextArea when a valid path is selected.
- Parameters:
- String - paths[]
- Returns:
- TreeNode[] a path from the current selected node to the root.
findPath
public void findPath(String paths[],
int index)
- Recursively inserts paths into the tree until the specified path is
found and inserted.
- Parameters:
- String[] - paths an array of nodes that are not in the tree
- int - index the current node to insert
expandPath
public void expandPath(TreeNode path[],
String distinguishedName)
- This method expands the selected path and places the attributes for this
paths distinguished name in the text area.
- Parameters:
- TreeNode[] - path
- String - distinguishedName
main
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index