class org.aswing.tree.FHTreeStateNode extends 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. @author paling
Instance Fields
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
.
function childInsertedAtModelIndex(index:Int, isExpandedAndVisible:Bool): 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.
function collapse(adjustRows:Bool): Void
Collapses the receiver. If adjustRows
is true,
the rows of nodes after the receiver are adjusted.
function createChildFor(userObject:Dynamic): FHTreeStateNode
Creates a new node to represent userObject
.
This does NOT check to ensure there isn't already a child node
to manage userObject
.
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).
function getPathForRow(row:Int, nextRow:Int, info:SearchInfo): Bool
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
().
function getRowToModelIndex(index:Int): Int
Returns the row of the child with a model index of
index
.
function getTotalChildCount(): Int
Returns the number of children in the receiver by descending all expanded nodes and messaging them with getTotalChildCount.
Returns true if this node is visible. This is determined by asking all the parents if they are expanded.
function makeVisible(): Void
Makes the receiver visible, but invoking
expandParentAndReceiver
on the superclass.
function removeAt(childIndex:Int): Void
Messaged when this node is removed from its parent, this messages
removedFromMapping
to remove all the children.
function removeChildAtModelIndex(modelIndex:Int, isChildVisible:Bool): Void
Adds newChild to this nodes children at the appropriate location. The location is determined from the childIndex of newChild.
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.
function setParent(parent:MutableTreeNode): Void
Messaged when this node is added somewhere, resets the path and adds a mapping from path to this node.