| java.lang.Object com.methodhead.tree.Tree
All known Subclasses: com.methodhead.shim.SiteMap, com.methodhead.shim.SiteMapTree, com.methodhead.res.FileTree,
Tree | public class Tree (Code) | | A tree of DefaultMutableTreeNodes. This class methods to manage
nodes in the tree.
|
Method Summary | |
public static DefaultMutableTreeNode | copy(DefaultMutableTreeNode node) Recursively copies node using its clone() method (which,
unless overridden, is a shallow copy). | public DefaultMutableTreeNode | getRoot() Returns the root of the tree or null if there is none. | public void | insertAfter(DefaultMutableTreeNode dest, DefaultMutableTreeNode node) Inserts node after dest, throwing an
exception if dest is the root. | public void | insertBefore(DefaultMutableTreeNode dest, DefaultMutableTreeNode node) Inserts node before dest, throwing an
exception if dest is the root. | public void | insertUnder(DefaultMutableTreeNode dest, DefaultMutableTreeNode node) Inserts node under dest. | public void | moveAfter(DefaultMutableTreeNode dest, DefaultMutableTreeNode node) Moves node after dest. | public void | moveBefore(DefaultMutableTreeNode dest, DefaultMutableTreeNode node) Moves node after dest. | public void | moveUnder(DefaultMutableTreeNode dest, DefaultMutableTreeNode node) Moves node under dest. | public void | remove(DefaultMutableTreeNode node) Removes node and all of its children from the tree. | public void | removeAndPromoteChildren(DefaultMutableTreeNode node) Removes node, adding its child nodes to the parent node. | public void | setRoot(DefaultMutableTreeNode link) Sets the root of the tree; note: any existing nodes will be lost. | public static void | sort(DefaultMutableTreeNode node, Comparator comparator) Sorts the children of node using comparator;
comparator should expect DefaultMutableTreeNodes to be
passed to it. | public String | validateMove(DefaultMutableTreeNode node, DefaultMutableTreeNode dest, String position) Confirms if dest can be positioned position (one of the
POSITION_ constants) near node successfully. |
INVALIDMOVE_CANNOTMOVEAFTERROOT | final public static String INVALIDMOVE_CANNOTMOVEAFTERROOT(Code) | | |
INVALIDMOVE_CANNOTMOVEBEFOREROOT | final public static String INVALIDMOVE_CANNOTMOVEBEFOREROOT(Code) | | |
INVALIDMOVE_CANNOTMOVENEARSELF | final public static String INVALIDMOVE_CANNOTMOVENEARSELF(Code) | | |
INVALIDMOVE_CANNOTMOVEROOT | final public static String INVALIDMOVE_CANNOTMOVEROOT(Code) | | |
INVALIDMOVE_CANNOTMOVEUNDERSELF | final public static String INVALIDMOVE_CANNOTMOVEUNDERSELF(Code) | | |
POSITION_AFTER | final public static String POSITION_AFTER(Code) | | |
POSITION_BEFORE | final public static String POSITION_BEFORE(Code) | | |
POSITION_UNDER | final public static String POSITION_UNDER(Code) | | |
removeAndPromoteChildren | public void removeAndPromoteChildren(DefaultMutableTreeNode node)(Code) | | Removes node, adding its child nodes to the parent node. If
node is the root, its first child is promoted to root, adding its
children after the root's remaining children.
|
sort | public static void sort(DefaultMutableTreeNode node, Comparator comparator)(Code) | | Sorts the children of node using comparator;
comparator should expect DefaultMutableTreeNodes to be
passed to it.
|
|
|