Package jdepend.swingui
Class DependTreeModel
java.lang.Object
jdepend.swingui.DependTreeModel
- All Implemented Interfaces:
TreeModel
The
DependTreeModel class defines the data model being
observed by a DependTree instance.- Author:
- Mike Clark, Clarkware Consulting, Inc.
-
Constructor Summary
ConstructorsConstructorDescriptionDependTreeModel(PackageNode root) Constructs aDependTreeModelwith the specified root package node. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a listener for theTreeModelEventposted after the tree changes.Returns the child of the specified parent at the specified index in the parent's child collection.intgetChildCount(Object parent) Returns the number of children for the specified parent.intgetIndexOfChild(Object parent, Object child) Returns the index of the specified child within the specified parent.getRoot()Returns the root of the tree.booleanDetermines whether the specified tree node is a leaf node.voidRemoves a listener forTreeModelEvents.voidvalueForPathChanged(TreePath path, Object newValue) Callback method triggered when the value for the item specified by path has changed to newValue .
-
Constructor Details
-
DependTreeModel
Constructs aDependTreeModelwith the specified root package node.- Parameters:
root- Root package node.
-
-
Method Details
-
getRoot
Returns the root of the tree. -
getChild
Returns the child of the specified parent at the specified index in the parent's child collection.The specified parent must be a node previously obtained from this data source.
-
getChildCount
Returns the number of children for the specified parent.The specified parent must be a node previously obtained from this data source.
- Specified by:
getChildCountin interfaceTreeModel- Parameters:
parent- A node in the tree, obtained from this data source.- Returns:
- The number of children of the specified parent, or 0 if the parent is a leaf node or if it has no children.
-
isLeaf
Determines whether the specified tree node is a leaf node. -
valueForPathChanged
Callback method triggered when the value for the item specified by path has changed to newValue .- Specified by:
valueForPathChangedin interfaceTreeModel- Parameters:
path- Path to the node that has changed.newValue- The new value of the node.
-
getIndexOfChild
Returns the index of the specified child within the specified parent.- Specified by:
getIndexOfChildin interfaceTreeModel- Parameters:
parent- Parent node.child- Child node.- Returns:
- Index of child within parent.
-
addTreeModelListener
Adds a listener for theTreeModelEventposted after the tree changes.- Specified by:
addTreeModelListenerin interfaceTreeModel- Parameters:
l- The listener to add.
-
removeTreeModelListener
Removes a listener forTreeModelEvents.- Specified by:
removeTreeModelListenerin interfaceTreeModel- Parameters:
l- The listener to remove.
-