|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.view.hierarchy.HierarchyTreeModel
public class HierarchyTreeModel
This class represents a tree model view of a graph
hierarchy managed by HierarchyManager. The tree model can be used
with a JTree to visualize the nodes within the graph hierarchy.
| Constructor Summary | |
|---|---|
HierarchyTreeModel(HierarchyManager hierarchy)
Creates a new instance of HierarchyTreeModel for the nodes within the given HierarchyManager. |
|
| Method Summary | |
|---|---|
void |
addTreeModelListener(TreeModelListener l)
|
static Comparator |
createLabelTextComparator()
Returns a comparator that compares Graph2D nodes by their label text. |
static Comparator |
createNodeStateComparator(HierarchyManager hierarchy)
Returns a comparator that uses the hierarchical state of the nodes as a first criterion. |
static Comparator |
createToStringComparator()
Returns a comparator that compares the nodes in the tree by their default string value. |
void |
dispose()
Disposes this HierarchyTreeModel instance. |
Object |
getChild(Object parent,
int index)
|
Comparator |
getChildComparator()
Returns the comparator used to sort the children in each folder. |
int |
getChildCount(Object parent)
|
int |
getIndexOfChild(Object parent,
Object child)
|
Object |
getRoot()
|
boolean |
isLeaf(Object node)
|
void |
removeTreeModelListener(TreeModelListener l)
|
void |
setChildComparator(Comparator c)
Sets a comparator used to sort the children in each folder. |
void |
valueForPathChanged(TreePath path,
Object newValue)
This method propagates the result of the inline editor to the label of the node in the Graph2D, as long as there is one. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HierarchyTreeModel(HierarchyManager hierarchy)
| Method Detail |
|---|
public void dispose()
HierarchyTreeModel instance.
To free resources, this method should be called after a
HierarchyTreeModel instance is not needed anymore.
Note: It is not safe to invoke any methods on a disposed
HierarchyTreeModel instance. Doing so may result in
NullPointerException being thrown.
public void setChildComparator(Comparator c)
public Comparator getChildComparator()
public void addTreeModelListener(TreeModelListener l)
addTreeModelListener in interface TreeModelpublic void removeTreeModelListener(TreeModelListener l)
removeTreeModelListener in interface TreeModel
public Object getChild(Object parent,
int index)
getChild in interface TreeModelpublic int getChildCount(Object parent)
getChildCount in interface TreeModel
public int getIndexOfChild(Object parent,
Object child)
getIndexOfChild in interface TreeModelpublic Object getRoot()
getRoot in interface TreeModelpublic boolean isLeaf(Object node)
isLeaf in interface TreeModel
public void valueForPathChanged(TreePath path,
Object newValue)
valueForPathChanged in interface TreeModelpublic static Comparator createToStringComparator()
public static Comparator createLabelTextComparator()
public static Comparator createNodeStateComparator(HierarchyManager hierarchy)
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||