|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.view.hierarchy.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.
The root of the tree model will be the root graph of the graph hierarchy. Any other element of the tree model will be a node within a graph within the hierarchy. Regular nodes within the graph hierarchy that are not folder nodes
Whenever the graph hierarchy within the associated hierarchy manager changes the tree model will fire corresponding tree model events.
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 criterum. |
static Comparator |
createToStringComparator()
Returns a comparator that compares the nodes in the tree by their default string value. |
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 setChildComparator(Comparator c)
By default no comparator is set.
public Comparator getChildComparator()
public void addTreeModelListener(TreeModelListener l)
addTreeModelListener
in interface TreeModel
public Object getChild(Object parent, int index)
getChild
in interface TreeModel
public int getChildCount(Object parent)
getChildCount
in interface TreeModel
public int getIndexOfChild(Object parent, Object child)
getIndexOfChild
in interface TreeModel
public Object getRoot()
getRoot
in interface TreeModel
public boolean isLeaf(Object node)
isLeaf
in interface TreeModel
public void removeTreeModelListener(TreeModelListener l)
removeTreeModelListener
in interface TreeModel
public void valueForPathChanged(TreePath path, Object newValue)
valueForPathChanged
in interface TreeModel
public static Comparator createToStringComparator()
public static Comparator createLabelTextComparator()
public static Comparator createNodeStateComparator(HierarchyManager hierarchy)
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |