Main Page | Packages | Class Tree | Index | Help

xp.controls

class TreeItemsControl

MovieClip
  |
  +--xp.system.UIControl
        |
        +--xp.controls.Container
              |
              +--xp.controls.ListItemsControl
                    |
                    +--xp.controls.TreeItemsControl


class TreeItemsControl
extends ListItemsControl

An ItemsControl representing a heirarchical list of nodes


Author:
ProWin Computers Ltd. - Rob Edgar

Version:
3.0.0.000

See also:
support@epresenterplus.com Style properties - padding


Field Summary

public static
classInfo: Object
A static class information object

public
level: Number
Tree level indicator, root is always -1

public
maxNodeDepth
The maximum depth of nodes in the tree that will be read

public
styleClass: String
The name of the style class this instance will use.

public
treeItems: Array
Hierarchical display tree of child rows

public
variableRowWidth: Boolean
Controls whether all rows are the same width

Fields inherited from class xp.controls.ListItemsControl

classInfo, host, rowAutosize, rowHeight, rows, rowWidth, styleClass, variableRowWidth

Fields inherited from class xp.controls.Container

__showStatusBar, __showTitleBar, acceptButton, cancelButton, children, classInfo, controlBar, controls, dataSource, enableBGMouseEvents, initialFocusControl, isRoot, lastFocus, layoutDescriptor, layoutId, layoutManager, rootContainer, styleClass, symbolId, tabList, tabModeWrap

Fields inherited from class xp.system.UIControl

__layout, allowDrop, autoLayout, bindingDefaultValue, bindingFormatter, bindingPath, bindingSource, bindingType, bindingValidator, border, causesValidation, classInfo, clickOnENTER, clickOnSPACE, container, context, data, disableAcceptButton, disableCancelButton, enableBGMouseEvents, enableDblClickEvent, enableKeyDownEvents, enableKeyEvents, enableKeyUpEvents, enableMouseWheelEvents, formatterOptions, horizontalAlignment, index, isBinding, itemId, logEnabled, parent, parentContainer, parentForm, percentageHeight, percentageWidth, styleClass, tabIndex, tabStop, tooltip, tree, verticalAlignment

Properties inherited from class xp.controls.ListItemsControl

hPosition, length

Properties inherited from class xp.controls.Container

childCount, footerHeight, headerHeight, innerBackground, innerBackgroundVisible, innerBorderBrush, innerBorderRadius, innerBorderStyle, innerBorderThickness, numChildren, showStatusBar, showTitleBar, status, title

Properties inherited from class xp.system.UIControl

alpha, autosize, background, backgroundVisible, bindings, borderBrush, borderRadius, borderShadow, borderStyle, borderThickness, bottom, dataSource, enableMouseEvents, focusManager, height, id, isEnabled, isFocused, isMouseOver, isPressed, isSelected, isValid, layout, left, margin, maxHeight, maxWidth, measuredHeight, measuredMinHeight, measuredMinWidth, measuredWidth, minHeight, minWidth, padding, readOnly, resources, right, styleName, top, triggers, visible, width, x, y

Constructor

public
TreeItemsControl ( )
Constructor - This should not be called directly.


Method Summary

public
addItem ( itemDesc: Object ): Object
Add an item to the ItemsControl


addNode ( node: XMLNode, parentItem: MovieClip, index: Number ): Object
Adds a node to the heirarchical tree Create a row and adds it to the treeItems and children array's

public
addNodes ( nodes: Array, parentItem: Object, index: Number ): Void
Adds a set of row nodes to the items control

public
buildFlatView ( ): Void
Rebuilds the flat children array from the hierarchical tree.

public
clearAll ( ): Void
Removes and destroys all items from the control

public
findNextRow ( index: Number, dir: Number ): Number
Get the index of the next visible row in the ItemControl.

public
getClass ( ): Function
Returns a reference to the components static class

public
getDisplayIndex ( node: XMLNode ): Number
Returns the display index of a given node.

public
getDisplayRow ( node: XMLNode )
Returns the row object associated with a given XMLNode

public
getDisplayRowCount ( ): Number
Calculates the number of displayed rows

public
getNodeDisplayedAt ( index: Number ): XMLNode
Maps a display index of the tree onto the node that is displayed there.

public
removeNode ( node: XMLNode ): Void
Removes a row associated with an XMLNode form the display tree

public
removeRow ( index: Number ): XMLNode
Removes a row from the display tree

public
updateTree ( node: XMLNode ): Void
Updates an entire sub tree

Methods inherited from class xp.controls.ListItemsControl

addItem, cycleItems, getClass, getItemAt, resizeColumns

Methods inherited from class xp.controls.Container

addChild, addChildren, addControlBar, clearAll, createChild, destroyChildAt, getChild, getChildAt, getChildFromMouse, getClass, getFooterHeight, getHeaderHeight, getNextControl, getUIBuilder, getViewMetrics, initLayoutManager, onChildFocus, processEnterKey, processEscapeKey, registerChild, selectNextControl, setDataContext, setFocus, setMeasuredMinSize, setMeasuredSize, unregisterChild

Methods inherited from class xp.system.UIControl

addBinding, addBindings, addEventListener, addPropertyTrigger, applyStyle, beginDeferUpdate, canUpdate, centerContent, checkState, containsFocus, destroy, destroyObject, drawFocus, endDeferUpdate, findFocusFromObject, findFocusInChildren, getBinding, getBounds, getCenter, getClass, getFocus, getFocusManager, getFocusRect, getLocation, getPropertyValue, getSize, getStateName, getTrigger, globalToLocalPoint, invalidate, invalidateLayout, invalidateSize, invalidateSizeAndLayout, invalidChild, isChild, isMouseDirectlyOver, isParent, localToGlobalPoint, localToLocalPoint, measure, mouseWheel, move, onChildFocus, onKillFocus, onSetFocus, processEnterKey, processEscapeKey, processTabKey, redraw, refresh, removeEventListener, routeEvent, setBounds, setFocus, setLocation, setPropertyValue, setSize, setValueChanged, update, validate



Field Documentation

classInfo

public static var classInfo: Object
A static class information object

Every class has an associated classInfo object that holds the version and other static information. The classInfo can be accessed either directly by referencing the static class or by calling getClass() on any class instance.

level

public var level: Number
Tree level indicator, root is always -1

maxNodeDepth

public var maxNodeDepth
The maximum depth of nodes in the tree that will be read

styleClass

public var styleClass: String
The name of the style class this instance will use.

treeItems

public var treeItems: Array
Hierarchical display tree of child rows

The ItemControl mimics a row node interface and is the root of the hierarchical tree structure, although it doesnt appear in the treeItems array.

variableRowWidth

public var variableRowWidth: Boolean
Controls whether all rows are the same width


Constructor Documentation

TreeItemsControl

public function TreeItemsControl()
Constructor - This should not be called directly.

Tree Panel are usually instantiated by a TreeView


Method Documentation

addItem

public function addItem(itemDesc: Object): Object
Add an item to the ItemsControl

This function is not supported in a TreeItemControl and does nothing if called. Use addNode instead.

Overrides:

Parameters:
itemDesc
An item descriptor
Returns:
The newly added item

addNode

function addNode(node: XMLNode,
 parentItem: MovieClip,
 index: Number): Object
Adds a node to the heirarchical tree Create a row and adds it to the treeItems and children array's

Parameters:
node
The xml node that the row will represent
parentItem
The parent row in the heirarchical display
index
An integer that specifies the index of the element in the parentItem child array where the insertion begins.
If null the itme is appended instead of inserted.
Returns:
A reference to the new row

addNodes

public function addNodes(nodes: Array,
 parentItem: Object,
 index: Number): Void
Adds a set of row nodes to the items control

Calls the internal method addChildNodes to row nodes based on the array of XMLNodes. AddChildNodes can call itself recursively to add nested childNodes. Finally call updateLayout to refresh the display

Parameters:
nodes
node An array of XMLNodes
parentItem
The parent row node
index
An integer that specifies the index of the element in the parentItem child array where the insertion begins.
If null the itme is appended instead of inserted.

buildFlatView

public function buildFlatView(): Void
Rebuilds the flat children array from the hierarchical tree.

Our heirachical tree structure list can change though drag and drop or other reasons. If the structure has changed we need to rebuild our children list.

clearAll

public function clearAll(): Void
Removes and destroys all items from the control

Overrides:

findNextRow

public function findNextRow(index: Number,
 dir: Number): Number
Get the index of the next visible row in the ItemControl.

Starts searching at index and moves in the direction dir

Parameters:
index
The starting index Dir The direction to search in, 1 for down and -1 for up.
dir

getClass

public function getClass(): Function
Returns a reference to the components static class

Overrides:

getDisplayIndex

public function getDisplayIndex(node: XMLNode): Number
Returns the display index of a given node.

returns the display index of the node specified in the node parameter.

Returns:
The index of the specified node, or -1 if the node is not currently displayed.

getDisplayRow

public function getDisplayRow(node: XMLNode)
Returns the row object associated with a given XMLNode

Parameters:
node
An XMLNode

getDisplayRowCount

public function getDisplayRowCount(): Number
Calculates the number of displayed rows

This is the number of rows with visible equal true.

getNodeDisplayedAt

public function getNodeDisplayedAt(index: Number): XMLNode
Maps a display index of the tree onto the node that is displayed there.

returns the display index of the node specified in the node parameter.

Parameters:
index
An integer representing the display position in the viewable area of the tree. This number is zero-based; the node at the first position is 0, second position is 1, and so on.
Returns:
The specified XMLNode object.

removeNode

public function removeNode(node: XMLNode): Void
Removes a row associated with an XMLNode form the display tree

Removes the row assoicated with a node from the display list. Also removes all its children

Parameters:
node
An XMLNode

removeRow

public function removeRow(index: Number): XMLNode
Removes a row from the display tree

Removes a row (specified by its display index position) from the display list

Parameters:
index
An integer representing the display position in the the tree. This number is zero-based; the node at the first position is 0, second position is 1, and so on.
Returns:
The specified XMLNode object.

updateTree

public function updateTree(node: XMLNode): Void
Updates an entire sub tree

Rebuild the childnodes of the specified node

Parameters:
node
An XMLNode

The documentation was generated from the following file:


Generated on 10/30/2005 9:34:02 PM by AS2Doc