uci.uml.ui.nav
Class TreeModelComposite
java.lang.Object
|
+--uci.uml.ui.nav.TreeModelComposite
- Direct Known Subclasses:
- NavPerspective, ToDoPerspective
- public class TreeModelComposite
- extends Object
- implements TreeModel, Cloneable
_subTreeModels
protected Vector _subTreeModels
_providedClasses
protected Vector _providedClasses
_root
protected Object _root
_flat
protected boolean _flat
_flatChildren
protected Vector _flatChildren
_name
protected String _name
TreeModelComposite
public TreeModelComposite(String name)
TreeModelComposite
public TreeModelComposite(String name,
Vector subs)
setFlat
public void setFlat(boolean b)
getFlat
public boolean getFlat()
addSubTreeModel
public void addSubTreeModel(TreeModel tm)
removeSubTreeModel
public void removeSubTreeModel(TreeModel tm)
getSubTreeModels
public Vector getSubTreeModels()
calcFlatChildren
public void calcFlatChildren()
addFlatChildren
public void addFlatChildren(Object node)
getName
public String getName()
setName
public void setName(String s)
getRoot
public Object getRoot()
- Specified by:
- getRoot in interface TreeModel
setRoot
public void setRoot(Object r)
getChild
public Object getChild(Object parent,
int index)
- Specified by:
- getChild in interface TreeModel
getChildCount
public int getChildCount(Object parent)
- Specified by:
- getChildCount in interface TreeModel
getIndexOfChild
public int getIndexOfChild(Object parent,
Object child)
- Specified by:
- getIndexOfChild in interface TreeModel
isLeaf
public boolean isLeaf(Object node)
- Returns true if node is a leaf. It is possible for this method
to return false even if node has no children. A directory in a
filesystem, for example, may contain no files; the node representing
the directory is not a leaf, but it also has no children.
- Specified by:
- isLeaf in interface TreeModel
- Parameters:
node - a node in the tree, obtained from this data source- Returns:
- true if node is a leaf
isAlwaysLeaf
public boolean isAlwaysLeaf(Object node)
- Return true if this node will always be a leaf, it is not an
"empty folder"
valueForPathChanged
public void valueForPathChanged(TreePath path,
Object newValue)
- Messaged when the user has altered the value for the item identified
by path to newValue. If newValue signifies
a truly new value the model should post a treeNodesChanged
event.
- Specified by:
- valueForPathChanged in interface TreeModel
- Parameters:
path - path to the node that the user has altered.newValue - the new value from the TreeCellEditor.
fireTreeStructureChanged
public void fireTreeStructureChanged()
fireTreeStructureChanged
public void fireTreeStructureChanged(TreePath path)
addTreeModelListener
public void addTreeModelListener(TreeModelListener l)
- Specified by:
- addTreeModelListener in interface TreeModel
removeTreeModelListener
public void removeTreeModelListener(TreeModelListener l)
- Specified by:
- removeTreeModelListener in interface TreeModel
toString
public String toString()
- Overrides:
- toString in class Object