|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.progeeks.util.swing.AbstractTreeModel
org.progeeks.graph.swing.OrientedForestModel
public class OrientedForestModel
Wraps an OrientedForest implementation in an implementation of TreeModel. If the OrientedForest contains or is an ObservableGraph then it is listened to for tree changes. The children are automatically sorted and so must implement comparable that will work with their siblings. If not, then a Comparator must be provided to do the sorting.
| Nested Class Summary | |
|---|---|
protected class |
OrientedForestModel.GraphObserver
|
| Field Summary | |
|---|---|
static java.lang.String |
BASE_ROOT
Constant returned as the root. |
| Constructor Summary | |
|---|---|
OrientedForestModel()
|
|
| Method Summary | |
|---|---|
protected void |
addRoot(java.lang.Object node)
Adds a node as a root node, performing whatever caching and event firing that is necessary. |
protected void |
clearCache()
|
protected void |
fireTreeNodesChanged(javax.swing.event.TreeModelEvent event)
|
protected void |
fireTreeNodesInserted(javax.swing.event.TreeModelEvent event)
|
protected void |
fireTreeNodesRemoved(javax.swing.event.TreeModelEvent event)
|
protected void |
fireTreeStructureChanged(javax.swing.event.TreeModelEvent event)
|
java.util.List |
getChildList(java.lang.Object parent)
Returns a List of child nodes for the specified parent. |
java.util.Comparator |
getComparator()
Returns the current comparator used to sort the children. |
com.phoenixst.plexus.OrientedForest |
getOrientedForest()
|
java.lang.Object |
getRoot()
Always returns the BASE_ROOT constant. |
javax.swing.tree.TreePath |
getTreePath(java.lang.Object node)
Returns a TreePath for the specified node based on the parent child relationship defined by the RootedTree. |
boolean |
getUseEdgesAsChildren()
Returns true to return Graph.Edge objects for the children instead of just the nodes. |
protected boolean |
hasChildren(java.lang.Object parent)
Optimized method for returning whether or not a node has children without having to retrieve the whole child list and sort it. |
boolean |
isLeaf(java.lang.Object node)
Returns true if the specified node is a leaf. |
protected java.lang.Object |
nodeFromChild(java.lang.Object child)
Converts a node from a child edge if necessary. |
protected void |
removeRoot(java.lang.Object node)
Removes a node as a root node, performing whatever caching and event firing that is necessary. |
void |
setComparator(java.util.Comparator comparator)
Sets a comparator to use when sorting the tree nodes. |
void |
setOrientedForest(com.phoenixst.plexus.OrientedForest forest)
|
void |
setUseEdgesAsChildren(boolean flag)
Set to true to return Graph.Edge objects for the children instead of just the nodes. |
| Methods inherited from class org.progeeks.util.swing.AbstractTreeModel |
|---|
addTreeModelListener, getChild, getChildCount, getIndexOfChild, getListeners, removeTreeModelListener, valueForPathChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String BASE_ROOT
| Constructor Detail |
|---|
public OrientedForestModel()
| Method Detail |
|---|
public void setOrientedForest(com.phoenixst.plexus.OrientedForest forest)
public com.phoenixst.plexus.OrientedForest getOrientedForest()
public void setComparator(java.util.Comparator comparator)
public java.util.Comparator getComparator()
public void setUseEdgesAsChildren(boolean flag)
public boolean getUseEdgesAsChildren()
protected java.lang.Object nodeFromChild(java.lang.Object child)
public javax.swing.tree.TreePath getTreePath(java.lang.Object node)
public java.lang.Object getRoot()
public java.util.List getChildList(java.lang.Object parent)
AbstractTreeModel
getChildList in class AbstractTreeModelprotected boolean hasChildren(java.lang.Object parent)
public boolean isLeaf(java.lang.Object node)
isLeaf in interface javax.swing.tree.TreeModelisLeaf in class AbstractTreeModelprotected void clearCache()
protected void addRoot(java.lang.Object node)
protected void removeRoot(java.lang.Object node)
protected void fireTreeNodesChanged(javax.swing.event.TreeModelEvent event)
fireTreeNodesChanged in class AbstractTreeModelprotected void fireTreeNodesInserted(javax.swing.event.TreeModelEvent event)
fireTreeNodesInserted in class AbstractTreeModelprotected void fireTreeNodesRemoved(javax.swing.event.TreeModelEvent event)
fireTreeNodesRemoved in class AbstractTreeModelprotected void fireTreeStructureChanged(javax.swing.event.TreeModelEvent event)
fireTreeStructureChanged in class AbstractTreeModel
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||