java.lang.Objectucot.ui.gui.tree.analyzemodeltree.TreeItem
public abstract class TreeItem
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.
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 |
---|
private java.lang.String name
private AnalyzeTreeModel model
TreeItem
fetches its data (mostly childs).
private TreeItem parent
TreeItem
of this node.
Constructor Detail |
---|
public TreeItem(java.lang.String name, AnalyzeTreeModel model, TreeItem parent)
Constructs the object.
name
- The name of the item.model
- The TreeModel
this item belongs to.parent
- The parent node for this item.Method Detail |
---|
public AnalyzeTreeModel getTreeModel()
public AnalyzeModel getAnalyzeModel()
AnalyzeModel
public java.lang.String getName()
public java.lang.String toString()
toString
in class java.lang.Object
getName()
public java.util.List<TreeItem> getChildren()
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.
TreeItem
which represents the path to this item.public TreeItem getParent()
public abstract javax.swing.Icon getIcon()
Icon
for this TreeItem
.
Icon
for this TreeItem
.public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
other
- treeitem to compare to