public class Tree extends List implements IIMESupport
{
include "../core/Version.as";
private var IS_NEW_ROW_STYLE:Object =
{
depthColors: true,
indentation: true,
disclosureOpenIcon: true,
disclosureClosedIcon: true,
folderOpenIcon: true,
folderClosedIcon: true,
defaultLeafIcon: true
};
mx_internal static var createAccessibilityImplementation:Function;
//构造函数
public function Tree()
{
super();
itemRenderer = new ClassFactory(TreeItemRenderer);
editorXOffset = 12;
editorWidthOffset = -12;
addEventListener(TreeEvent.ITEM_OPENING, expandItemHandler,
false, EventPriority.DEFAULT_HANDLER);
}
//节点是否在展开中
private var opening:Boolean;
//动画对象
private var tween:Object;
//遮罩LIST
private var maskList:Array;
//水平滚动条位置
private var _userMaxHorizontalScrollPosition:Number = 0;
/**
* @private
*/
private var eventPending:Object;
/**
* @private
*/
private var eventAfterTween:Object;
/**
* @private
*/
private var oldLength:int = -1;
/**
* @private
*/
private var expandedItem:Object;
/**
* @private
*/
private var bSelectedItemRemoved:Boolean = false;
/**
* @private
* Used to slow the scrolling down a bit
*/
private var minScrollInterval:Number = 50;
/**
* @private
*/
private var rowNameID:Number = 0;
/**
* @private
*/
private var _editable:Boolean = false;
/**
* @private
* Used to block giving focus to editor on focusIn
*/
private var dontEdit:Boolean = false;
/**
* @private
*/
private var lastUserInteraction:Event;
/**
* @private
* automation delegate access
*/
mx_internal var _dropData:Object;
/**
* An object that specifies the icons for the items.
* Each entry in the object has a field name that is the item UID
* and a value that is an an object with the following format:
* <pre>
* {iconID: <i>Class</i>, iconID2: <i>Class</i>}
* </pre>
* The <code>iconID</code> field value is the class of the icon for
* a closed or leaf item and the <code>iconID2</code> is the class
* of the icon for an open item.
*
* <p>This property is intended to allow initialization of item icons.
* Changes to this array after initialization are not detected
* automatically.
* Use the <code>setItemIcon()</code> method to change icons dynamically.</p>
*
* @see #setItemIcon()
* @default undefined
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public var itemIcons:Object;
/**
* @private
*/
mx_internal var isOpening:Boolean = false;
/**
* @private
* used by opening tween
* rowIndex is the row below the row that was picked
* and is the first one that will actually change
*/
private var rowIndex:int;
/**
* @private
* Number of rows that are or will be tweened
*/
private var rowsTweened:int;
/**
* @private
*/
private var rowList:Array;
/**
* @private
*/
mx_internal var collectionLength:int;
/**
* A hook for accessibility
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
mx_internal var wrappedCollection:ICollectionView;
/**
* @private
*/
mx_internal var collectionThrowsIPE:Boolean;
/**
* @private
*/
private var haveItemIndices:Boolean;
/**
* @private
*/
private var lastTreeSeekPending:TreeSeekPending;
/**
* @private
*/
private var bFinishArrowKeySelection:Boolean = false;
private var proposedSelectedItem:Object;