|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.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(javax.swing.event.TreeModelListener l)
|
static java.util.Comparator |
createLabelTextComparator()
Returns a comparator that compares Graph2D nodes by their label text. |
static java.util.Comparator |
createNodeStateComparator(HierarchyManager hierarchy)
Returns a comparator that uses the hierarchical state of the nodes as a first criterion. |
static java.util.Comparator |
createToStringComparator()
Returns a comparator that compares the nodes in the tree by their default string value. |
void |
dispose()
Disposes this HierarchyTreeModel instance. |
java.lang.Object |
getChild(java.lang.Object parent,
int index)
|
java.util.Comparator |
getChildComparator()
Returns the comparator used to sort the children in each folder. |
int |
getChildCount(java.lang.Object parent)
|
int |
getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
|
java.lang.Object |
getRoot()
|
boolean |
isLeaf(java.lang.Object node)
|
void |
removeTreeModelListener(javax.swing.event.TreeModelListener l)
|
void |
setChildComparator(java.util.Comparator c)
Sets a comparator used to sort the children in each folder. |
void |
valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.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(java.util.Comparator c)
public java.util.Comparator getChildComparator()
public void addTreeModelListener(javax.swing.event.TreeModelListener l)
addTreeModelListener
in interface javax.swing.tree.TreeModel
public void removeTreeModelListener(javax.swing.event.TreeModelListener l)
removeTreeModelListener
in interface javax.swing.tree.TreeModel
public java.lang.Object getChild(java.lang.Object parent, int index)
getChild
in interface javax.swing.tree.TreeModel
public int getChildCount(java.lang.Object parent)
getChildCount
in interface javax.swing.tree.TreeModel
public int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
getIndexOfChild
in interface javax.swing.tree.TreeModel
public java.lang.Object getRoot()
getRoot
in interface javax.swing.tree.TreeModel
public boolean isLeaf(java.lang.Object node)
isLeaf
in interface javax.swing.tree.TreeModel
public void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
valueForPathChanged
in interface javax.swing.tree.TreeModel
public static java.util.Comparator createToStringComparator()
public static java.util.Comparator createLabelTextComparator()
public static java.util.Comparator createNodeStateComparator(HierarchyManager hierarchy)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |