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

All Implemented Interfaces:
    Cloneable, MutableTreeNode, Serializable

FHTreeStateNode is used to track what has been expanded. FHTreeStateNode differs from VariableHeightTreeState.TreeStateNode in that it is highly model intensive. That is almost all queries to a FHTreeStateNode result in the TreeModel being queried. And it obviously does not support variable sized row heights.
Field Summary
protected  boolean isExpanded    Is this node expanded? 
protected  int childIndex    Index of this node from the model. 
protected  int childCount    Child count of the receiver. 
protected  int row    Row of the receiver. This is only valid if the row is expanded. 
protected  TreePath path    Path of this node. 
Fields inherited from javax.swing.tree.DefaultMutableTreeNode:
EMPTY_ENUMERATION,  parent,  children,  userObject,  allowsChildren
 public FHTreeStateNode(Object userObject,
    int childIndex,
    int row) 
Method from javax.swing.tree.FixedHeightLayoutCache$FHTreeStateNode Summary:
addNode,   adjustChildIndexs,   adjustRowBy,   adjustRowBy,   childInsertedAtModelIndex,   collapse,   createChildFor,   didAdjustTree,   didExpand,   expand,   expandParentAndReceiver,   getChildAtModelIndex,   getChildIndex,   getCountTo,   getNumExpandedChildrenTo,   getPathForRow,   getRow,   getRowToModelIndex,   getTotalChildCount,   getTreePath,   getVisibleLevel,   isExpanded,   isLeaf,   isVisible,   makeVisible,   remove,   removeChildAtModelIndex,   removeFromMapping,   resetChildrenPaths,   resetChildrenRowsFrom,   setParent,   setRowAndChildren,   setUserObject
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.FixedHeightLayoutCache$FHTreeStateNode Detail:
 protected  void addNode(FHTreeStateNode newChild) 
    Adds newChild to this nodes children at the appropriate location. The location is determined from the childIndex of newChild.
 protected  void adjustChildIndexs(int index,
    int amount) 
    Adjusts the child indexs of the receivers children by amount, starting at index.
 protected  void adjustRowBy(int amount) 
    Adjusts the receiver, and all its children rows by amount.
 protected  void adjustRowBy(int amount,
    int startIndex) 
    Adjusts this node, its child, and its parent starting at an index of index index is the index of the child to start adjusting from, which is not necessarily the model index.
 protected  void childInsertedAtModelIndex(int index,
    boolean isExpandedAndVisible) 
    Messaged when a child has been inserted at index. For all the children that have a childIndex >= index their index is incremented by one.
 protected  void collapse(boolean adjustRows) 
    Collapses the receiver. If adjustRows is true, the rows of nodes after the receiver are adjusted.
 protected FHTreeStateNode createChildFor(Object userObject) 
    Creates a new node to represent userObject. This does NOT check to ensure there isn't already a child node to manage userObject.
 protected  void didAdjustTree() 
    Messaged when this node either expands or collapses.
 protected  void didExpand() 
    Messaged when the node has expanded. This updates all of the receivers children rows, as well as the total row count.
 protected  void expand() 
    Expands the receiver.
 protected  void expandParentAndReceiver() 
    Invokes expandParentAndReceiver on the parent, and expands the receiver.
 public FHTreeStateNode getChildAtModelIndex(int index) 
    Returns the child for the passed in model index, this will return null if the child for index has not yet been created (expanded).
 public int getChildIndex() 
    Returns the index of the receiver in the model.
 protected int getCountTo(int stopIndex) 
    Asks all the children of the receiver for their totalChildCount and returns this value (plus stopIndex).
 protected int getNumExpandedChildrenTo(int stopIndex) 
    Returns the number of children that are expanded to stopIndex. This does not include the number of children that the child at stopIndex might have.
 protected boolean getPathForRow(int row,
    int nextRow,
    SearchInfo info) 
    Returns true if there is a row for row. nextRow gives the bounds of the receiver. Information about the found row is returned in info. This should be invoked on root with nextRow set to getRowCount().
 public int getRow() 
    Returns the row of the receiver.
 public int getRowToModelIndex(int index) 
    Returns the row of the child with a model index of index.
 public int getTotalChildCount() 
    Returns the number of children in the receiver by descending all expanded nodes and messaging them with getTotalChildCount.
 public TreePath getTreePath() 
    Returns the TreePath of the receiver.
 public int getVisibleLevel() 
    The highest visible nodes have a depth of 0.
 public boolean isExpanded() 
    Returns true if this node is expanded.
 public boolean isLeaf() 
    Returns true if the receiver is a leaf.
 public boolean isVisible() 
    Returns true if this node is visible. This is determined by asking all the parents if they are expanded.
 protected  void makeVisible() 
    Makes the receiver visible, but invoking expandParentAndReceiver on the superclass.
 public  void remove(int childIndex) 
    Messaged when this node is removed from its parent, this messages removedFromMapping to remove all the children.
 protected  void removeChildAtModelIndex(int modelIndex,
    boolean isChildVisible) 
    Removes the child at modelIndex. isChildVisible should be true if the receiver is visible and expanded.
 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.
 protected  void resetChildrenRowsFrom(int newRow,
    int childIndex,
    int modelIndex) 
    Resets the receivers childrens rows. Starting with the child at childIndex (and modelIndex) to newRow. This uses setRowAndChildren to recursively descend children, and uses resetRowSelection to ascend parents.
 public  void setParent(MutableTreeNode parent) 
    Messaged when this node is added somewhere, resets the path and adds a mapping from path to this node.
 protected int setRowAndChildren(int nextRow) 
    Sets the receivers row to nextRow and recursively updates all the children of the receivers rows. The index the next row is to be placed as is returned.
 public  void setUserObject(Object o) 
    Messaged to set the user object. This resets the path.