jas.util.tree
Class OrderedNode

java.lang.Object
  |
  +--jas.util.tree.SimpleNode
        |
        +--jas.util.tree.OrderedNode

public class OrderedNode
extends SimpleNode

An OrderedNode is a node which may order its children by something other than natural order, using a Comparator. An OrderedNode uses the same ordering as its parent, unless it has an explicit comparator set.


Field Summary
static com.sun.java.util.collections.Comparator DEFAULT_ORDER
           
 
Fields inherited from class jas.util.tree.SimpleNode
children, nullEnumeration, object
 
Constructor Summary
OrderedNode()
           
OrderedNode(SimpleNode parent, java.lang.String name, java.lang.String type, int flags, java.lang.Object object)
           
OrderedNode(java.lang.String name, java.lang.String type, int flags, java.lang.Object object)
           
 
Method Summary
protected  void addChild(SimpleNode child)
           
 void clearOrder()
           
protected  SimpleNode createNode(SimpleNode parent, java.lang.String name, java.lang.String type, int flags, java.lang.Object object)
          Called to create a node when adding a TreeItem to the tree.
protected  com.sun.java.util.collections.List createOrderedList(com.sun.java.util.collections.Collection c)
          Override to use a different List implementation for the ordered list
 SimpleNode getChild(int index)
           
 int getIndexOfChild(java.lang.Object child)
           
 int getNaturalIndex()
           
 com.sun.java.util.collections.Comparator getOrder()
           
protected  void removeChild(SimpleNode child)
           
 void setOrder(com.sun.java.util.collections.Comparator comp)
          Set a specific ordering, or null to use the parents ordering, or DEFAULT_ORDER to use the default ordering.
 
Methods inherited from class jas.util.tree.SimpleNode
add, add, addNodeListener, children, clearFlags, destroy, elements, find, findChild, getChildCount, getFlags, getName, getObject, getParent, getTreeItem, getType, isAncestorOf, remove, removeNodeListener, renameChild, setFlags, toString, treeChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_ORDER

public static final com.sun.java.util.collections.Comparator DEFAULT_ORDER
Constructor Detail

OrderedNode

public OrderedNode()

OrderedNode

public OrderedNode(java.lang.String name,
                   java.lang.String type,
                   int flags,
                   java.lang.Object object)

OrderedNode

public OrderedNode(SimpleNode parent,
                   java.lang.String name,
                   java.lang.String type,
                   int flags,
                   java.lang.Object object)
Method Detail

createNode

protected SimpleNode createNode(SimpleNode parent,
                                java.lang.String name,
                                java.lang.String type,
                                int flags,
                                java.lang.Object object)
Description copied from class: SimpleNode
Called to create a node when adding a TreeItem to the tree. Can be overriden by subclasses to create their own type of SimpleNode.
Overrides:
createNode in class SimpleNode

addChild

protected void addChild(SimpleNode child)
Overrides:
addChild in class SimpleNode

removeChild

protected void removeChild(SimpleNode child)
Overrides:
removeChild in class SimpleNode

getChild

public SimpleNode getChild(int index)
Overrides:
getChild in class SimpleNode

getIndexOfChild

public int getIndexOfChild(java.lang.Object child)
Overrides:
getIndexOfChild in class SimpleNode

getNaturalIndex

public int getNaturalIndex()

createOrderedList

protected com.sun.java.util.collections.List createOrderedList(com.sun.java.util.collections.Collection c)
Override to use a different List implementation for the ordered list

setOrder

public void setOrder(com.sun.java.util.collections.Comparator comp)
Set a specific ordering, or null to use the parents ordering, or DEFAULT_ORDER to use the default ordering.

clearOrder

public void clearOrder()

getOrder

public com.sun.java.util.collections.Comparator getOrder()