ucot.ui.gui.tree.analyzemodeltree
Class TreeItem

java.lang.Object
  extended by ucot.ui.gui.tree.analyzemodeltree.TreeItem
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
AbstractEntityTreeItem, EntitiesTreeItem, MethodTreeItem

public abstract class TreeItem
extends java.lang.Object
implements java.lang.Comparable

TreeItem is basic building block of AnalyzeTreeModel. Its subclasses are used to create dynmic internal model of the analyzemodel which can be used like a tree. By using these classes AnalyzeTreeModel can serve the actual tree representing the analyze model.

See Also:
JTree, AnalyzeModel

Field Summary
private  AnalyzeTreeModel model
          The model this TreeItem fetches its data (mostly childs).
private  java.lang.String name
          The name of the item.
private  TreeItem parent
          The parent TreeItem of this node.
 
Constructor Summary
TreeItem(java.lang.String name, AnalyzeTreeModel model, TreeItem parent)
           Constructs the object.
 
Method Summary
 int compareTo(java.lang.Object other)
          Compares this treeitem to another
 AnalyzeModel getAnalyzeModel()
          Returns the analyze model used by this item.
 java.util.List<TreeItem> getChildren()
          Returns the child items of this item.
abstract  javax.swing.Icon getIcon()
          Returns Icon for this TreeItem.
 java.lang.String getName()
          Returns the name of this item.
 TreeItem getParent()
          Returns the parent item of this item.
 java.util.List<TreeItem> getPath()
           Returns the path to this item inside the tree.
 AnalyzeTreeModel getTreeModel()
           
 java.lang.String toString()
          Returns the name of this item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private java.lang.String name
The name of the item. This should be shown by the tree


model

private AnalyzeTreeModel model
The model this TreeItem fetches its data (mostly childs).


parent

private TreeItem parent
The parent TreeItem of this node.

Constructor Detail

TreeItem

public TreeItem(java.lang.String name,
                AnalyzeTreeModel model,
                TreeItem parent)

Constructs the object.

Parameters:
name - The name of the item.
model - The TreeModel this item belongs to.
parent - The parent node for this item.
Method Detail

getTreeModel

public AnalyzeTreeModel getTreeModel()

getAnalyzeModel

public AnalyzeModel getAnalyzeModel()
Returns the analyze model used by this item.

Returns:
the analyze model used by this item.
See Also:
AnalyzeModel

getName

public java.lang.String getName()
Returns the name of this item.

Returns:
the name of this item.

toString

public java.lang.String toString()
Returns the name of this item.

Overrides:
toString in class java.lang.Object
See Also:
getName()

getChildren

public java.util.List<TreeItem> getChildren()
Returns the child items of this item.

Returns:
The childs.

getPath

public java.util.List<TreeItem> getPath()

Returns the path to this item inside the tree. Path is list of tree items where the most higest parent is first and the node ask to return the path is last in the list.

Returns:
List of TreeItem which represents the path to this item.

getParent

public TreeItem getParent()
Returns the parent item of this item.

Returns:
the parent item of this item.

getIcon

public abstract javax.swing.Icon getIcon()
Returns Icon for this TreeItem.

Returns:
Icon for this TreeItem.

compareTo

public int compareTo(java.lang.Object other)
Compares this treeitem to another

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
other - treeitem to compare to
Returns:
0 if the treeitems are equal