|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.util.treetable.BranchTree
Class to wrap a tree model so that it only exposes branches; that is, non- Leaf nodes. This is useful for Explorer-type views where the "tree view" portion only displays the branch nodes.
Field Summary | |
protected com.klg.jclass.util.JCListenerList |
listeners
|
protected TreeModel |
tree
|
Constructor Summary | |
BranchTree(TreeModel tree)
|
Method Summary | |
void |
addTreeModelListener(TreeModelListener l)
Adds the specified treemodel listener. |
Object |
getChild(Object parent,
int index)
Returns the "index"th non-leaf child of the parent node. |
int |
getChildCount(Object parent)
Returns the count of non-leaf children. |
int |
getIndexOfChild(Object parent,
Object child)
Returns the non-leaf index of this child. |
protected static Object |
getNode(TreePath path)
Given a TreePath , this method returns the last component or
"node" of the TreePath . |
Object |
getRoot()
Returns the root node of the tree. |
boolean |
isLeaf(Object node)
Returns true if the child is a leaf. |
void |
removeTreeModelListener(TreeModelListener l)
Removes the specified treemodel listener |
void |
valueForPathChanged(TreePath path,
Object newValue)
Called when the user has altered the value for the item identified by path to newValue . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected TreeModel tree
protected com.klg.jclass.util.JCListenerList listeners
Constructor Detail |
public BranchTree(TreeModel tree)
Method Detail |
public void addTreeModelListener(TreeModelListener l)
addTreeModelListener
in interface TreeModel
l
- The treemodel listener to addpublic void removeTreeModelListener(TreeModelListener l)
removeTreeModelListener
in interface TreeModel
l
- The treemodel listener to removepublic Object getChild(Object parent, int index)
getChild
in interface TreeModel
parent
- The parent nodeindex
- The index of the child to get
public int getChildCount(Object parent)
getChildCount
in interface TreeModel
parent
- The parent node
public int getIndexOfChild(Object parent, Object child)
getIndexOfChild
in interface TreeModel
parent
- The parent nodechild
- The child whose index is required
public Object getRoot()
getRoot
in interface TreeModel
public boolean isLeaf(Object node)
isLeaf
in interface TreeModel
node
- The node to check
public void valueForPathChanged(TreePath path, Object newValue)
path
to newValue
.
If newValue
signifies a truly new value
the model should post a treeNodesChanged
event.
valueForPathChanged
in interface TreeModel
path
- path to the node that the user has alterednewValue
- the new value from the TreeCellEditorprotected static Object getNode(TreePath path)
TreePath
, this method returns the last component or
"node" of the TreePath
.
path
- The path from which to get the node
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |