Home » openjdk-7 » javax » swing » tree » [javadoc | source]
class: VariableHeightLayoutCache.TreeStateNode [javadoc | source]

All Implemented Interfaces:
    Cloneable, MutableTreeNode, Serializable

TreeStateNode is used to keep track of each of the nodes that have been expanded. This will also cache the preferred size of the value it represents.
Field Summary
protected  int preferredWidth    Preferred size needed to draw the user object. 
protected  int preferredHeight     
protected  int xOrigin    X location that the user object will be drawn at. 
protected  int yOrigin    Y location that the user object will be drawn at. 
protected  boolean expanded    Is this node currently expanded? 
protected  boolean hasBeenExpanded    Has this node been expanded at least once? 
protected  TreePath path    Path of this node. 
Fields inherited from javax.swing.tree.DefaultMutableTreeNode:
EMPTY_ENUMERATION,  parent,  children,  userObject,  allowsChildren
 public TreeStateNode(Object value) 
Method from javax.swing.tree.VariableHeightLayoutCache$TreeStateNode Summary:
children,   collapse,   collapse,   deepMarkSizeInvalid,   didAdjustTree,   expand,   expand,   expandParentAndReceiver,   getLastVisibleNode,   getLoadedChildren,   getModelChildCount,   getNodeBounds,   getPreferredHeight,   getPreferredWidth,   getRow,   getTreePath,   getValue,   getVisibleChildCount,   getXOrigin,   getYOrigin,   hasBeenExpanded,   hasValidSize,   isExpanded,   isLeaf,   isVisible,   makeVisible,   markSizeInvalid,   remove,   removeFromMapping,   resetChildrenPaths,   setParent,   setUserObject,   setYOrigin,   shiftYOriginBy,   toggleExpanded,   updatePreferredSize,   updatePreferredSize
Methods from javax.swing.tree.DefaultMutableTreeNode:
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
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.tree.VariableHeightLayoutCache$TreeStateNode Detail:
 public Enumeration children() 
    Returns the children of the receiver. If the receiver is not currently expanded, this will return an empty enumeration.
 public  void collapse() 
    Collapses the receiver.
 protected  void collapse(boolean adjustTree) 
    Collapses this node in the tree. If adjustTree is true the tree and selection are updated accordingly.
 protected  void deepMarkSizeInvalid() 
    Marks the receivers size, and all its descendants sizes, as invalid.
 protected  void didAdjustTree() 
    Messaged from expand and collapse. This is meant for subclassers that may wish to do something interesting with this.
 public  void expand() 
    Expands the receiver.
 protected  void expand(boolean adjustTree) 
    Expands this node in the tree. This will load the children from the treeModel if this node has not previously been expanded. If adjustTree is true the tree and selection are updated accordingly.
 protected  void expandParentAndReceiver() 
    Invokes expandParentAndReceiver on the parent, and expands the receiver.
 public TreeStateNode getLastVisibleNode() 
    Returns the last visible node that is a child of this instance.
 protected Enumeration getLoadedChildren(boolean createIfNeeded) 
    Returns the children of the receiver. If the children haven't been loaded from the model and createIfNeeded is true, the children are first loaded.
 public int getModelChildCount() 
    Returns the number of children this will have. If the children have not yet been loaded, this messages the model.
 public Rectangle getNodeBounds(Rectangle placeIn) 
    Returns the location and size of this node.
 public int getPreferredHeight() 
    Returns the preferred height of the receiver.
 public int getPreferredWidth() 
    Returns the preferred width of the receiver.
 public int getRow() 
    Returns the row of the receiver.
 public TreePath getTreePath() 
    Returns a TreePath instance for this node.
 public Object getValue() 
    Returns the value the receiver is representing. This is a cover for getUserObject.
 public int getVisibleChildCount() 
    Returns the number of visible children, that is the number of children that are expanded, or leafs.
 public int getXOrigin() 
 public int getYOrigin() 
    Returns the y origin the user object will be drawn at.
 public boolean hasBeenExpanded() 
    Returns true if this node has been expanded at least once.
 public boolean hasValidSize() 
    Returns true if this node has a valid size.
 public boolean isExpanded() 
    Returns true if the receiver has been expanded.
 public boolean isLeaf() 
    Returns true if the receiver is a leaf.
 public boolean isVisible() 
    Returns true if the receiver is currently visible.
 public  void makeVisible() 
    Makes the receiver visible, but invoking expandParentAndReceiver on the superclass.
 protected  void markSizeInvalid() 
    Marks the receivers size as invalid. Next time the size, location is asked for it will be obtained.
 public  void remove(int childIndex) 
    Messaged when this node is removed from its parent, this messages removedFromMapping to remove all the children.
 protected  void removeFromMapping() 
    Removes the receiver, and all its children, from the mapping table.
 protected  void resetChildrenPaths(TreePath parentPath) 
    Recreates the receivers path, and all its childrens paths.
 public  void setParent(MutableTreeNode parent) 
    Messaged when this node is added somewhere, resets the path and adds a mapping from path to this node.
 public  void setUserObject(Object o) 
    Messaged to set the user object. This resets the path.
 protected  void setYOrigin(int newYOrigin) 
    Sets y origin the user object will be drawn at to newYOrigin.
 protected  void shiftYOriginBy(int offset) 
    Shifts the y origin by offset.
 public  void toggleExpanded() 
    Toggles the receiver between expanded and collapsed.
 protected  void updatePreferredSize() 
    Updates the receivers preferredSize by invoking updatePreferredSize with an argument of -1.
 protected  void updatePreferredSize(int index) 
    Updates the preferred size by asking the current renderer for the Dimension needed to draw the user object this instance represents.