Class TreeNode

Object
   |
   +--TreeNode
Direct Known Subclasses:
Tree

class TreeNode

Don't use the constructor, use the Tree.createNode routine instead.


Constructor Summary
TreeNode (icon, tooltip, value, target)
           
 
Method Summary
 function appendChild(node)
           Appends specified node to this node's children array.
 function firstChild()
           Returns the first child node of this node's children array.
 function getAllChildren()
           Returns an array containing all this node's children.
 function hasChildren()
           Returns true if this node has children.
 function isLastSibling()
           Returns true if this is the last node in the parent's children array.
 function lastChild()
           Returns the last child node of this node's children array.
 function nextSibling()
           Returns the next sibling of this node in the parent's children array
 function removeChild(node)
           Removes the specified node from this node's children array.
<static> function anchor(name, id)
           Called when the user selects the node text.
<static> function collapseExpand(name, id)
           Called when the user collapses or expands a tree node.
<static> function updateStatus(name, id)
          
<static> function walk(node, array)
           Fills an array that traverses the subtree rooted at the specified node in preorder.

Constructor Detail

TreeNode

function TreeNode(icon, tooltip, value, target)

Method Detail

appendChild

function appendChild(node)
Appends specified node to this node's children array.

Parameters:
node - Node instance to append.


firstChild

function firstChild()
Returns the first child node of this node's children array.

Returns:
First child node or null if this node has no children.

getAllChildren

function getAllChildren()
Returns an array containing all this node's children.


hasChildren

function hasChildren()
Returns true if this node has children.


isLastSibling

function isLastSibling()
Returns true if this is the last node in the parent's children array.


lastChild

function lastChild()
Returns the last child node of this node's children array.

Returns:
Last child node or null if this node has no children.

nextSibling

function nextSibling()
Returns the next sibling of this node in the parent's children array

Returns:
The sibling of this node that immediately follows this node or null if this node has no parent or is the parent's last child.

removeChild

function removeChild(node)
Removes the specified node from this node's children array.

Parameters:
node - Node to remove.

Returns:
The removed node.

anchor

<static> function anchor(name, id)
Called when the user selects the node text. The text color will alter from blue(default) to red to mark the state change. The next time the text is selected the state will change back. When the target (see Tree.createNode) e.g. is an instance of the SVGController class, this routine will call the SVGController.show routine or SVGController.hide routine depending on the state change.

Parameters:
id - Branch id.

name - Name of the tree.


collapseExpand

<static> function collapseExpand(name, id)
Called when the user collapses or expands a tree node. When the target (see Tree.createNode) e.g. is an instance of the SVGController class, this routine will call the SVGController.collapseExpand routine.

Parameters:
id - Branch id.

name - Name of the tree.


updateStatus

<static> function updateStatus(name, id)


walk

<static> function walk(node, array)
Fills an array that traverses the subtree rooted at the specified node in preorder.

Parameters:
array - The array that will be filled with the traversed subtree.

node - The subtree to traverse.