Packageorg.aswing
Classpublic class JTree
InheritanceJTree Inheritance Container Inheritance Component Inheritance AWSprite Inheritance flash.display.Sprite
ImplementsCellEditorListener, TreeModelListener, Viewportable

A control that displays a set of hierarchical data as an outline. A control that displays a set of hierarchical data as an outline. You can find task-oriented documentation and examples of using trees in How to Use Trees, a section in The Java Tutorial.

A specific node in a tree can be identified either by a TreePath (an object that encapsulates a node and all of its ancestors), or by its display row, where each row in the display area displays one node. An expanded node is a non-leaf node (as identified by TreeModel.isLeaf(node) returning false) that will displays its children when all its ancestors are expanded. A collapsed node is one which hides them. A hidden node is one which is under a collapsed ancestor. All of a viewable nodes parents are expanded, but may or may not be displayed. A displayed node is both viewable and in the display area, where it can be seen.

The following JTree methods use "visible" to mean "displayed":

The next group of JTree methods use "visible" to mean "viewable" (under an expanded parent):

If you are interested in knowing when the selection listen the the TreeSelectionEvent.TREE_SELECTION_CHANGED event.

If you are interested in detecting either double-click events or when a user clicks on a node, regardless of whether or not it was selected, we recommend you do the following:
     yourTree.addEventListener(MouseEvent.MOUSE_DOWN, __onPressed);
     ....
     
     public function __onPressed(e:Event):void {
         var selPath:TreePath = tree.getMousePointedPath();
         ....
     }
 };
 

To use JTree to display compound nodes (for example, nodes containing both a graphic icon and text), subclass {

See also

TreeModel


Public Properties
 PropertyDefined by
 InheritedcacheAsBitmap : Boolean
AWSprite
 Inheritedcontainer : Container
Component
 Inheritedfilters : Array
AWSprite
 Inheritedheight : Number
Component
 Inheritedmask : DisplayObject
AWSprite
 InheritednumChildren : int
AWSprite
 Inheritedvisible : Boolean
Component
 Inheritedwidth : Number
Component
 Inheritedx : Number
Component
 Inheritedy : Number
Component
Protected Properties
 PropertyDefined by
 Inheritedbounds : IntRectangle
Component
 Inheritedchildren : Array
Container
 Inheritedd_numChildren : int
AWSprite
 InheriteddrawTransparentTrigger : Boolean = true
Component
 Inheritedd_visible : Boolean
Returns the DisplayObject.visible directly.
Component
 Inheritedd_x : Number
Returns DisplayObject.x directly.
Component
 Inheritedd_y : Number
Returns DisplayObject.y directly.
Component
 Inheritedlayout : LayoutManager
Container
 InheritedreadyToPaint : Boolean
Component
 Inheritedui : ComponentUI
Component
 Inheritedvalid : Boolean
Component
Public Methods
 MethodDefined by
  
JTree(newModel:TreeModel = null)
JTree(newModel:TreeModel)
; JTree() a defaul model will be created
Returns an instance of JTree which displays the root node -- the tree is created using the specified data model.
JTree
 Inherited
addChild(dis:DisplayObject):DisplayObject
Adds a child DisplayObject instance to this DisplayObjectContainer instance.
AWSprite
 Inherited
addChildAt(child:DisplayObject, index:int):DisplayObject
AWSprite
 Inherited
Adds a component to be the acceptable drag initiator to this component.
Component
  
addSelectionInterval(index0:int, index1:int, programmatic:Boolean = true):void
Adds the paths between index0 and index1, inclusive, to the selection.
JTree
  
addSelectionListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Adds a listener for tree selection events.
JTree
  
addSelectionPath(path:TreePath, programmatic:Boolean = true):void
Adds the node identified by the specified TreePath to the current selection.
JTree
  
addSelectionPaths(paths:Array, programmatic:Boolean = true):void
Adds each path in the array of paths to the current selection.
JTree
  
addSelectionRow(row:int, programmatic:Boolean = true):void
Adds the path at the specified row to the current selection.
JTree
  
addSelectionRows(rows:Array, programmatic:Boolean = true):void
Adds the paths at each of the specified rows to the current selection.
JTree
  
addStateListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add a listener to listen the viewpoat state change event.
JTree
 Inherited
append(com:Component, constraints:Object = null):void
On Component just can add to one Container.
Container
 Inherited
appendAll(... coms):void
Adds one or more component to the container with null constraints
Container
 Inherited
bringToBottom(child:DisplayObject):void
Brings a child to bottom.
AWSprite
 Inherited
bringToTop(child:DisplayObject):void
Brings a child to top.
AWSprite
  
Cancels the current editing session.
JTree
  
clearSelection(programmatic:Boolean = true):void
Clears the selection.
JTree
  
Ensures that the node identified by the specified path is collapsed and viewable.
JTree
  
collapseRow(row:int):void
Ensures that the node in the specified row is collapsed.
JTree
 Inherited
Component
 Inherited
containsChild(child:DisplayObject):Boolean
Returns whether child is directly child of this sprite, true only if getChildIndex(child) >= 0.
AWSprite
 Inherited
doLayout():void
layout this container
Container
  
JTree
  
JTree
  
expandPath(path:TreePath):void
Ensures that the node identified by the specified path is expanded and viewable.
JTree
  
expandRow(row:int):void
Ensures that the node in the specified row is expanded and viewable.
JTree
 Inherited
fireFocusKeyDownEvent(e:KeyboardEvent):void
Component
 Inherited
fireFocusKeyUpEvent(e:KeyboardEvent):void
Component
  
Notifies all listeners that have registered interest for notification on this event type.
JTree
  
Notifies all listeners that have registered interest for notification on this event type.
JTree
  
Notifies all listeners that have registered interest for notification on this event type.
JTree
  
Notifies all listeners that have registered interest for notification on this event type.
JTree
 Inherited
getAlignmentX():Number
Returns the alignment along the x axis.
Component
 Inherited
getAlignmentY():Number
Returns the alignment along the y axis.
Component
 Inherited
getAlpha():Number
Returns the alpha of this component.
Component
  
Returns the path identified as the anchor.
JTree
 Inherited
getAwmlID():String
Returns ID used to identify components created from AWML.
Component
 Inherited
getAwmlIndex():Number
Returns position index of the component inside its AWML container.
Component
 Inherited
Returns namespace name used to identify components created from AWML.
Component
 Inherited
Gets the background color of this component.
Component
 Inherited
Returns the background decorator of this component.
Component
 Inherited
Returns the border.
Component
 Inherited
getBounds(targetCoordinateSpace:DisplayObject):Rectangle
Same to DisplayObject.getBounds(), just add a explaination here that if you want to get the component bounds, see {
Component
  
Returns the editor used to edit entries in the tree.
JTree
  
Returns the current TreeCellFactory that is rendering each cell.
JTree
 Inherited
getChildAt(index:int):DisplayObject
AWSprite
 Inherited
getChildByName(name:String):DisplayObject
AWSprite
 Inherited
getChildIndex(child:DisplayObject):int
AWSprite
 Inherited
Returns the value of the property with the specified key.
Component
 Inherited
Returns the clip bounds.
Component
  
Returns the path to the node that is closest to x,y.
JTree
  
getClosestRowForLocation(x:int, y:int):int
Returns the row to the node that is closest to x,y.
JTree
 Inherited

Stores the bounds value of this component into "return value" rv and returns rv.

Component
 Inherited
getComponent(index:int):Component
Gets the nth(index) component in this container.
Container
 Inherited
Gets the number of components in this container.
Container
 Inherited
getConstraints():Object
Gets cpmponent's constraints.
Component
  
JTree
  
Returns the path to the element that is currently being edited.
JTree
  
Returns an Array of the descendants of the path parent that are currently expanded.
JTree
  
JTree
  
Returns the fixed cell width value -- the value specified by setting the fixedCellWidth property, rather than that calculated from the cell elements.
JTree
 Inherited
Returns the focus manager for this component's stage, or null if this component is not on stage.
Component
 Inherited
Returns the focus traversal policy of this container, it will return its parent's focus traversal policy if its self is null.
Container
 Inherited
Gets the font of this component.
Component
 Inherited
Gets the foreground color of this component.
Component
 Inherited
Returns the foreground decorator of this component.
Component
 Inherited
Stores the global location value of this component into "return value" p and returns p.
Component
 Inherited
getHeight():int
Returns the current height of this component
Component
 Inherited
Returns the current top index for a new child(none forground child).
AWSprite
  
JTree
  
JTree
 Inherited
Returns the index of the child component in this container.
Container
 Inherited
If a border has been set on this component, returns the border's insets; otherwise returns an empty insets.
Component
 Inherited
getInternalFocusObject():InteractiveObject
Returns the object to receive the focus for this component.
Component
 Inherited
Returns the keyboard manager of this component's JRootPane ancestor.
Component
  
Returns the last path component in the first node of the current selection.
JTree
 Inherited
Container
  
Returns the path identified as the lead.
JTree
  
Returns the row index corresponding to the lead path.
JTree
 Inherited
Stores the location value of this component into "return value" rv and returns rv.
Component
  
Returns the location in the JTree view area of the logic location.
JTree
 Inherited
Returns the current bottom index for none background child.
AWSprite
 Inherited
Returns getMaximumSize().height
Component
 Inherited
Component
 Inherited
Returns getMaximumSize().width
Component
  
Returns the last selected row.
JTree
 Inherited
Returns getMinimumSize().height
Component
 Inherited
Component
 Inherited
Returns getMinimumSize().width
Component
  
Gets the first selected row.
JTree
  
Returns the TreeModel that is providing the data.
JTree
  
Returns the treePath that the user mouse pointed, null if no path was pointed.
JTree
 Inherited
Returns the coordinate of the mouse position, in pixels, in the component scope.
Component
 Inherited
getName():String
Returns the name of the component
Component
 Inherited
Returns the bounds that component should paint in.
Component
 Inherited
Returns the Container parent, if it parent is not a Container, null will be returned.
Component
  
Returns the IntRectangle that the specified node will be drawn into.
JTree
  
Returns the path for the node at the specified location.
JTree
  
Returns the path for the specified row.
JTree
  
Returns the location in the JTree view area of the logic location.
JTree
 Inherited
Returns getPreferredSize().height
Component
 Inherited
Component
 Inherited
Returns getPreferredSize().width
Component
 Inherited
Returns the first JRootPane ancestor of this component.
Component
  
Returns the IntRectangle that the node at the specified row is drawn in.
JTree
  
Returns the number of rows that are currently being displayed.
JTree
  
getRowForLocation(x:int, y:int):int
Returns the row for the specified location.
JTree
  
Returns the row that displays the node identified by the specified path.
JTree
  
Returns the height of each row.
JTree
  
Returns the background color for selected cells.
JTree
  
Returns the number of nodes selected.
JTree
  
Returns the foreground color for selected cells.
JTree
  
Returns the model for selections.
JTree
  
Returns the path to the first selected node.
JTree
  
Returns the paths of all selected values.
JTree
  
Returns the first selected row.
JTree
  
Returns all of the currently selected rows.
JTree
 Inherited
Stores the size value of this component into "return value" rv and returns rv.
Component
  
Returns the number of mouse clicks needed to expand or close a node.
JTree
 Inherited
getToolTipText():String
Returns the tooltip string that has been set with setToolTipText.
Component
  
getTreeUI():TreeUI
Returns the L&F object that renders this component.
JTree
 Inherited
Component
  
getUIClassID():String
Returns the name of the L&F class that renders this component.
JTree
  
JTree
  
JTree
  
JTree
  
JTree
  
JTree
  
JTree
  
Returns the number of rows that are displayed in the display area.
JTree
 Inherited
getWidth():int
Returns the current width of this component
Component
 Inherited
getX():int
Returns the current x coordinate of the components.
Component
 Inherited
getY():int
Returns the current y coordinate of the components.
Component
 Inherited
Component
  
hasBeenExpanded(path:TreePath):Boolean
Returns true if the node identified by the path has ever been expanded.
JTree
 Inherited
hitTestMouse():Boolean
Returns whether the component hit the mouse.
Component
 Inherited
hitTestObject(obj:DisplayObject):Boolean
AWSprite
 Inherited
hitTestPoint(x:Number, y:Number, shapeFlag:Boolean = false):Boolean
AWSprite
 Inherited
insert(i:int, com:Component, constraints:Object = null):void
Add component to spesified index.
Container
 Inherited
insertAll(index:int, ... coms):void
Insets one or more component to the container with null constraints at specified starting index.
Container
 Inherited
invalidate():void
Invalidates the container.
Container
 Inherited
Clears this component and all parents above it's preferred size caches.
Component
 Inherited
Checks if the component is contained in the component hierarchy of this container.
Container
 Inherited
Returns whether or not the preferred size, minimum size and max size cache is turned on.
Component
 Inherited
isClipMasked():Boolean
Returns whether the component clip should be masked by its bounds.
AWSprite
  
isCollapsed(path:TreePath):Boolean
Returns true if the value identified by path is currently collapsed, this will return false if any of the values in path are currently not being displayed.
JTree
  
isCollapsedOfRow(row:int):Boolean
Returns true if the node at the specified display row is collapsed.
JTree
 Inherited
Returns whether the component is acceptable drag initiator for this component.
Component
 Inherited
isDragEnabled():Boolean
Returns whether this component can fire ON_DRAG_RECOGNIZED event.
Component
 Inherited
isDropTrigger():Boolean
Returns whether this component can trigger dragging component to fire drag events when dragging over to this component.(Default value is false)
Component
  
isEditable():Boolean
Returns true if the tree is editable.
JTree
  
isEditing():Boolean
Returns true if the tree is being edited.
JTree
 Inherited
isEnabled():Boolean
Returns whether the component is enabled.
Component
  
isExpanded(path:TreePath):Boolean
Returns true if the node identified by the path is currently expanded,
JTree
  
isExpandedOfRow(row:int):Boolean
Returns true if the node at the specified display row is currently expanded.
JTree
  
Returns the expandsSelectedPaths property.
JTree
 Inherited
isFocusable():Boolean
Returns whether this Component can be focused.
Component
 Inherited
isFocusableSet():Boolean
Returns whether or not the opaque property is set by user.
Component
 Inherited
isFocusOwner():Boolean
Returns true if this Component is the focus owner.
Component
 Inherited
isFontValidated():Boolean
Returns whether the new font are applied and taked effect.
Component
  
Returns the indicator that tells what happens when editing is interrupted.
JTree
 Inherited
isOnStage():Boolean
Determines whether or not this component is on stage(on the display list).
Component
 Inherited
isOpaque():Boolean
Returns true if this component is completely opaque.
Component
 Inherited
isOpaqueSet():Boolean
Returns whether or not the opaque property is set by user.
Component
  
isPathEditable(path:TreePath):Boolean
Returns isEditable.
JTree
  
isPathSelected(path:TreePath):Boolean
Returns true if the item identified by the path is currently selected.
JTree
  
isPathVisible(path:TreePath):Boolean
Returns true if the value identified by path is currently viewable, which means it is either the root or all of its parents are expanded.
JTree
  
isRootVisible():Boolean
Returns true if the root node of the tree is displayed.
JTree
  
isRowHeightSet():Boolean
Returns whether or not row height is set by user.
JTree
  
isRowSelected(row:int):Boolean
Returns true if the node identified by row is selected.
JTree
  
Returns the value of the scrollsOnExpand property.
JTree
  
Returns whether or not scrolls on expand is set by user.
JTree
  
isSelectionEmpty():Boolean
Returns true if the selection is currently empty.
JTree
 Inherited
isShowing():Boolean
Determines whether this component is showing on screen.
Component
 Inherited
isUIElement():Boolean
Returns true if this component is just a ui element component, false means this component is a regular use created component.
Component
 Inherited
isValid():Boolean
Determines whether this component is valid.
Component
 Inherited
isValidateRoot():Boolean
If this method returns true, revalidate calls by descendants of this component will cause the entire tree beginning with this root to be validated.
Component
 Inherited
isVisible():Boolean
Component
 Inherited
makeFocus():void
Makes this component's internal focus object to be the stage focus directly, without any judgement.
Component
  
Ensures that the node identified by path is currently viewable.
JTree
 Inherited
pack():void
Causes this component to be sized to fit the preferred size.
Component
 Inherited
paintFocusRect(force:Boolean = false):void
Paints the focus rect if need.
Component
 Inherited
Redraw the component UI face immediately if it is visible and ready to paint.
Component
 Inherited
Calls parent reAppendChildren if parent is a container.
Component
 Inherited
putClientProperty(key:*, value:*):void
Adds an arbitrary key/value "client property" to this component.
Component
 Inherited
Removes all children and then append them with their constraints.
Container
 Inherited
reAppendToParent(constraints:Object = null):void
Removes this component from its parent and then append it with specified constraints.
Component
 Inherited
Remove the specified child component.
Container
 Inherited
removeAll():void
Remove all child components.
Container
 Inherited
Remove the specified index child component.
Container
 Inherited
removeChild(child:DisplayObject):DisplayObject
Removes a normal display object child.
Container
 Inherited
removeChildAt(index:int):DisplayObject
Removes a normal display object child with index.
Container
  
Removes any paths from the selection model that are descendants of the nodes identified by in e.
JTree
 Inherited
Removes a component to be the acceptable drag initiator to this component.
Component
 Inherited
Removes this component from its parent, whatever it is as a component child or only a display object child, or it's parent is just a display object container.
Component
  
removeSelectionInterval(index0:int, index1:int, programmatic:Boolean = true):void
Removes the nodes between index0 and index1, inclusive, from the selection.
JTree
  
removeSelectionListener(listener:Function):void
JTree
  
removeSelectionPath(path:TreePath, programmatic:Boolean = true):void
Removes the node identified by the specified path from the current selection.
JTree
  
removeSelectionPaths(paths:Array, programmatic:Boolean = true):void
Removes the nodes identified by the specified paths from the current selection.
JTree
  
removeSelectionRow(row:int, programmatic:Boolean = true):void
Removes the row at the index row from the current selection.
JTree
  
removeSelectionRows(rows:Array, programmatic:Boolean = true):void
Removes the rows that are selected at each of the specified rows.
JTree
  
removeStateListener(listener:Function):void
Removes a state listener.
JTree
 Inherited
repaint():void
Redraws the component face next RENDER event.This method can be called often, so it needs to execute quickly.
Component
 Inherited
Component
 Inherited
requestFocus():Boolean
Requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window.
Component
 Inherited
revalidate():void
Supports deferred automatic layout.
Component
 Inherited
Component
  
Makes sure all the path components in path are expanded (except for the last path component) and scrolls so that the node identified by the path is displayed.
JTree
  
scrollRectToVisible(contentRect:IntRectangle, programmatic:Boolean = true):void
JTree
  
scrollRowToVisible(row:int):void
Scrolls the item identified by row until it is displayed.
JTree
 Inherited
setAlignmentX(ax:Number):void
Component
 Inherited
setAlignmentY(ay:Number):void
Component
 Inherited
setAlpha(alpha:Number):void
Indicates the alpha transparency value of the component.
Component
  
Sets the path identified as the anchor.
JTree
 Inherited
setAwmlID(id:String):void
Sets ID used to identify components created from AWML.
Component
 Inherited
setAwmlIndex(index:Number):void
Sets ID used to identify components created from AWML.
Component
 Inherited
setAwmlNamespace(theNamespace:String):void
Sets namespace used to identify components created from AWML.
Component
 Inherited
Sets the background color of this component.
Component
 Inherited
Sets a decorator to be the component background, it will represent the component background with a DisplayObject.
Component
 Inherited
setBorder(b:Border):void
Sets the border for the component, null to remove border.
Component
 Inherited
This method will call setComBounds()
Component
 Inherited
setCachePreferSizes(b:Boolean):void
Sets whether or not turn on the preferred size, minimum size and max size cache.
Component
  
setCellEditor(cellEditor:TreeCellEditor):void
Sets the cell editor.
JTree
  
Sets the TreeCellFactory that will be used to draw each cell.
JTree
 Inherited
setChildIndex(child:DisplayObject, index:int):void
AWSprite
 Inherited
Sets the clip bounds, a rectangle mask to make specified bounds visible.
Component
 Inherited
setClipMasked(m:Boolean):void
Sets whether the component clip should be masked by its bounds.
AWSprite
 Inherited
Sets the clip size, a rectangle mask to make specified bounds visible.
Component
 Inherited
Moves and resizes this component.
Component
 Inherited
setComBoundsXYWH(x:int, y:int, w:int, h:int):void
Moves and resizes this component.
Component
 Inherited
setConstraints(constraints:Object):void
Sets component's constraints.
Component
 Inherited
Sets a function to judge whether a component is acceptable drag initiator.
Component
 Inherited
setDragEnabled(b:Boolean):void
Sets whether this component can fire ON_DRAG_RECOGNIZED event.
Component
 Inherited
setDropTrigger(b:Boolean):void
Sets whether this component can trigger dragging component to fire drag events when dragging over to this component.
Component
  
setEditable(flag:Boolean):void
Determines whether the tree is editable.
JTree
 Inherited
setEnabled(b:Boolean):void
Enable or disable the component.
Component
  
setExpandsSelectedPaths(newValue:Boolean):void
Configures the expandsSelectedPaths property.
JTree
  
setFixedCellWidth(width:int):void
Sets the width of every cell in the list.
JTree
 Inherited
setFocusable(b:Boolean):void
Sets the focusable state of this Component to the specified value.
Component
 Inherited
setFocusableSet(b:Boolean):void
Indicate that the focusable property is set by user or not.
Component
 Inherited
Sets the focus traversal policy to this container, or sets null to make this container use its parent's focus traversal policy.
Container
  
setFont(f:ASFont):void
JTree
 Inherited
setFontValidated(b:Boolean):void
Sets whether the new font are applied and taked effect.
Component
 Inherited
Sets the foreground color of this component.
Component
 Inherited
Sets a decorator to be the component foreground, it will represent the component foreground with a DisplayObject on top of other children of this component.
Component
 Inherited
Set the component's location in global coordinate.
Component
 Inherited
setGlobalLocationXY(x:int, y:int):void
Set the component's location in global coordinate.
Component
 Inherited
setHeight(height:Number):void
Sets the component's height.
Component
  
setHorizontalBlockIncrement(increment:int):void
JTree
  
setHorizontalUnitIncrement(increment:int):void
JTree
  
setInvokesStopCellEditing(newValue:Boolean):void
Determines what happens when editing is interrupted by selecting another node in the tree, a change in the tree's data, or by some other means.
JTree
  
setLayout(layout:LayoutManager):void
You can not set layout to JTree, it's handled by TreeUI.
JTree
  
Sets the path identifies as the lead.
JTree
 Inherited
setLocation(newPos:IntPoint):void
Set the component's location, if it is diffs from old location, invalidate it to wait validate.
Component
 Inherited
setLocationXY(x:int, y:int):void
Component
 Inherited
setMaximumHeight(maximumHeight:int):void
Sets maximum height, -1 means auto count.
Component
 Inherited
setMaximumSize(maximumSize:IntDimension):void
setMaximumSize(d:IntDimension)
setMaximumSize(width:Number, height:Number)

Set the maximumSize, then the component's maximumSize is specified.

Component
 Inherited
setMaximumWidth(maximumWidth:int):void
Sets maximum width, -1 means auto count.
Component
 Inherited
setMinimumHeight(minimumHeight:int):void
Sets minimum height, -1 means auto count.
Component
 Inherited
setMinimumSize(minimumSize:IntDimension):void
setMinimumSize(d:IntDimension)
setMinimumSize(width:Number, height:Number)

Set the minimumSize, then the component's minimumSize is specified.

Component
 Inherited
setMinimumWidth(minimumWidth:int):void
Sets minimum width, -1 means auto count.
Component
  
setModel(newModel:TreeModel):void
Sets the TreeModel that will provide the data.
JTree
 Inherited
setName(name:String):void
Sets the name of this component
Component
 Inherited
setOpaque(b:Boolean):void
If true the component paints every pixel within its bounds.
Component
 Inherited
setOpaqueSet(b:Boolean):void
This method will be called to set true when you set the opaque by setOpaque().
Component
 Inherited
setPreferredHeight(preferredHeight:int):void
Sets preferred width, -1 means auto count.
Component
 Inherited
setPreferredSize(preferredSize:IntDimension):void
setPreferredSize(d:IntDimension)
setPreferredSize(width:Number, height:Number)

Set the preferredSize, then the component's preferredSize is specified.

Component
 Inherited
setPreferredWidth(preferredWidth:int):void
Sets preferred width, -1 means auto count.
Component
  
setRootVisible(rootVisible:Boolean):void
Determines whether or not the root node from the TreeModel is visible.
JTree
  
setRowHeight(rowHeight:int):void
Sets the height of each cell, in pixels.
JTree
  
setRowHeightSet(b:Boolean):void
Sets whether or not row height is set by user.
JTree
  
setScrollsOnExpand(newValue:Boolean):void
Sets the scrollsOnExpand property, which determines whether the tree might scroll to show previously hidden children.
JTree
  
setScrollsOnExpandSet(b:Boolean):void
Sets whether or not scrolls on expand is set by user.
JTree
  
setSelectionBackground(selectionBackground:ASColor):void
Sets the background color for selected cells.
JTree
  
setSelectionForeground(selectionForeground:ASColor):void
Sets the foreground color for selected cells.
JTree
  
setSelectionInterval(index0:int, index1:int, programmatic:Boolean = true):void
Selects the nodes between index0 and index1, inclusive.
JTree
  
setSelectionMode(mode:int):void
Proxy method which passes specified selection mode to the currently configured selection model.
JTree
  
Sets the tree's selection model.
JTree
  
setSelectionPath(path:TreePath, programmatic:Boolean = true):void
Selects the node identified by the specified path.
JTree
  
setSelectionPaths(paths:Array, programmatic:Boolean = true):void
Selects the nodes identified by the specified array of paths.
JTree
  
setSelectionRow(row:int, programmatic:Boolean = true):void
Selects the node at the specified row in the display.
JTree
  
setSelectionRows(rows:Array, programmatic:Boolean = true):void
Selects the nodes corresponding to each of the specified rows in the display.
JTree
 Inherited
setSize(newSize:IntDimension):void
Set the component's size, the width and height all will be setted to not less than zero, then set the size.
Component
 Inherited
setSizeWH(w:int, h:int):void
Component
  
setToggleClickCount(clickCount:int):void
Sets the number of mouse clicks before a node will expand or close.
JTree
 Inherited
setToolTipText(t:String):void
Registers the text to display in a tool tip.
Component
  
setUI(ui:ComponentUI):void
Sets the L&F object that renders this component.
JTree
 Inherited
setUIElement(b:Boolean):void
Sets the component is a ui element or not.
Component
  
setVerticalBlockIncrement(increment:int):void
JTree
  
setVerticalUnitIncrement(increment:int):void
JTree
  
JTree
  
setViewPosition(p:IntPoint, programmatic:Boolean = true):void
JTree
 Inherited
setVisible(v:Boolean):void
Set a component to be hide or shown.
Component
  
setVisibleRowCount(newCount:int):void
Sets the number of rows that are to be displayed.
JTree
 Inherited
setWidth(width:int):void
Sets the component's width.
Component
 Inherited
setX(x:int):void
Sets the x coordinate of the components.
Component
 Inherited
setY(y:int):void
Sets the y coordinate of the components.
Component
  
Selects the node identified by the specified path and initiates editing.
JTree
  
stopEditing():Boolean
Ends the current editing session.
JTree
 Inherited
swapChildren(child1:DisplayObject, child2:DisplayObject):void
AWSprite
 Inherited
swapChildrenAt(index1:int, index2:int):void
AWSprite
 Inherited
toString():String
Component
 Inherited
transferFocus():Boolean
Transfers the focus to the next component, as though this Component were the focus owner.
Component
 Inherited
Transfers the focus to the previous component, as though this Component were the focus owner.
Component
  
Notifies all listeners that have registered interest for notification on this event type.
JTree
  
JTree
  
JTree
  
JTree
  
JTree
  
updateUI():void
Notification from the UIManager that the L&F has changed.
JTree
 Inherited
validate():void
Validates this container and all of its subcomponents.
Container
Protected Methods
 MethodDefined by
 Inherited
Component
 Inherited
call the ui, if ui return null, ehn call layout to count.
Container
 Inherited
call the ui, if ui return null, ehn call layout to count.
Container
 Inherited
call the ui, if ui return null, ehn call layout to count.
Container
 Inherited
d_addChild(child:DisplayObject):DisplayObject
AWSprite
 Inherited
d_addChildAt(child:DisplayObject, index:int):DisplayObject
AWSprite
 Inherited
d_getChildAt(index:int):DisplayObject
AWSprite
 Inherited
d_getChildByName(name:String):DisplayObject
AWSprite
 Inherited
d_getChildIndex(child:DisplayObject):int
AWSprite
 Inherited
d_removeChild(child:DisplayObject):DisplayObject
AWSprite
 Inherited
d_removeChildAt(index:int):DisplayObject
AWSprite
 Inherited
d_setChildIndex(child:DisplayObject, index:int):void
AWSprite
 Inherited
d_swapChildren(child1:DisplayObject, child2:DisplayObject):void
AWSprite
 Inherited
d_swapChildrenAt(index1:int, index2:int):void
AWSprite
  
expandRoot():void
Expands the root path, assuming the current TreeModel has been set.
JTree
  
firePropertyChange(pn:String, oldValue:*, newValue:*):void
JTree
  
fireStateChanged(programmatic:Boolean = true):void
JTree
 Inherited
getBackgroundChild():DisplayObject
Returns the background child.
AWSprite
 Inherited
Container
 Inherited
Container
 Inherited
Override this to return another component that the focus should be transmit to.
Component
 Inherited
getForegroundChild():DisplayObject
Returns the foreground child.
AWSprite
  
Returns an array of integers specifying the indexs of the components in the path.
JTree
  
getPathForIndexs(indexs:Array):TreePath
Returns a TreePath created by obtaining the children for each of the indices in indexs.
JTree
 Inherited
insertImp(i:int, com:Component, constraints:Object = null):void
Container
 Inherited
Makes this component and all parents above it are marked as needing to be laid out.
Component
 Inherited
isChild(child:DisplayObject):Boolean
Returns whether or not the child is this sprite's direct child.
AWSprite
 Inherited
locate():void
Locate the component to the current location.
Component
 Inherited
draw the component interface in specified bounds.
Component
 Inherited
Container
 Inherited
setBackgroundChild(child:DisplayObject = null):void
Sets the child to be the component background, it will be add to the bottom of all other children.
AWSprite
 Inherited
AWSprite
  
setExpandedState(path:TreePath, state:Boolean):void
Sets the expanded state of this JTree.
JTree
 Inherited
setForegroundChild(child:DisplayObject = null):void
Sets the child to be the component foreground, it will be add to the top of all other children.
AWSprite
 Inherited
size():void
Do the process when size changed.
Component
Events
 EventSummaryDefined by
 Inherited Dispatched when the component is clicked continuesly.Component
 Inherited Dispatched when a component is added to a container.Container
 Inherited Dispatched when a component is removed from a container.Container
 Inherited Dispatched when a drag is drop on this component.Component
 Inherited Dispatched when a drag is enter this component area.Component
 Inherited Dispatched when a drag is exit this component area.Component
 Inherited Dispatched when the component is recongnized that it can be drag start.Component
 Inherited Dispatched when the component gained the focus from it is not the focus owner Component
 Inherited Dispatched when the key down and the component is the focus owner.Component
 Inherited Dispatched when the key up and the component is the focus owner.Component
 Inherited Dispatched when the component lost the focus from it was the focus owner.Component
 Inherited Dispatched when the component visible is set to false from true.Component
 Inherited Dispatched when the component is moved.Component
 Inherited Dispatched when the component is painted.Component
   Dispatched when a property changed.JTree
 Inherited Dispatched when the mouse released or released out side.AWSprite
 Inherited Dispatched only when the mouse released out side.AWSprite
 Inherited Dispatched when the component is resized.Component
 Inherited Dispatched when the component visible is set to true from false.Component
   Dispatched when the cell editing canceled.JTree
   Dispatched when the cell editing started.JTree
   Dispatched when the cell editing finished.JTree
   Dispatched when an item in the tree has been collapsed.JTree
   Dispatched when an item in the tree has been expanded.JTree
   Dispatched when tree items selection changed.JTree
   Dispatched whenever a node in the tree is about to be expanded.
You can throw a ExpandVetoException in this event handler to indicate that this action is veto.
JTree
   Dispatched whenever a node in the tree is about to be expanded.
You can throw a ExpandVetoException in this event handler to indicate that this action is veto.
JTree
Public Constants
 ConstantDefined by
  ANCHOR_SELECTION_PATH_PROPERTY : String = "anchorSelectionPath"
[static] Bound property name for anchor selection path.
JTree
  AUTO_INCREMENT : int = -2.147483648E9
[static] The default unit/block increment, it means auto count a value.
JTree
  CELL_EDITOR_PROPERTY : String = "cellEditor"
[static] Bound property name for cellEditor.
JTree
  CELL_FACTORY_PROPERTY : String = "cellFactory"
[static] Bound property name for cellFactory.
JTree
  CONTIGUOUS_TREE_SELECTION : int = 2
[static] Selection can only be contiguous.
JTree
  DISCONTIGUOUS_TREE_SELECTION : int = 4
[static] Selection can contain any number of items that are not necessarily contiguous.
JTree
  EDITABLE_PROPERTY : String = "editable"
[static] Bound property name for editable.
JTree
  EXPANDS_SELECTED_PATHS_PROPERTY : String = "expandsSelectedPaths"
[static] Bound property name for expands selected paths property
JTree
  FONT_PROPERTY : String = "font"
[static] Bound property name for font property
JTree
  INVOKES_STOP_CELL_EDITING_PROPERTY : String = "invokesStopCellEditing"
[static] Bound property name for messagesStopCellEditing.
JTree
  LEAD_SELECTION_PATH_PROPERTY : String = "leadSelectionPath"
[static] Bound property name for leadSelectionPath.
JTree
  ROOT_VISIBLE_PROPERTY : String = "rootVisible"
[static] Bound property name for rootVisible.
JTree
  ROW_HEIGHT_PROPERTY : String = "rowHeight"
[static] Bound property name for showsRootHandles.
JTree
  SCROLLS_ON_EXPAND_PROPERTY : String = "scrollsOnExpand"
[static] Bound property name for scrollsOnExpand.
JTree
  SELECTION_MODEL_PROPERTY : String = "selectionModel"
[static] Bound property name for selectionModel.
JTree
  SINGLE_TREE_SELECTION : int = 1
[static] Selection can only contain one path at a time.
JTree
  TOGGLE_CLICK_COUNT_PROPERTY : String = "toggleClickCount"
[static] Bound property name for toggleClickCount.
JTree
  TREE_MODEL_PROPERTY : String = "model"
[static] Bound property name for treeModel.
JTree
  VISIBLE_ROW_COUNT_PROPERTY : String = "visibleRowCount"
[static] Bound property name for visibleRowCount.
JTree
Constructor detail
JTree()constructor
public function JTree(newModel:TreeModel = null)

JTree(newModel:TreeModel)
; JTree() a defaul model will be created
Returns an instance of JTree which displays the root node -- the tree is created using the specified data model.

Parameters
newModel:TreeModel (default = null) — (optional)the TreeModel to use as the data model. If miss it, a defaul model will be created.

See also

DefaultTreeModel.asksAllowsChildren
Method detail
addSelectionInterval()method
public function addSelectionInterval(index0:int, index1:int, programmatic:Boolean = true):void

Adds the paths between index0 and index1, inclusive, to the selection.

Parameters
index0:int — an integer specifying a display row, where 0 is the first row in the display
 
index1:int — an integer specifying a second display row
 
programmatic:Boolean (default = true) — indicate if this is a programmatic change
addSelectionListener()method 
public function addSelectionListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void

Adds a listener for tree selection events. the listenerthat will be notified when a node is selected or deselected (a "negative selection")

Parameters
listener:Function — the new listener to be added
 
priority:int (default = 0) — the priority
 
useWeakReference:Boolean (default = false) — Determines whether the reference to the listener is strong or weak.
addSelectionPath()method 
public function addSelectionPath(path:TreePath, programmatic:Boolean = true):void

Adds the node identified by the specified TreePath to the current selection. If any component of the path isn't viewable, and getExpandsSelectedPaths is true it is made viewable.

Note that JTree does not allow duplicate nodes to exist as children under the same parent -- each sibling must be a unique object. Parameters

path:TreePath — the TreePath to add
 
programmatic:Boolean (default = true) — indicate if this is a programmatic change
addSelectionPaths()method 
public function addSelectionPaths(paths:Array, programmatic:Boolean = true):void

Adds each path in the array of paths to the current selection. If any component of any of the paths isn't viewable and getExpandsSelectedPaths is true, it is made viewable.

Note that JTree does not allow duplicate nodes to exist as children under the same parent -- each sibling must be a unique object. Parameters

paths:Array — an array of TreePath objects that specifies the nodes to add
 
programmatic:Boolean (default = true) — indicate if this is a programmatic change
addSelectionRow()method 
public function addSelectionRow(row:int, programmatic:Boolean = true):void

Adds the path at the specified row to the current selection.

Parameters
row:int — an integer specifying the row of the node to add, where 0 is the first row in the display
 
programmatic:Boolean (default = true) — indicate if this is a programmatic change
addSelectionRows()method 
public function addSelectionRows(rows:Array, programmatic:Boolean = true):void

Adds the paths at each of the specified rows to the current selection.

Parameters
rows:Array — an array of ints specifying the rows to add, where 0 indicates the first row in the display
 
programmatic:Boolean (default = true) — indicate if this is a programmatic change
addStateListener()method 
public function addStateListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void

Add a listener to listen the viewpoat state change event.

When the viewpoat's state changed, the state is all about:

Parameters
listener:Function — the listener
 
priority:int (default = 0) — the priority
 
useWeakReference:Boolean (default = false) — Determines whether the reference to the listener is strong or weak.

See also

org.aswing.event.InteractiveEvent.STATE_CHANGED
cancelEditing()method 
public function cancelEditing():void

Cancels the current editing session. Has no effect if the tree isn't being edited.

clearSelection()method 
public function clearSelection(programmatic:Boolean = true):void

Clears the selection.

Parameters
programmatic:Boolean (default = true) — indicate if this is a programmatic change
collapsePath()method 
public function collapsePath(path:TreePath):void

Ensures that the node identified by the specified path is collapsed and viewable.

Parameters
path:TreePath — the TreePath identifying a node
collapseRow()method 
public function collapseRow(row:int):void

Ensures that the node in the specified row is collapsed.

If row is < 0 or >= getRowCount this will have no effect. Parameters

row:int — an integer specifying a display row, where 0 is the first row in the display
editingCanceled()method 
public function editingCanceled(source:CellEditor):voidParameters
source:CellEditor
editingStopped()method 
public function editingStopped(source:CellEditor):voidParameters
source:CellEditor
expandPath()method 
public function expandPath(path:TreePath):void

Ensures that the node identified by the specified path is expanded and viewable. If the last item in the path is a leaf, this will have no effect.

Parameters
path:TreePath — the TreePath identifying a node
expandRoot()method 
protected function expandRoot():void

Expands the root path, assuming the current TreeModel has been set.

expandRow()method 
public function expandRow(row:int):void

Ensures that the node in the specified row is expanded and viewable.

If row is < 0 or >= getRowCount this will have no effect. Parameters

row:int — an integer specifying a display row, where 0 is the first row in the display
firePropertyChange()method 
protected function firePropertyChange(pn:String, oldValue:*, newValue:*):voidParameters
pn:String
 
oldValue:*
 
newValue:*
fireStateChanged()method 
protected function fireStateChanged(programmatic:Boolean = true):voidParameters
programmatic:Boolean (default = true)
fireTreeCollapsed()method 
public function fireTreeCollapsed(path:TreePath):void

Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the path parameter.

Parameters
path:TreePath — the TreePath indicating the node that was collapsed

See also

EventListenerList
fireTreeExpanded()method 
public function fireTreeExpanded(path:TreePath):void

Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the path parameter.

Parameters
path:TreePath — the TreePath indicating the node that was expanded

See also

EventListenerList
fireTreeWillCollapse()method 
public function fireTreeWillCollapse(path:TreePath):void

Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the path parameter.

Parameters
path:TreePath — the TreePath indicating the node that was expanded

See also

EventListenerList
fireTreeWillExpand()method 
public function fireTreeWillExpand(path:TreePath):void

Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the path parameter.

Parameters
path:TreePath — the TreePath indicating the node that was expanded

See also

EventListenerList
getAnchorSelectionPath()method 
public function getAnchorSelectionPath():TreePath

Returns the path identified as the anchor.

Returns
TreePath — path identified as the anchor
getCellEditor()method 
public function getCellEditor():TreeCellEditor

Returns the editor used to edit entries in the tree.

Returns
TreeCellEditor — the TreeCellEditor in use, or null if the tree cannot be edited
getCellFactory()method 
public function getCellFactory():TreeCellFactory

Returns the current TreeCellFactory that is rendering each cell.

Returns
TreeCellFactory — the TreeCellFactory that is rendering each cell
getClosestPathForLocation()method 
public function getClosestPathForLocation(x:int, y:int):TreePath

Returns the path to the node that is closest to x,y. If no nodes are currently viewable, or there is no model, returns null, otherwise it always returns a valid path. To test if the node is exactly at x, y, get the node's bounds and test x, y against that.

Parameters
x:int — an integer giving the number of pixels horizontally from the left edge of the display area, minus any left margin
 
y:int — an integer giving the number of pixels vertically from the top of the display area, minus any top margin

Returns
TreePath — the TreePath for the node closest to that location, null if nothing is viewable or there is no model

See also

getClosestRowForLocation()method 
public function getClosestRowForLocation(x:int, y:int):int

Returns the row to the node that is closest to x,y. If no nodes are viewable or there is no model, returns -1. Otherwise, it always returns a valid row. To test if the returned object is exactly at x, y, get the bounds for the node at the returned row and test x, y against that.

Parameters
x:int — an integer giving the number of pixels horizontally from the left edge of the display area, minus any left margin
 
y:int — an integer giving the number of pixels vertically from the top of the display area, minus any top margin

Returns
int — the row closest to the location, -1 if nothing is viewable or there is no model

See also

getDefaultBasicUIClass()method 
public override function getDefaultBasicUIClass():Class

Returns
Class
getEditingPath()method 
public function getEditingPath():TreePath

Returns the path to the element that is currently being edited.

Returns
TreePath — the TreePath for the node being edited
getExpandedDescendants()method 
public function getExpandedDescendants(parent:TreePath):Array

Returns an Array of the descendants of the path parent that are currently expanded. If parent is not currently expanded, this will return null. If you expand/collapse nodes while iterating over the returned Array this may not return all the expanded paths, or may return paths that are no longer expanded.

Parameters
parent:TreePath — the path which is to be examined

Returns
Array — an Array of the descendents of parent, or null if parent is not currently expanded
getExtentSize()method 
public function getExtentSize():IntDimension

Returns
IntDimension
getFixedCellWidth()method 
public function getFixedCellWidth():int

Returns the fixed cell width value -- the value specified by setting the fixedCellWidth property, rather than that calculated from the cell elements.

Returns
int — the fixed cell width

See also

getHorizontalBlockIncrement()method 
public function getHorizontalBlockIncrement():int

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

Returns
int
getLastSelectedPathComponent()method 
public function getLastSelectedPathComponent():Object

Returns the last path component in the first node of the current selection.

Returns
Object — the last Object in the first selected node's TreePath, or null if nothing is selected

See also

TreePath.getLastPathComponent
getLeadSelectionPath()method 
public function getLeadSelectionPath():TreePath

Returns the path identified as the lead.

Returns
TreePath — path identified as the lead
getLeadSelectionRow()method 
public function getLeadSelectionRow():int

Returns the row index corresponding to the lead path.

Returns
int — an integer giving the row index of the lead path, where 0 is the first row in the display; or -1 if leadPath is null
getLogicLocationFromPixelLocation()method 
public function getLogicLocationFromPixelLocation(p:IntPoint):IntPoint

Returns the location in the JTree view area of the logic location.

Parameters
p:IntPoint

Returns
IntPoint
getMaxSelectionRow()method 
public function getMaxSelectionRow():int

Returns the last selected row.

Returns
int — an integer designating the last selected row, where 0 is the first row in the display
getMinSelectionRow()method 
public function getMinSelectionRow():int

Gets the first selected row.

Returns
int — an integer designating the first selected row, where 0 is the first row in the display
getModel()method 
public function getModel():TreeModel

Returns the TreeModel that is providing the data.

Returns
TreeModel — the TreeModel that is providing the data
getModelIndexsForPath()method 
protected function getModelIndexsForPath(path:TreePath):Array

Returns an array of integers specifying the indexs of the components in the path. If path is the root, this will return an empty array. If path is null, null will be returned.

Parameters
path:TreePath

Returns
Array
getMousePointedPath()method 
public function getMousePointedPath():TreePath

Returns the treePath that the user mouse pointed, null if no path was pointed.

Returns
TreePath — the path mouse pointed, null if not pointed any one.
getPathBounds()method 
public function getPathBounds(path:TreePath):IntRectangle

Returns the IntRectangle that the specified node will be drawn into. Returns null if any component in the path is hidden (under a collapsed parent).

Note:
This method returns a valid rectangle, even if the specified node is not currently displayed. Parameters

path:TreePath — the TreePath identifying the node

Returns
IntRectangle — the IntRectangle the node is drawn in, or null
getPathForIndexs()method 
protected function getPathForIndexs(indexs:Array):TreePath

Returns a TreePath created by obtaining the children for each of the indices in indexs. If indexs or the TreeModel is null, it will return null.

Parameters
indexs:Array

Returns
TreePath
getPathForLocation()method 
public function getPathForLocation(x:int, y:int):TreePath

Returns the path for the node at the specified location.

Parameters
x:int — an integer giving the number of pixels horizontally from the left edge of the display area, minus any left margin
 
y:int — an integer giving the number of pixels vertically from the top of the display area, minus any top margin

Returns
TreePath — the TreePath for the node at that location
getPathForRow()method 
public function getPathForRow(row:int):TreePath

Returns the path for the specified row. If row is not visible, null is returned.

Parameters
row:int — an integer specifying a row

Returns
TreePath — the TreePath to the specified node, null if row < 0 or row > getRowCount()
getPixelLocationFromLogicLocation()method 
public function getPixelLocationFromLogicLocation(p:IntPoint):IntPoint

Returns the location in the JTree view area of the logic location.

Parameters
p:IntPoint

Returns
IntPoint
getRowBounds()method 
public function getRowBounds(row:int):IntRectangle

Returns the IntRectangle that the node at the specified row is drawn in.

Parameters
row:int — the row to be drawn, where 0 is the first row in the display

Returns
IntRectangle — the IntRectangle the node is drawn in
getRowCount()method 
public function getRowCount():int

Returns the number of rows that are currently being displayed.

Returns
int — the number of rows that are being displayed
getRowForLocation()method 
public function getRowForLocation(x:int, y:int):int

Returns the row for the specified location.

Parameters
x:int — an integer giving the number of pixels horizontally from the left edge of the display area, minus any left margin
 
y:int — an integer giving the number of pixels vertically from the top of the display area, minus any top margin

Returns
int — the row corresponding to the location, or -1 if the location is not within the bounds of a displayed cell

See also

getRowForPath()method 
public function getRowForPath(path:TreePath):int

Returns the row that displays the node identified by the specified path.

Parameters
path:TreePath — the TreePath identifying a node

Returns
int — an integer specifying the display row, where 0 is the first row in the display, or -1 if any of the elements in path are hidden under a collapsed parent.
getRowHeight()method 
public function getRowHeight():int

Returns the height of each row. Default is 16.

Returns
int
getSelectionBackground()method 
public function getSelectionBackground():ASColor

Returns the background color for selected cells.

Returns
ASColor — the Color used for the background of selected list items

See also

getSelectionCount()method 
public function getSelectionCount():int

Returns the number of nodes selected.

Returns
int — the number of nodes selected
getSelectionForeground()method 
public function getSelectionForeground():ASColor

Returns the foreground color for selected cells.

Returns
ASColor — the Color object for the foreground property

See also

getSelectionModel()method 
public function getSelectionModel():TreeSelectionModel

Returns the model for selections. This should always return a non-null value. If you don't want to allow anything to be selected set the selection model to null, which forces an empty selection model to be used.

Returns
TreeSelectionModel

See also

getSelectionPath()method 
public function getSelectionPath():TreePath

Returns the path to the first selected node.

Returns
TreePath — the TreePath for the first selected node, or null if nothing is currently selected
getSelectionPaths()method 
public function getSelectionPaths():Array

Returns the paths of all selected values.

Returns
Array — an array of TreePath objects indicating the selected nodes, or null if nothing is currently selected
getSelectionRow()method 
public function getSelectionRow():int

Returns the first selected row. If nothing is selected -1 will be returned.

Returns
int — the first selected row. If nothing is selected -1 will be returned.
getSelectionRows()method 
public function getSelectionRows():Array

Returns all of the currently selected rows. This method is simply forwarded to the TreeSelectionModel. If nothing is selected null or an empty array will be returned, based on the TreeSelectionModel implementation.

Returns
Array — an array of integers that identifies all currently selected rows where 0 is the first row in the display
getToggleClickCount()method 
public function getToggleClickCount():int

Returns the number of mouse clicks needed to expand or close a node.

Returns
int — number of mouse clicks before node is expanded
getTreeUI()method 
public function getTreeUI():TreeUI

Returns the L&F object that renders this component.

Returns
TreeUI — the TreeUI object that renders this component
getUIClassID()method 
public override function getUIClassID():String

Returns the name of the L&F class that renders this component.

Returns
String — the string "TreeUI"

See also

getVerticalBlockIncrement()method 
public function getVerticalBlockIncrement():int

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

Returns
int
getViewportPane()method 
public function getViewportPane():Component

Returns
Component
getViewPosition()method 
public function getViewPosition():IntPoint

Returns
IntPoint
getViewSize()method 
public function getViewSize():IntDimension

Returns
IntDimension
getVisibleRect()method 
public function getVisibleRect():IntRectangle

Returns
IntRectangle
getVisibleRowCount()method 
public function getVisibleRowCount():int

Returns the number of rows that are displayed in the display area.

Returns
int — the number of rows displayed
hasBeenExpanded()method 
public function hasBeenExpanded(path:TreePath):Boolean

Returns true if the node identified by the path has ever been expanded.

Parameters
path:TreePath

Returns
Boolean — true if the path has ever been expanded
isCollapsed()method 
public function isCollapsed(path:TreePath):Boolean

Returns true if the value identified by path is currently collapsed, this will return false if any of the values in path are currently not being displayed.

Parameters
path:TreePath — the TreePath to check

Returns
Boolean — true if any of the nodes in the node's path are collapsed, false if all nodes in the path are expanded
isCollapsedOfRow()method 
public function isCollapsedOfRow(row:int):Boolean

Returns true if the node at the specified display row is collapsed.

Parameters
row:int — the row to check, where 0 is the first row in the display

Returns
Boolean — true if the node is currently collapsed, otherwise false
isEditable()method 
public function isEditable():Boolean

Returns true if the tree is editable.

Returns
Boolean — true if the tree is editable
isEditing()method 
public function isEditing():Boolean

Returns true if the tree is being edited. The item that is being edited can be obtained using getSelectionPath.

Returns
Boolean — true if the user is currently editing a node

See also

isExpanded()method 
public function isExpanded(path:TreePath):Boolean

Returns true if the node identified by the path is currently expanded,

Parameters
path:TreePath — the TreePath specifying the node to check

Returns
Boolean — false if any of the nodes in the node's path are collapsed, true if all nodes in the path are expanded
isExpandedOfRow()method 
public function isExpandedOfRow(row:int):Boolean

Returns true if the node at the specified display row is currently expanded.

Parameters
row:int — the row to check, where 0 is the first row in the display

Returns
Boolean — true if the node is currently expanded, otherwise false
isExpandsSelectedPaths()method 
public function isExpandsSelectedPaths():Boolean

Returns the expandsSelectedPaths property.

Returns
Boolean — true if selection changes result in the parent path being expanded

See also

isInvokesStopCellEditing()method 
public function isInvokesStopCellEditing():Boolean

Returns the indicator that tells what happens when editing is interrupted.

Returns
Boolean — the indicator that tells what happens when editing is interrupted

See also

isPathEditable()method 
public function isPathEditable(path:TreePath):Boolean

Returns isEditable. This is invoked from the UI before editing begins to insure that the given path can be edited. This is provided as an entry point for subclassers to add filtered editing without having to resort to creating a new editor.

Parameters
path:TreePath

Returns
Boolean — true if every parent node and the node itself is editable

See also

isPathSelected()method 
public function isPathSelected(path:TreePath):Boolean

Returns true if the item identified by the path is currently selected.

Parameters
path:TreePath — a TreePath identifying a node

Returns
Boolean — true if the node is selected
isPathVisible()method 
public function isPathVisible(path:TreePath):Boolean

Returns true if the value identified by path is currently viewable, which means it is either the root or all of its parents are expanded. Otherwise, this method returns false.

Parameters
path:TreePath

Returns
Boolean — true if the node is viewable, otherwise false
isRootVisible()method 
public function isRootVisible():Boolean

Returns true if the root node of the tree is displayed.

Returns
Boolean — true if the root node of the tree is displayed
isRowHeightSet()method 
public function isRowHeightSet():Boolean

Returns whether or not row height is set by user. If it is set by user, the LAF will not change the row height value.

Returns
Boolean — set or not
isRowSelected()method 
public function isRowSelected(row:int):Boolean

Returns true if the node identified by row is selected.

Parameters
row:int — an integer specifying a display row, where 0 is the first row in the display

Returns
Boolean — true if the node is selected
isScrollsOnExpand()method 
public function isScrollsOnExpand():Boolean

Returns the value of the scrollsOnExpand property.

Returns
Boolean — the value of the scrollsOnExpand property
isScrollsOnExpandSet()method 
public function isScrollsOnExpandSet():Boolean

Returns whether or not scrolls on expand is set by user. If it is set by user, the LAF will not change the scrolls on expand value.

Returns
Boolean — set or not
isSelectionEmpty()method 
public function isSelectionEmpty():Boolean

Returns true if the selection is currently empty.

Returns
Boolean — true if the selection is currently empty
makePathVisible()method 
public function makePathVisible(path:TreePath):void

Ensures that the node identified by path is currently viewable.

Parameters
path:TreePath — the TreePath to make visible
removeDescendantSelectedPathsWithEvent()method 
public function removeDescendantSelectedPathsWithEvent(e:TreeModelEvent):void

Removes any paths from the selection model that are descendants of the nodes identified by in e.

Parameters
e:TreeModelEvent
removeSelectionInterval()method 
public function removeSelectionInterval(index0:int, index1:int, programmatic:Boolean = true):void

Removes the nodes between index0 and index1, inclusive, from the selection.

Parameters
index0:int — an integer specifying a display row, where 0 is the first row in the display
 
index1:int — an integer specifying a second display row
 
programmatic:Boolean (default = true) — indicate if this is a programmatic change
removeSelectionListener()method 
public function removeSelectionListener(listener:Function):voidParameters
listener:Function
removeSelectionPath()method 
public function removeSelectionPath(path:TreePath, programmatic:Boolean = true):void

Removes the node identified by the specified path from the current selection.

Parameters
path:TreePath — the TreePath identifying a node
 
programmatic:Boolean (default = true) — indicate if this is a programmatic change
removeSelectionPaths()method 
public function removeSelectionPaths(paths:Array, programmatic:Boolean = true):void

Removes the nodes identified by the specified paths from the current selection.

Parameters
paths:Array — an array of TreePath objects that specifies the nodes to remove
 
programmatic:Boolean (default = true) — indicate if this is a programmatic change
removeSelectionRow()method 
public function removeSelectionRow(row:int, programmatic:Boolean = true):void

Removes the row at the index row from the current selection.

Parameters
row:int — the row to remove
 
programmatic:Boolean (default = true) — indicate if this is a programmatic change
removeSelectionRows()method 
public function removeSelectionRows(rows:Array, programmatic:Boolean = true):void

Removes the rows that are selected at each of the specified rows.

Parameters
rows:Array — an array of ints specifying display rows, where 0 is the first row in the display
 
programmatic:Boolean (default = true) — indicate if this is a programmatic change
removeStateListener()method 
public function removeStateListener(listener:Function):void

Removes a state listener.

Parameters
listener:Function — the listener to be removed.

See also

org.aswing.event.AWEvent.STATE_CHANGED
scrollPathToVisible()method 
public function scrollPathToVisible(path:TreePath):void

Makes sure all the path components in path are expanded (except for the last path component) and scrolls so that the node identified by the path is displayed. Only works when this JTree is contained in a JScrollPane.

Parameters
path:TreePath — the TreePath identifying the node to bring into view
scrollRectToVisible()method 
public function scrollRectToVisible(contentRect:IntRectangle, programmatic:Boolean = true):voidParameters
contentRect:IntRectangle
 
programmatic:Boolean (default = true)
scrollRowToVisible()method 
public function scrollRowToVisible(row:int):void

Scrolls the item identified by row until it is displayed. The minimum of amount of scrolling necessary to bring the row into view is performed. Only works when this JTree is contained in a JScrollPane.

Parameters
row:int — an integer specifying the row to scroll, where 0 is the first row in the display
setAnchorSelectionPath()method 
public function setAnchorSelectionPath(newPath:TreePath):void

Sets the path identified as the anchor. The anchor is not maintained by JTree, rather the UI will update it.

Parameters
newPath:TreePath — the new anchor path
setCellEditor()method 
public function setCellEditor(cellEditor:TreeCellEditor):void

Sets the cell editor. A null value implies that the tree cannot be edited. If this represents a change in the cellEditor, the propertyChange method is invoked on all listeners.

Parameters
cellEditor:TreeCellEditor — the TreeCellEditor to use
setCellFactory()method 
public function setCellFactory(x:TreeCellFactory):void

Sets the TreeCellFactory that will be used to draw each cell.

Parameters
x:TreeCellFactory — the TreeCellFactory that is to render each cell
setEditable()method 
public function setEditable(flag:Boolean):void

Determines whether the tree is editable. Fires a property change event if the new setting is different from the existing setting.

Parameters
flag:Boolean — a boolean value, true if the tree is editable
setExpandedState()method 
protected function setExpandedState(path:TreePath, state:Boolean):void

Sets the expanded state of this JTree. If state is true, all parents of path and path are marked as expanded. If state is false, all parents of path are marked EXPANDED, but path itself is marked collapsed.

This will fail if a TreeWillExpandListener vetos it. Parameters

path:TreePath
 
state:Boolean
setExpandsSelectedPaths()method 
public function setExpandsSelectedPaths(newValue:Boolean):void

Configures the expandsSelectedPaths property. If true, any time the selection is changed, either via the TreeSelectionModel, or the cover methods provided by JTree, the TreePaths parents will be expanded to make them visible (visible meaning the parent path is expanded, not necessarily in the visible rectangle of the JTree). If false, when the selection changes the nodes parent is not made visible (all its parents expanded). This is useful if you wish to have your selection model maintain paths that are not always visible (all parents expanded).

Parameters
newValue:Boolean — the new value for expandsSelectedPaths the parent of the path visible.
setFixedCellWidth()method 
public function setFixedCellWidth(width:int):void

Sets the width of every cell in the list. If width is -1, cell widths are computed by applying getPreferredSize to the TreeCell component for each list element.

The default value of this property is -1.
If your tree model is very large or all of your tree item has same width, i recommend you set a fixed cell with it will speed up the performance.

Parameters

width:int — the width, in pixels, for all cells in this list

See also

setFont()method 
public override function setFont(f:ASFont):voidParameters
f:ASFont
setHorizontalBlockIncrement()method 
public function setHorizontalBlockIncrement(increment:int):voidParameters
increment:int
setHorizontalUnitIncrement()method 
public function setHorizontalUnitIncrement(increment:int):voidParameters
increment:int
setInvokesStopCellEditing()method 
public function setInvokesStopCellEditing(newValue:Boolean):void

Determines what happens when editing is interrupted by selecting another node in the tree, a change in the tree's data, or by some other means. Setting this property to true causes the changes to be automatically saved when editing is interrupted.

Fires a property change for the INVOKES_STOP_CELL_EDITING_PROPERTY. Parameters

newValue:Boolean — true means that stopCellEditing is invoked when editing is interrupted, and data is saved; false means that cancelCellEditing is invoked, and changes are lost
setLayout()method 
public override function setLayout(layout:LayoutManager):void

You can not set layout to JTree, it's handled by TreeUI.

Parameters
layout:LayoutManager

Throws
— when set any layout.
setLeadSelectionPath()method 
public function setLeadSelectionPath(newPath:TreePath):void

Sets the path identifies as the lead. The lead may not be selected. The lead is not maintained by JTree, rather the UI will update it.

Parameters
newPath:TreePath — the new lead path
setModel()method 
public function setModel(newModel:TreeModel):void

Sets the TreeModel that will provide the data.

Parameters
newModel:TreeModel — the TreeModel that is to provide the data
setRootVisible()method 
public function setRootVisible(rootVisible:Boolean):void

Determines whether or not the root node from the TreeModel is visible.

Parameters
rootVisible:Boolean — true if the root node of the tree is to be displayed
setRowHeight()method 
public function setRowHeight(rowHeight:int):void

Sets the height of each cell, in pixels. If the specified value is less than or equal to zero nothing will changed.(the current cell height will not change.)

Parameters
rowHeight:int — the height of each cell, in pixels
setRowHeightSet()method 
public function setRowHeightSet(b:Boolean):void

Sets whether or not row height is set by user. If it is set by user, the LAF will not change the row height value.

Parameters
b:Boolean — set or not
setScrollsOnExpand()method 
public function setScrollsOnExpand(newValue:Boolean):void

Sets the scrollsOnExpand property, which determines whether the tree might scroll to show previously hidden children. If this property is true (the default), when a node expands the tree can use scrolling to make the maximum possible number of the node's descendants visible. In some look and feels, trees might not need to scroll when expanded; those look and feels will ignore this property.

Parameters
newValue:Booleanfalse to disable scrolling on expansion; true to enable it

See also

setScrollsOnExpandSet()method 
public function setScrollsOnExpandSet(b:Boolean):void

Sets whether or not scrolls on expand is set by user. If it is set by user, the LAF will not change the scrolls on expand value.

Parameters
b:Boolean — set or not
setSelectionBackground()method 
public function setSelectionBackground(selectionBackground:ASColor):void

Sets the background color for selected cells. Cell renderers can use this color to the fill selected cells.

The default value of this property is defined by the look and feel implementation. Parameters

selectionBackground:ASColor — the Color to use for the background of selected cells

See also

setSelectionForeground()method 
public function setSelectionForeground(selectionForeground:ASColor):void

Sets the foreground color for selected cells. Cell renderers can use this color to render text and graphics for selected cells.

The default value of this property is defined by the look and feel implementation. Parameters

selectionForeground:ASColor — the Color to use in the foreground for selected list items

See also

setSelectionInterval()method 
public function setSelectionInterval(index0:int, index1:int, programmatic:Boolean = true):void

Selects the nodes between index0 and index1, inclusive.

Parameters
index0:int — an integer specifying a display row, where 0 is the first row in the display
 
index1:int — an integer specifying a second display row
 
programmatic:Boolean (default = true) — indicate if this is a programmatic change
setSelectionMode()method 
public function setSelectionMode(mode:int):void

Proxy method which passes specified selection mode to the currently configured selection model.

Parameters
mode:int — the selection mode identifier
setSelectionModel()method 
public function setSelectionModel(selectionModel:TreeSelectionModel):void

Sets the tree's selection model. When a null value is specified an emtpy selectionModel is used, which does not allow selections.

Parameters
selectionModel:TreeSelectionModel — the TreeSelectionModel to use, or null to disable selections

See also

TreeSelectionModel
setSelectionPath()method 
public function setSelectionPath(path:TreePath, programmatic:Boolean = true):void

Selects the node identified by the specified path. If any component of the path is hidden (under a collapsed node), and getExpandsSelectedPaths is true it is exposed (made viewable).

Parameters
path:TreePath — the TreePath specifying the node to select
 
programmatic:Boolean (default = true) — indicate if this is a programmatic change
setSelectionPaths()method 
public function setSelectionPaths(paths:Array, programmatic:Boolean = true):void

Selects the nodes identified by the specified array of paths. If any component in any of the paths is hidden (under a collapsed node), and getExpandsSelectedPaths is true it is exposed (made viewable).

Parameters
paths:Array — an array of TreePath objects that specifies the nodes to select
 
programmatic:Boolean (default = true) — indicate if this is a programmatic change
setSelectionRow()method 
public function setSelectionRow(row:int, programmatic:Boolean = true):void

Selects the node at the specified row in the display.

Parameters
row:int — the row to select, where 0 is the first row in the display
 
programmatic:Boolean (default = true) — indicate if this is a programmatic change
setSelectionRows()method 
public function setSelectionRows(rows:Array, programmatic:Boolean = true):void

Selects the nodes corresponding to each of the specified rows in the display. If a particular element of rows is < 0 or >= getRowCount, it will be ignored. If none of the elements in rows are valid rows, the selection will be cleared. That is it will be as if clearSelection was invoked.

Parameters
rows:Array — an array of ints specifying the rows to select, where 0 indicates the first row in the display
 
programmatic:Boolean (default = true) — indicate if this is a programmatic change
setToggleClickCount()method 
public function setToggleClickCount(clickCount:int):void

Sets the number of mouse clicks before a node will expand or close. The default is 3.

Parameters
clickCount:int
setUI()method 
public override function setUI(ui:ComponentUI):void

Sets the L&F object that renders this component.

Parameters
ui:ComponentUI — the TreeUI L&F object

See also

setVerticalBlockIncrement()method 
public function setVerticalBlockIncrement(increment:int):voidParameters
increment:int
setVerticalUnitIncrement()method 
public function setVerticalUnitIncrement(increment:int):voidParameters
increment:int
setViewportTestSize()method 
public function setViewportTestSize(s:IntDimension):voidParameters
s:IntDimension
setViewPosition()method 
public function setViewPosition(p:IntPoint, programmatic:Boolean = true):voidParameters
p:IntPoint
 
programmatic:Boolean (default = true)
setVisibleRowCount()method 
public function setVisibleRowCount(newCount:int):void

Sets the number of rows that are to be displayed. This will only work if the tree is contained in a JScrollPane, and will adjust the preferred size and size of that scrollpane.

Parameters
newCount:int — the number of rows to display
startEditingAtPath()method 
public function startEditingAtPath(path:TreePath):void

Selects the node identified by the specified path and initiates editing. The edit-attempt fails if the CellEditor does not allow editing for the specified item.

Parameters
path:TreePath — the TreePath identifying a node
stopEditing()method 
public function stopEditing():Boolean

Ends the current editing session. (The DefaultTreeCellEditor object saves any edits that are currently in progress on a cell. Other implementations may operate differently.) Has no effect if the tree isn't being edited.

Note:
To make edit-saves automatic whenever the user changes their position in the tree, use {

Returns
Boolean — true if editing was in progress and is now stopped, false if editing was not in progress
treeDidChange()method 
public function treeDidChange():void

Notifies all listeners that have registered interest for notification on this event type.

See also

EventListenerList
treeNodesChanged()method 
public function treeNodesChanged(e:TreeModelEvent):voidParameters
e:TreeModelEvent
treeNodesInserted()method 
public function treeNodesInserted(e:TreeModelEvent):voidParameters
e:TreeModelEvent
treeNodesRemoved()method 
public function treeNodesRemoved(e:TreeModelEvent):voidParameters
e:TreeModelEvent
treeStructureChanged()method 
public function treeStructureChanged(e:TreeModelEvent):voidParameters
e:TreeModelEvent
updateUI()method 
public override function updateUI():void

Notification from the UIManager that the L&F has changed. Replaces the current UI object with the latest version from the UIManager.

See also

JComponent.updateUI
Event detail
propertyChangeevent 
Event object type: org.aswing.event.PropertyChangeEvent
PropertyChangeEvent.type property = org.aswing.event.PropertyChangeEvent.PROPERTY_CHANGE

Dispatched when a property changed.

The PropertyChangeEvent.PROPERTY_CHANGE constant defines the value of the type property of the event object for a propertyChange event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
getPropertyName()value changed property name
getOldValue()old value
getNewValue()new value
currentTargetThe Object that defines the event listener that handles the event. For example, if you use comp.addEventListener() to register an event listener, comp is the value of the currentTarget.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
treeCellEditingCanceledevent  
Event object type: org.aswing.event.TreeCellEditEvent
TreeCellEditEvent.type property = org.aswing.event.TreeCellEditEvent.EDITING_CANCELED

Dispatched when the cell editing canceled.

The TreeCellEditEvent.EDITING_CANCELED constant defines the value of the type property of the event object for a treeCellEditingCanceled event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
getPath()the path be edit
currentTargetThe Object that defines the event listener that handles the event. For example, if you use comp.addEventListener() to register an event listener, comp is the value of the currentTarget.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
treeCellEditingStartedevent  
Event object type: org.aswing.event.TreeCellEditEvent
TreeCellEditEvent.type property = org.aswing.event.TreeCellEditEvent.EDITING_STARTED

Dispatched when the cell editing started.

The TreeCellEditEvent.EDITING_STARTED constant defines the value of the type property of the event object for a treeCellEditingStarted event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
getPath()the path be edit
getOldValue()the old value
currentTargetThe Object that defines the event listener that handles the event. For example, if you use comp.addEventListener() to register an event listener, comp is the value of the currentTarget.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
treeCellEditingStoppedevent  
Event object type: org.aswing.event.TreeCellEditEvent
TreeCellEditEvent.type property = org.aswing.event.TreeCellEditEvent.EDITING_STOPPED

Dispatched when the cell editing finished.

The TreeCellEditEvent.EDITING_STOPPED constant defines the value of the type property of the event object for a treeCellEditingStopped event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
getPath()the path be edit
getOldValue()the old value
getNewValue()the new value edited
currentTargetThe Object that defines the event listener that handles the event. For example, if you use comp.addEventListener() to register an event listener, comp is the value of the currentTarget.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
treeCollapsedevent  
Event object type: org.aswing.event.TreeEvent
TreeEvent.type property = org.aswing.event.TreeEvent.TREE_COLLAPSED

Dispatched when an item in the tree has been collapsed.

The TreeEvent.TREE_COLLAPSED constant defines the value of the type property of the event object for a treeCollapsed event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
getPath()the tree path
currentTargetThe Object that defines the event listener that handles the event. For example, if you use comp.addEventListener() to register an event listener, comp is the value of the currentTarget.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
treeExpandedevent  
Event object type: org.aswing.event.TreeEvent
TreeEvent.type property = org.aswing.event.TreeEvent.TREE_EXPANDED

Dispatched when an item in the tree has been expanded.

The TreeEvent.TREE_EXPANDED constant defines the value of the type property of the event object for a treeExpanded event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
getPath()the tree path
currentTargetThe Object that defines the event listener that handles the event. For example, if you use comp.addEventListener() to register an event listener, comp is the value of the currentTarget.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
treeSelectionChangedevent  
Event object type: org.aswing.event.TreeSelectionEvent
TreeSelectionEvent.type property = org.aswing.event.TreeSelectionEvent.TREE_SELECTION_CHANGED

Dispatched when tree items selection changed.

The TreeSelectionEvent.TREE_SELECTION_CHANGED constant defines the value of the type property of the event object for a treeSelectionChanged event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
isProgrammatic()True means this event is fired by the programmatic reason, false means user mouse/keyboard interaction reason.
getPaths()changed paths.
getPath()first path.
isAddedPath()is the first path element has been added to the selection.
isAddedPathOfPath()is path is added.
isAddedPathOfIndex()is path specified by index is added.
getOldLeadSelectionPath()previously the lead path.
getNewLeadSelectionPath()current lead path.
cloneWithSource()clone with source.
currentTargetThe Object that defines the event listener that handles the event. For example, if you use comp.addEventListener() to register an event listener, comp is the value of the currentTarget.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
treeWillCollapseevent  
Event object type: org.aswing.event.TreeEvent
TreeEvent.type property = org.aswing.event.TreeEvent.TREE_WILL_COLLAPSE

Dispatched whenever a node in the tree is about to be expanded.
You can throw a ExpandVetoException in this event handler to indicate that this action is veto.

The TreeEvent.TREE_WILL_COLLAPSE constant defines the value of the type property of the event object for a treeWillCollapse event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
getPath()the tree path
currentTargetThe Object that defines the event listener that handles the event. For example, if you use comp.addEventListener() to register an event listener, comp is the value of the currentTarget.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
treeWillExpandevent  
Event object type: org.aswing.event.TreeEvent
TreeEvent.type property = org.aswing.event.TreeEvent.TREE_WILL_EXPAND

Dispatched whenever a node in the tree is about to be expanded.
You can throw a ExpandVetoException in this event handler to indicate that this action is veto.

The TreeEvent.TREE_WILL_EXPAND constant defines the value of the type property of the event object for a treeWillExpand event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
getPath()the tree path
currentTargetThe Object that defines the event listener that handles the event. For example, if you use comp.addEventListener() to register an event listener, comp is the value of the currentTarget.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
Constant detail
ANCHOR_SELECTION_PATH_PROPERTYconstant
public static const ANCHOR_SELECTION_PATH_PROPERTY:String = "anchorSelectionPath"

Bound property name for anchor selection path.

AUTO_INCREMENTconstant 
public static const AUTO_INCREMENT:int = -2.147483648E9

The default unit/block increment, it means auto count a value.

CELL_EDITOR_PROPERTYconstant 
public static const CELL_EDITOR_PROPERTY:String = "cellEditor"

Bound property name for cellEditor.

CELL_FACTORY_PROPERTYconstant 
public static const CELL_FACTORY_PROPERTY:String = "cellFactory"

Bound property name for cellFactory.

CONTIGUOUS_TREE_SELECTIONconstant 
public static const CONTIGUOUS_TREE_SELECTION:int = 2

Selection can only be contiguous. This will only be enforced if a RowMapper instance is provided. That is, if no RowMapper is set this behaves the same as DISCONTIGUOUS_TREE_SELECTION.

DISCONTIGUOUS_TREE_SELECTIONconstant 
public static const DISCONTIGUOUS_TREE_SELECTION:int = 4

Selection can contain any number of items that are not necessarily contiguous.

EDITABLE_PROPERTYconstant 
public static const EDITABLE_PROPERTY:String = "editable"

Bound property name for editable.

EXPANDS_SELECTED_PATHS_PROPERTYconstant 
public static const EXPANDS_SELECTED_PATHS_PROPERTY:String = "expandsSelectedPaths"

Bound property name for expands selected paths property

FONT_PROPERTYconstant 
public static const FONT_PROPERTY:String = "font"

Bound property name for font property

INVOKES_STOP_CELL_EDITING_PROPERTYconstant 
public static const INVOKES_STOP_CELL_EDITING_PROPERTY:String = "invokesStopCellEditing"

Bound property name for messagesStopCellEditing.

LEAD_SELECTION_PATH_PROPERTYconstant 
public static const LEAD_SELECTION_PATH_PROPERTY:String = "leadSelectionPath"

Bound property name for leadSelectionPath.

ROOT_VISIBLE_PROPERTYconstant 
public static const ROOT_VISIBLE_PROPERTY:String = "rootVisible"

Bound property name for rootVisible.

ROW_HEIGHT_PROPERTYconstant 
public static const ROW_HEIGHT_PROPERTY:String = "rowHeight"

Bound property name for showsRootHandles.

SCROLLS_ON_EXPAND_PROPERTYconstant 
public static const SCROLLS_ON_EXPAND_PROPERTY:String = "scrollsOnExpand"

Bound property name for scrollsOnExpand.

SELECTION_MODEL_PROPERTYconstant 
public static const SELECTION_MODEL_PROPERTY:String = "selectionModel"

Bound property name for selectionModel.

SINGLE_TREE_SELECTIONconstant 
public static const SINGLE_TREE_SELECTION:int = 1

Selection can only contain one path at a time.

TOGGLE_CLICK_COUNT_PROPERTYconstant 
public static const TOGGLE_CLICK_COUNT_PROPERTY:String = "toggleClickCount"

Bound property name for toggleClickCount.

TREE_MODEL_PROPERTYconstant 
public static const TREE_MODEL_PROPERTY:String = "model"

Bound property name for treeModel.

VISIBLE_ROW_COUNT_PROPERTYconstant 
public static const VISIBLE_ROW_COUNT_PROPERTY:String = "visibleRowCount"

Bound property name for visibleRowCount.