Packageorg.aswing.tree
Classpublic class FHTreeStateNode
InheritanceFHTreeStateNode Inheritance DefaultMutableTreeNode

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.



Protected Properties
 PropertyDefined by
 Inheritedparent : MutableTreeNode
this node's parent, or null if this node has no parent
DefaultMutableTreeNode
Public Methods
 MethodDefined by
  
FHTreeStateNode(layoutCache:FixedHeightLayoutCache, userObject:Object, childIndex:int, row:int)
FHTreeStateNode
  
adjustRowBy(amount:int, startIndex:int = -2):void
adjustRowBy(amount:int, startIndex:int)
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.
FHTreeStateNode
 Inherited
append(newChild:MutableTreeNode):void
Removes newChild from its parent and makes it a child of this node by adding it to the end of this node's child array.
DefaultMutableTreeNode
 Inherited
Creates and returns an enumeration that traverses the subtree rooted at this node in breadth-first order.
DefaultMutableTreeNode
  
childInsertedAtModelIndex(index:int, isExpandedAndVisible:Boolean):void
Messaged when a child has been inserted at index.
FHTreeStateNode
 Inherited
children():Array
Creates and returns a forward-order enumeration of this node's children.
DefaultMutableTreeNode
  
collapse(adjustRows:Boolean):void
Collapses the receiver.
FHTreeStateNode
  
createChildFor(userObject:Object):FHTreeStateNode
Creates a new node to represent userObject.
FHTreeStateNode
 Inherited
Creates and returns an enumeration that traverses the subtree rooted at this node in depth-first order.
DefaultMutableTreeNode
  
expand():void
Expands the receiver.
FHTreeStateNode
 Inherited
Returns true if this node is allowed to have children.
DefaultMutableTreeNode
 Inherited
Returns the child in this node's child array that immediately follows aChild, which must be a child of this node.
DefaultMutableTreeNode
 Inherited
getChildAt(index:int):TreeNode
Returns the child at the specified index in this node's child array.
DefaultMutableTreeNode
  
Returns the child for the passed in model index, this will return null if the child for index has not yet been created (expanded).
FHTreeStateNode
 Inherited
Returns the child in this node's child array that immediately precedes aChild, which must be a child of this node.
DefaultMutableTreeNode
 Inherited
Returns the number of children of this node.
DefaultMutableTreeNode
  
Returns the index of the receiver in the model.
FHTreeStateNode
 Inherited
getDepth():int
Returns the depth of the tree rooted at this node -- the longest distance from this node to a leaf.
DefaultMutableTreeNode
 Inherited
Returns this node's first child.
DefaultMutableTreeNode
 Inherited
Finds and returns the first leaf that is a descendant of this node -- either this node or its first child's first leaf.
DefaultMutableTreeNode
 Inherited
getIndex(aChild:TreeNode):int
Returns the index of the specified child in this node's child array.
DefaultMutableTreeNode
 Inherited
Returns this node's last child.
DefaultMutableTreeNode
 Inherited
Finds and returns the last leaf that is a descendant of this node -- either this node or its last child's last leaf.
DefaultMutableTreeNode
 Inherited
Returns the total number of leaves that are descendants of this node.
DefaultMutableTreeNode
 Inherited
getLevel():int
Returns the number of levels above this node -- the distance from the root to this node.
DefaultMutableTreeNode
 Inherited
Returns the leaf after this node or null if this node is the last leaf in the tree.
DefaultMutableTreeNode
 Inherited
Returns the node that follows this node in a preorder traversal of this node's tree.
DefaultMutableTreeNode
 Inherited
Returns the next sibling of this node in the parent's children array.
DefaultMutableTreeNode
 Inherited
Returns this node's parent or null if this node has no parent.
DefaultMutableTreeNode
 Inherited
getPath():Array
Returns the path from the root, to get to this node.
DefaultMutableTreeNode
  
getPathForRow(row:int, nextRow:int, info:SearchInfo):Boolean
Returns true if there is a row for row.
FHTreeStateNode
 Inherited
Returns the leaf before this node or null if this node is the first leaf in the tree.
DefaultMutableTreeNode
 Inherited
Returns the node that precedes this node in a preorder traversal of this node's tree.
DefaultMutableTreeNode
 Inherited
Returns the previous sibling of this node in the parent's children array.
DefaultMutableTreeNode
 Inherited
Returns the root of the tree that contains this node.
DefaultMutableTreeNode
  
getRow():int
Returns the row of the receiver.
FHTreeStateNode
  
getRowToModelIndex(index:int):int
Returns the row of the child with a model index of index.
FHTreeStateNode
 Inherited
Returns the nearest common ancestor to this node and aNode.
DefaultMutableTreeNode
 Inherited
Returns the number of siblings of this node.
DefaultMutableTreeNode
  
Returns the number of children in the receiver by descending all expanded nodes and messaging them with getTotalChildCount.
FHTreeStateNode
  
Returns the TreePath of the receiver.
FHTreeStateNode
 Inherited
Returns this node's user object.
DefaultMutableTreeNode
 Inherited
Returns the user object path, from the root, to get to this node.
DefaultMutableTreeNode
  
The highest visible nodes have a depth of 0.
FHTreeStateNode
 Inherited
insert(newChild:MutableTreeNode, childIndex:int):void
Removes newChild from its present parent (if it has a parent), sets the child's parent to this node, and then adds the child to this node's child array at index childIndex.
DefaultMutableTreeNode
  
isExpanded():Boolean
Returns true if this node is expanded.
FHTreeStateNode
  
isLeaf():Boolean
Returns true if the receiver is a leaf.
FHTreeStateNode
 Inherited
isNodeAncestor(anotherNode:TreeNode):Boolean
Returns true if anotherNode is an ancestor of this node -- if it is this node, this node's parent, or an ancestor of this node's parent.
DefaultMutableTreeNode
 Inherited
isNodeChild(aNode:TreeNode):Boolean
Returns true if aNode is a child of this node.
DefaultMutableTreeNode
 Inherited
Returns true if anotherNode is a descendant of this node -- if it is this node, one of this node's children, or a descendant of one of this node's children.
DefaultMutableTreeNode
 Inherited
Returns true if and only if aNode is in the same tree as this node.
DefaultMutableTreeNode
 Inherited
isNodeSibling(anotherNode:TreeNode):Boolean
Returns true if anotherNode is a sibling of (has the same parent as) this node.
DefaultMutableTreeNode
 Inherited
isRoot():Boolean
Returns true if this node is the root of the tree.
DefaultMutableTreeNode
  
isVisible():Boolean
Returns true if this node is visible.
FHTreeStateNode
  
makeVisible():void
Makes the receiver visible, but invoking expandParentAndReceiver on the superclass.
FHTreeStateNode
 Inherited
Creates and returns an enumeration that follows the path from ancestor to this node.
DefaultMutableTreeNode
 Inherited
Creates and returns an enumeration that traverses the subtree rooted at this node in postorder.
DefaultMutableTreeNode
 Inherited
Creates and returns an enumeration that traverses the subtree rooted at this node in preorder.
DefaultMutableTreeNode
 Inherited
remove(aChild:MutableTreeNode):void
Removes aChild from this node's child array, giving it a null parent.
DefaultMutableTreeNode
 Inherited
Removes all of this node's children, setting their parents to null.
DefaultMutableTreeNode
  
removeAt(childIndex:int):void
Messaged when this node is removed from its parent, this messages removedFromMapping to remove all the children.
FHTreeStateNode
  
removeChildAtModelIndex(modelIndex:int, isChildVisible:Boolean):void
Adds newChild to this nodes children at the appropriate location.
FHTreeStateNode
 Inherited
Removes the subtree rooted at this node from the tree, giving this node a null parent.
DefaultMutableTreeNode
  
resetChildrenRowsFrom(newRow:int, childIndex:int, modelIndex:int):void
Resets the receivers childrens rows.
FHTreeStateNode
 Inherited
setAllowsChildren(allows:Boolean):void
Determines whether or not this node is allowed to have children.
DefaultMutableTreeNode
  
Messaged when this node is added somewhere, resets the path and adds a mapping from path to this node.
FHTreeStateNode
  
setPath(p:TreePath):void
FHTreeStateNode
  
setRow(r:int):void
FHTreeStateNode
  
setUserObject(o:*):void
Messaged to set the user object.
FHTreeStateNode
 Inherited
toString():String
Returns the result of sending toString() to this node's user object, or null if this node has no user object.
DefaultMutableTreeNode
Constructor detail
FHTreeStateNode()constructor
public function FHTreeStateNode(layoutCache:FixedHeightLayoutCache, userObject:Object, childIndex:int, row:int)Parameters
layoutCache:FixedHeightLayoutCache
 
userObject:Object
 
childIndex:int
 
row:int
Method detail
adjustRowBy()method
public function adjustRowBy(amount:int, startIndex:int = -2):void

adjustRowBy(amount:int, startIndex:int)
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.

adjustRowBy(amount:int)
or adjustRowBy(amount:int, -2)
Adjusts the receiver, and all its children rows by amount. Parameters

amount:int
 
startIndex:int (default = -2)
childInsertedAtModelIndex()method 
public function childInsertedAtModelIndex(index:int, isExpandedAndVisible:Boolean):void

Messaged when a child has been inserted at index. For all the children that have a childIndex >= index their index is incremented by one.

Parameters
index:int
 
isExpandedAndVisible:Boolean
collapse()method 
public function collapse(adjustRows:Boolean):void

Collapses the receiver. If adjustRows is true, the rows of nodes after the receiver are adjusted.

Parameters
adjustRows:Boolean
createChildFor()method 
public function createChildFor(userObject:Object):FHTreeStateNode

Creates a new node to represent userObject. This does NOT check to ensure there isn't already a child node to manage userObject.

Parameters
userObject:Object

Returns
FHTreeStateNode
expand()method 
public function expand():void

Expands the receiver.

getChildAtModelIndex()method 
public function getChildAtModelIndex(index:int):FHTreeStateNode

Returns the child for the passed in model index, this will return null if the child for index has not yet been created (expanded).

Parameters
index:int

Returns
FHTreeStateNode
getChildIndex()method 
public function getChildIndex():int

Returns the index of the receiver in the model.

Returns
int
getPathForRow()method 
public function getPathForRow(row:int, nextRow:int, info:SearchInfo):Boolean

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().

Parameters
row:int
 
nextRow:int
 
info:SearchInfo

Returns
Boolean
getRow()method 
public function getRow():int

Returns the row of the receiver.

Returns
int
getRowToModelIndex()method 
public function getRowToModelIndex(index:int):int

Returns the row of the child with a model index of index.

Parameters
index:int

Returns
int
getTotalChildCount()method 
public function getTotalChildCount():int

Returns the number of children in the receiver by descending all expanded nodes and messaging them with getTotalChildCount.

Returns
int
getTreePath()method 
public function getTreePath():TreePath

Returns the TreePath of the receiver.

Returns
TreePath
getVisibleLevel()method 
public function getVisibleLevel():int

The highest visible nodes have a depth of 0.

Returns
int
isExpanded()method 
public function isExpanded():Boolean

Returns true if this node is expanded.

Returns
Boolean
isLeaf()method 
public override function isLeaf():Boolean

Returns true if the receiver is a leaf.

Returns
Boolean
isVisible()method 
public function isVisible():Boolean

Returns true if this node is visible. This is determined by asking all the parents if they are expanded.

Returns
Boolean
makeVisible()method 
public function makeVisible():void

Makes the receiver visible, but invoking expandParentAndReceiver on the superclass.

removeAt()method 
public override function removeAt(childIndex:int):void

Messaged when this node is removed from its parent, this messages removedFromMapping to remove all the children.

Parameters
childIndex:int
removeChildAtModelIndex()method 
public function removeChildAtModelIndex(modelIndex:int, isChildVisible:Boolean):void

Adds newChild to this nodes children at the appropriate location. The location is determined from the childIndex of newChild.

Parameters
modelIndex:int
 
isChildVisible:Boolean
resetChildrenRowsFrom()method 
public function resetChildrenRowsFrom(newRow:int, childIndex:int, modelIndex:int):void

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.

Parameters
newRow:int
 
childIndex:int
 
modelIndex:int
setParent()method 
public override function setParent(parent:MutableTreeNode):void

Messaged when this node is added somewhere, resets the path and adds a mapping from path to this node.

Parameters
parent:MutableTreeNode
setPath()method 
public function setPath(p:TreePath):voidParameters
p:TreePath
setRow()method 
public function setRow(r:int):voidParameters
r:int
setUserObject()method 
public override function setUserObject(o:*):void

Messaged to set the user object. This resets the path.

Parameters
o:*