JMutableTreeNode()
Creates a tree node that has no parent and no children, but which allows children.

JMutableTreeNode(JTreeCellData treeCellData)
Creates a tree node with no parent, no children, but which allows children, and initializes it with the specified tree cell data.

JMutableTreeNode(JTreeCellData treeCellData, boolean allowsChildren)
Creates a tree node with no parent, no children, initialized with the specified tree cell data, and that allows children only if specified.

JMutableTreeNode(java.lang.String text)
Creates a tree node with no parent, no children, but which allows children, and initializes it to contain a JTreeCellData object whose display string is the specified text.

sortChildren(int recursionLevel)
If the indicated recursion level is non-negative, this method sorts the JMutableTreeNode's children and then recurses the number of levels indicated to sort their children.

void

sortDescendents()
Sorts all levels of the subtree represented by this JMutableTreeNode.

JMutableTreeNode

Creates a tree node with no parent, no children, initialized with the specified tree cell data, and that allows children only if specified.

Method Detail

compareTo

public int compareTo(java.lang.Object object)

Specified by:

compareTo in interface java.lang.Comparable

selectDescendants

public void selectDescendants(boolean b)

Starting with this tree node, select it and all of its descendants according to the flag b. If b is true, then nodes are selected (i.e. checked); otherwise, nodes are deselected (i.e. unchecked).

If the tree node is a radio button then it is enable or disabled because all the radio buttons within the group can't be selected. A typical usage of this method and related methods goes something like this:

someNode.selectDescendants( true );
someNode.updateNodes();

This example enables all descendants, skipping disabled nodes (and thus skipping the sub-tree under a disabled node), and then makes another pass to make sure that non-leaf nodes have the proper check mark (checked, half-checked, unchecked).

descendingUpdateNodes

Beginning with the given actionNode this method recurses down the sub-tree and updates the checked status of non-leaf checkboxes. This method ignores the values held by non-leaf checkboxes in the process of making them consistent with the states set in leaf nodes. All checkboxes are updated whether they are enabled or not.

It is best not to invoke this method directly but to use one of the updateNodes() methods instead. This is because nodes closer to the root than actionNode are not updated.

ascendingUpdateNodes

public void ascendingUpdateNodes()

updateNodes

public void updateNodes()

Method that re-synchronizes non-leaf checkboxes with the states reflected in leaf checkboxes.