public class TriStateNode
extends javax.swing.tree.DefaultMutableTreeNode
Modifier and Type | Class and Description |
---|---|
static class |
TriStateNode.NodeState |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROP_STATE_CHANGE |
Constructor and Description |
---|
TriStateNode(java.lang.Object userData) |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
PropertyChangeEvents with the PROP_STATE_CHANGE id will be fired when this
node changes state.
|
protected void |
firePropertyChange(java.lang.String name,
java.lang.Object oldValue,
java.lang.Object newValue) |
javax.swing.Icon |
getIcon()
Return the icon used to render this object in the tree.
|
java.lang.String |
getLabel()
Return the text used to render this object in the tree.
|
TriStateNode.NodeState |
getNodeState() |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener pcl) |
void |
setNodeState(TriStateNode.NodeState nodeState)
Set this node to the given status.
|
void |
setNodeState(TriStateNode.NodeState nodeState,
boolean propagateStateUp,
boolean propagateStateDown)
Set the state of this node, and optionally set the children and ancestors to
appropriate status.
|
void |
sort()
Sort the children of this node, and recursively their children
Most derivisions will probably want to override compareTo(...) to
get an appropriate sort.
|
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
public static final java.lang.String PROP_STATE_CHANGE
public void setNodeState(TriStateNode.NodeState nodeState)
nodeState
- public void setNodeState(TriStateNode.NodeState nodeState, boolean propagateStateUp, boolean propagateStateDown)
nodeState
- - the new state to set on this node.propagateStateUp
- - examine the parents all the way to the root, and set
the state appropriatly (not necessarily the same state as this node)propagateStateDown
- - examine the children all the way to the leaves,
and set the state to the same given value.public TriStateNode.NodeState getNodeState()
public void sort()
public void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
pcl
- public void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
protected void firePropertyChange(java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue)
public javax.swing.Icon getIcon()
public java.lang.String getLabel()