csli.util.swing.jtree
Class HidableTreeNode
java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
csli.util.swing.jtree.HidableTreeNode
- All Implemented Interfaces:
- Serializable, Cloneable, MutableTreeNode, TreeNode
public class HidableTreeNode
- extends DefaultMutableTreeNode
An extension to the DefaultMutableTreeNode that allows us to control whether or not a node
is hidden or not. This does not make nodes complete disapear, but makes them disapear
when the tree is being traversed if they are indeed hidden.
- Author:
- Karl Schultz
- See Also:
- Serialized Form
|
Field Summary |
protected boolean |
m_bIsHidden
The main extension of DefaultMutableTreeNode is this bIsHidden property, defaults to false (not-hidden). |
|
Method Summary |
TreeNode |
getChildAt(int index)
Overriding this function so we can control whether nodes are hidden or not. |
int |
getChildCount()
This allows us to hide children that have m_bIsHidden = true. |
boolean |
isHidden()
|
void |
setHidden(boolean hidden)
|
| Methods inherited from class javax.swing.tree.DefaultMutableTreeNode |
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildBefore, 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 |
m_bIsHidden
protected boolean m_bIsHidden
- The main extension of DefaultMutableTreeNode is this bIsHidden property, defaults to false (not-hidden).
HidableTreeNode
public HidableTreeNode()
isHidden
public boolean isHidden()
- Returns:
- Returns true if this node is hidden, false if not.
setHidden
public void setHidden(boolean hidden)
- Parameters:
hidden - The new value for whether this node is hidden or not.
getChildAt
public TreeNode getChildAt(int index)
- Overriding this function so we can control whether nodes are hidden or not.
- Specified by:
getChildAt in interface TreeNode- Overrides:
getChildAt in class DefaultMutableTreeNode
getChildCount
public int getChildCount()
- This allows us to hide children that have m_bIsHidden = true.
- Specified by:
getChildCount in interface TreeNode- Overrides:
getChildCount in class DefaultMutableTreeNode