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.


Variable Index

 o descriptionBL
Determines if a description of the distinguished name will be displayed.
 o dnSet
A subset of distinguished names to be displayed.
 o hostname
The string that is displayed in the Tree Area's text field.
 o longDistinguishedNameBL
Determines if the entire distinguished name will be displayed.
 o mds
A reference to an instance of class MDS.
 o port
The port the tree is connecting to.
 o textArea
Figure out a way to take this out.
 o tree
A reference to an instance of class MDSTree.
 o treeAreaTF
Displays a string that represents the current distinguished name.
 o treeModel
The DefaultTreeModel determines the tree's application specific behavior.
 o treePane
Contains the tree and the text field.
 o treeSP
Displays a portion of a viewport.
 o tsl
The TreeSelectionListener customizes the tree's selection behavior.
 o tsm

Constructor Index

 o MDSTreeArea(MDS)
Allocates an MDSTreeArea object with a reference to an MDS object
 o MDSTreeArea(MDS, boolean, boolean, MDSTextArea)
Allocates an MDSTreeArea object with a reference to an MDS object.

Method Index

 o addTreeExpansionListener(TreeExpansionListener)
Adds a tree expansion listner to the tree's listener list.
 o addTreeSelectionListener(TreeSelectionListener)
Adds a tree selection listner to the tree's listener list.
 o clear()
Removes all of the nodes from the current tree.
 o expandPath(TreeNode[], String)
This method expands the selected path and places the attributes for this paths distinguished name in the text area.
 o find(String)
Finds nodes in the tree
 o findPath(String[])
This method is used to find paths in the tree.
 o findPath(String[], int)
Recursively inserts paths into the tree until the specified path is found and inserted.
 o getContentPane()
Returns the pane that contains the treeAreaTF and the MDSTree.
 o getDescriptionBL()
 o getLongBL()
 o getPathToRoot(DefaultMutableTreeNode)
Finds a path from the current selected node to the root
 o getRoot()
Returns the root of the tree.
 o getTree()
Returns a reference to the tree component
 o main(String[])
 o reconnect()
Refreshes the currently displayed tree.
 o setDNSet(Object[])
Sets the distinguished names that will be displayed in the tree.
 o setDNSet(String[])
Sets the distinguished names that will be displayed in the tree.
 o setGeneralPreferences(boolean, boolean)
This method listens for changes to the GeneralPreferences dialog.
 o setMaximumTreeSize(Dimension)
This method allows the programmer to set the maximum size of the tree component
 o setMinimumTreeSize(Dimension)
This method allows the programmer to set the minimum size of the tree component
 o setPreferredTreeSize(Dimension)
This method allows the programmer to set the preferred size of the tree component
 o setRoot(String)
Sets the distinguished names that will be displayed in the tree.
 o setSelectionModel(TreeSelectionModel)
Sets the tree selection model.
 o setTree(MDSTree)
Sets the TreeArea's tree variable
 o setTreeAreaTF(String)
Sets the text for the treeArea text field.
 o setTreeSize(Dimension)
This method allows the programmer to set the size of the tree component

Variables

 o 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

 o port
 protected String port
The port the tree is connecting to.

 o dnSet
 protected String dnSet[]
A subset of distinguished names to be displayed.

 o longDistinguishedNameBL
 protected boolean longDistinguishedNameBL
Determines if the entire distinguished name will be displayed.

 o descriptionBL
 protected boolean descriptionBL
Determines if a description of the distinguished name will be displayed.

 o mds
 protected MDS mds
A reference to an instance of class MDS.

 o tree
 protected MDSTree tree
A reference to an instance of class MDSTree.

 o textArea
 protected MDSTextArea textArea
Figure out a way to take this out.

 o tsl
 protected TreeSelectionListener tsl
The TreeSelectionListener customizes the tree's selection behavior.

 o tsm
 protected TreeSelectionModel tsm
 o treeModel
 protected DefaultTreeModel treeModel
The DefaultTreeModel determines the tree's application specific behavior.

 o treeAreaTF
 protected JTextField treeAreaTF
Displays a string that represents the current distinguished name.

 o treeSP
 protected JScrollPane treeSP
Displays a portion of a viewport.

 o treePane
 protected JPanel treePane
Contains the tree and the text field.

Constructors

 o MDSTreeArea
 public MDSTreeArea(MDS mds)
Allocates an MDSTreeArea object with a reference to an MDS object

Parameters:
MDS - mds performs queries to the database
 o 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

Methods

 o clear
 public void clear()
Removes all of the nodes from the current tree.

 o setRoot
 public void setRoot(String root)
Sets the distinguished names that will be displayed in the tree.

Parameters:
String - rootDistinguishedName BUG
 o getRoot
 public DefaultMutableTreeNode getRoot()
Returns the root of the tree.

Returns:
a reference to the root of the tree
 o setDNSet
 public void setDNSet(String dnSet[])
Sets the distinguished names that will be displayed in the tree.

Parameters:
String - dnSet BUG
 o setDNSet
 public void setDNSet(Object dnset[])
Sets the distinguished names that will be displayed in the tree.

Parameters:
String - dnSet BUG
 o 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
 o 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
 o 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
 o 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
 o addTreeExpansionListener
 public void addTreeExpansionListener(TreeExpansionListener tel)
Adds a tree expansion listner to the tree's listener list.

 o addTreeSelectionListener
 public void addTreeSelectionListener(TreeSelectionListener tsl)
Adds a tree selection listner to the tree's listener list.

 o 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
 o setTreeAreaTF
 public void setTreeAreaTF(String string)
Sets the text for the treeArea text field.

Parameters:
String - string value displayed in the text field
 o 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
 o reconnect
 public void reconnect()
Refreshes the currently displayed tree.

 o 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
 o getLongBL
 public boolean getLongBL()
 o getDescriptionBL
 public boolean getDescriptionBL()
 o getTree
 public MDSTree getTree()
Returns a reference to the tree component

Returns:
MDSTree tree a reference to the tree component
 o setTree
 public void setTree(MDSTree tree)
Sets the TreeArea's tree variable

Parameters:
MDSTree - tree
 o find
 public DefaultMutableTreeNode find(String key)
Finds nodes in the tree

Parameters:
String - key the node to find
Returns:
DefaultMutableTreeNode
 o 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
 o 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.
 o 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
 o 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
 o main
 public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index