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


Field Summary
protected  boolean _flat
           
protected  Vector _flatChildren
           
protected  String _name
           
protected  Vector _providedClasses
           
protected  Object _root
           
protected  Vector _subTreeModels
           
 
Constructor Summary
TreeModelComposite(String name)
           
TreeModelComposite(String name, Vector subs)
           
 
Method Summary
 void addFlatChildren(Object node)
           
 void addSubTreeModel(TreeModel tm)
           
 void addTreeModelListener(TreeModelListener l)
           
 void calcFlatChildren()
           
 void fireTreeStructureChanged()
           
 void fireTreeStructureChanged(TreePath path)
           
 Object getChild(Object parent, int index)
           
 int getChildCount(Object parent)
           
 boolean getFlat()
           
 int getIndexOfChild(Object parent, Object child)
           
 String getName()
           
 Object getRoot()
           
 Vector getSubTreeModels()
           
 boolean isAlwaysLeaf(Object node)
          Return true if this node will always be a leaf, it is not an "empty folder"
 boolean isLeaf(Object node)
          Returns true if node is a leaf.
 void removeSubTreeModel(TreeModel tm)
           
 void removeTreeModelListener(TreeModelListener l)
           
 void setFlat(boolean b)
           
 void setName(String s)
           
 void setRoot(Object r)
           
 String toString()
           
 void valueForPathChanged(TreePath path, Object newValue)
          Messaged 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, wait, wait, wait
 

Field Detail

_subTreeModels

protected Vector _subTreeModels

_providedClasses

protected Vector _providedClasses

_root

protected Object _root

_flat

protected boolean _flat

_flatChildren

protected Vector _flatChildren

_name

protected String _name
Constructor Detail

TreeModelComposite

public TreeModelComposite(String name)

TreeModelComposite

public TreeModelComposite(String name,
                          Vector subs)
Method Detail

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