| Package | com.flextoolbox.controls |
| Class | public class TreeMap |
| Inheritance | TreeMap mx.core.UIComponent |
See also
| Property | Defined by | ||
|---|---|---|---|
| branchesSelectable : Boolean
Indicates if the node's within the TreeMap can be selected by the user.
| TreeMap | ||
| branchRenderer : IFactory
The custom branch renderer for the control.
| TreeMap | ||
| colorField : String
The name of the field in the data provider items to use as the color.
| TreeMap | ||
| colorFunction : Function
A user-supplied function to run on each item to determine its color.
| TreeMap | ||
| dataDescriptor : ITreeDataDescriptor
Returns the current ITreeDataDescriptor.
| TreeMap | ||
| dataProvider : Object
An object that contains the data to be displayed.
| TreeMap | ||
| dataTipField : String
The name of the field in the data provider items to display as the datatip
of the data renderer.
| TreeMap | ||
| dataTipFunction : Function
A user-supplied function to run on each item to determine its datatip.
| TreeMap | ||
| hasRoot : Boolean [read-only]
Indicates that the current dataProvider has a root item; for example,
a single top node in a hierarchical structure.
| TreeMap | ||
| labelField : String
The name of the field in the data provider items to display as the label
of the data renderer.
| TreeMap | ||
| labelFunction : Function
A user-supplied function to run on each item to determine its label.
| TreeMap | ||
| layoutStrategy : ITreeMapLayoutStrategy
The custom layout algorithm for the control.
| TreeMap | ||
| leafRenderer : IFactory
The custom leaf renderer for the control.
| TreeMap | ||
| maxDepth : int
If value is >= 0, the treemap will only render branches to a specific depth.
| TreeMap | ||
| selectable : Boolean
Indicates if the node's within the TreeMap can be selected by the user.
| TreeMap | ||
| selectedItem : Object
The currently selected item.
| TreeMap | ||
| showRoot : Boolean
Sets the visibility of the root item.
| TreeMap | ||
| weightField : String
The name of the field in the data provider items to use in weight calculations.
| TreeMap | ||
| weightFunction : Function
A user-supplied function to run on each item to determine its weight.
| TreeMap | ||
| zoomedBranch : Object
The currently zoomed branch.
| TreeMap | ||
| zoomEnabled : Boolean
If true, branches may be zoomed in (maximized) to display in the full bounds of the treemap.
| TreeMap | ||
| zoomOutType : String
Determines the way that zoom out actions work.
| TreeMap | ||
| Method | Defined by | ||
|---|---|---|---|
|
TreeMap()
Constructor.
| TreeMap | ||
|
itemIsRoot(item:Object):Boolean
Determines if an item is the root node
| TreeMap | ||
|
itemToColor(item:Object):uint
Determines the color value for an item from the data provider.
| TreeMap | ||
|
itemToDataTip(item:Object):String
Determines the datatip text for an item from the data provider.
| TreeMap | ||
|
itemToItemRenderer(item:Object):ITreeMapItemRenderer
Returns the item renderer that displays specific data.
| TreeMap | ||
|
itemToLabel(item:Object):String
Determines the label text for an item from the data provider.
| TreeMap | ||
|
itemToWeight(item:Object):Number
Determines the weight value for an item from the data provider.
| TreeMap | ||
| Method | Defined by | ||
|---|---|---|---|
|
branchLayoutChangeHandler(event:TreeMapLayoutEvent):void
| TreeMap | ||
|
itemToUID(item:Object):String
Determines the UID for a data provider item.
| TreeMap | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
Dispatched when the selectedIndex or selectedItem property
changes as a result of user interaction. | TreeMap | |||
| Dispatched when the user clicks on a leaf item in the control. | TreeMap | |||
| Dispatched when the user double-clicks on a leaf item in the control. | TreeMap | |||
| Dispatched when the user rolls the mouse pointer out of a leaf item in the control. | TreeMap | |||
| Dispatched when the user rolls the mouse pointer over a leaf item in the control. | TreeMap | |||
| branchesSelectable | property |
branchesSelectable:Boolean [read-write]Indicates if the node's within the TreeMap can be selected by the user.
This property can be used as the source for data binding.
Implementation public function get branchesSelectable():Boolean
public function set branchesSelectable(value:Boolean):void
| branchRenderer | property |
branchRenderer:IFactory [read-write]The custom branch renderer for the control. You can specify a drop-in, inline, or custom branch renderer. Unlike the renderers used by Tree components, nodes and branches in a TreeMap are quite different visually and functionally. As a result, it's easier to specify and customize seperate renderers for either type.
The default branch renderer is TreeMapBranchRenderer.
This property can be used as the source for data binding.
Implementation public function get branchRenderer():IFactory
public function set branchRenderer(value:IFactory):void
| colorField | property |
colorField:String [read-write]The name of the field in the data provider items to use as the color.
This property can be used as the source for data binding.
Implementation public function get colorField():String
public function set colorField(value:String):void
| colorFunction | property |
colorFunction:Function [read-write]A user-supplied function to run on each item to determine its color.
The color function takes one argument, the item in the data provider. It returns a uint.
colorFunction(item:Object):uint
This property can be used as the source for data binding.
Implementation public function get colorFunction():Function
public function set colorFunction(value:Function):void
| dataDescriptor | property |
dataDescriptor:ITreeDataDescriptor [read-write]Returns the current ITreeDataDescriptor.
The default value is DefaultDataDescriptor.
This property can be used as the source for data binding.
Implementation public function get dataDescriptor():ITreeDataDescriptor
public function set dataDescriptor(value:ITreeDataDescriptor):void
| dataProvider | property |
dataProvider:Object [read-write]An object that contains the data to be displayed. When you assign a value to this property, the TreeMap class handles the source data object as follows:
The default value is an empty ArrayCollection.
public function get dataProvider():Object
public function set dataProvider(value:Object):void
| dataTipField | property |
dataTipField:String [read-write]The name of the field in the data provider items to display as the datatip of the data renderer.
This property can be used as the source for data binding.
Implementation public function get dataTipField():String
public function set dataTipField(value:String):void
| dataTipFunction | property |
dataTipFunction:Function [read-write]A user-supplied function to run on each item to determine its datatip.
The datatip function takes one argument, the item in the data provider. It returns a String.
dataTipFunction(item:Object):String
This property can be used as the source for data binding.
Implementation public function get dataTipFunction():Function
public function set dataTipFunction(value:Function):void
| hasRoot | property |
hasRoot:Boolean [read-only]Indicates that the current dataProvider has a root item; for example, a single top node in a hierarchical structure. XML and Object are examples of types that have a root. Lists and arrays do not.
Implementation public function get hasRoot():Boolean
See also
| labelField | property |
labelField:String [read-write]
The name of the field in the data provider items to display as the label
of the data renderer. As a special case, if the nodes are TreeMap
components, this function applies to the TreeMap label.
This property can be used as the source for data binding.
Implementation public function get labelField():String
public function set labelField(value:String):void
| labelFunction | property |
labelFunction:Function [read-write]A user-supplied function to run on each item to determine its label.
The label function takes one argument, the item in the data provider. It returns a String.
labelFunction(item:Object):String
This property can be used as the source for data binding.
Implementation public function get labelFunction():Function
public function set labelFunction(value:Function):void
| layoutStrategy | property |
layoutStrategy:ITreeMapLayoutStrategy [read-write]The custom layout algorithm for the control.
The default alogrithm is Squarify.
This property can be used as the source for data binding.
Implementation public function get layoutStrategy():ITreeMapLayoutStrategy
public function set layoutStrategy(value:ITreeMapLayoutStrategy):void
| leafRenderer | property |
leafRenderer:IFactory [read-write]The custom leaf renderer for the control. You can specify a drop-in, inline, or custom leaf renderer.
The default node renderer is TODO.
This property can be used as the source for data binding.
Implementation public function get leafRenderer():IFactory
public function set leafRenderer(value:IFactory):void
| maxDepth | property |
maxDepth:int [read-write]If value is >= 0, the treemap will only render branches to a specific depth.
This property can be used as the source for data binding.
Implementation public function get maxDepth():int
public function set maxDepth(value:int):void
| selectable | property |
selectable:Boolean [read-write]Indicates if the node's within the TreeMap can be selected by the user.
This property can be used as the source for data binding.
Implementation public function get selectable():Boolean
public function set selectable(value:Boolean):void
| selectedItem | property |
selectedItem:Object [read-write]The currently selected item.
This property can be used as the source for data binding.
Implementation public function get selectedItem():Object
public function set selectedItem(value:Object):void
| showRoot | property |
showRoot:Boolean [read-write]
Sets the visibility of the root item.
If the dataProvider data has a root node, and this is set to
false, the TreeMap control does not display the root item.
Only the decendants of the root item are displayed.
This flag has no effect on non-rooted dataProviders, such as List and Array.
The default value is true.
This property can be used as the source for data binding.
Implementation public function get showRoot():Boolean
public function set showRoot(value:Boolean):void
See also
| weightField | property |
weightField:String [read-write]The name of the field in the data provider items to use in weight calculations.
This property can be used as the source for data binding.
Implementation public function get weightField():String
public function set weightField(value:String):void
| weightFunction | property |
weightFunction:Function [read-write]A user-supplied function to run on each item to determine its weight.
The weight function takes one arguments, the item in the data provider. It returns a Number.
weightFunction(item:Object):Number
This property can be used as the source for data binding.
Implementation public function get weightFunction():Function
public function set weightFunction(value:Function):void
| zoomedBranch | property |
zoomedBranch:Object [read-write]The currently zoomed branch.
This property can be used as the source for data binding.
Implementation public function get zoomedBranch():Object
public function set zoomedBranch(value:Object):void
| zoomEnabled | property |
zoomEnabled:Boolean [read-write]If true, branches may be zoomed in (maximized) to display in the full bounds of the treemap.
This property can be used as the source for data binding.
Implementation public function get zoomEnabled():Boolean
public function set zoomEnabled(value:Boolean):void
| zoomOutType | property |
zoomOutType:String [read-write]
Determines the way that zoom out actions work. Values are defined by the
constants in the TreeMapZoomOutType class.
This property can be used as the source for data binding.
Implementation public function get zoomOutType():String
public function set zoomOutType(value:String):void
| TreeMap | () | constructor |
public function TreeMap()Constructor.
| branchLayoutChangeHandler | () | method |
protected function branchLayoutChangeHandler(event:TreeMapLayoutEvent):voidParameters
event:TreeMapLayoutEvent |
| itemIsRoot | () | method |
public function itemIsRoot(item:Object):BooleanDetermines if an item is the root node
Parametersitem:Object — the data for which to check against the root
|
Boolean — true if the item is the root data, false if not
|
| itemToColor | () | method |
public function itemToColor(item:Object):uintDetermines the color value for an item from the data provider. If color not available, returns black (0x000000).
Parametersitem:Object |
uint |
| itemToDataTip | () | method |
public function itemToDataTip(item:Object):StringDetermines the datatip text for an item from the data provider. If no datatip is specified, returns an empty string.
Parametersitem:Object |
String |
| itemToItemRenderer | () | method |
public function itemToItemRenderer(item:Object):ITreeMapItemRendererReturns the item renderer that displays specific data.
Parametersitem:Object — the data for which to find a matching item renderer
|
ITreeMapItemRenderer —
the item renderer that matches the data
|
| itemToLabel | () | method |
public function itemToLabel(item:Object):StringDetermines the label text for an item from the data provider. If no label is specfied, returns the result of the item's toString() method. If item is null, returns an empty string.
Parametersitem:Object |
String |
| itemToUID | () | method |
protected function itemToUID(item:Object):StringDetermines the UID for a data provider item. All items in a data provider must either have a unique ID (UID) or one will be generated and associated with it. This means that you cannot have an object or scalar value appear twice in a data provider. For example, the following data provider is not supported because the value "foo" appears twice and the UID for a string is the string itself
var sampleDP:Array = ["foo", "bar", "foo"]
Simple dynamic objects can appear twice if they are two
separate instances. The following is supported because
each of the instances will be given a different UID because
they are different objects.
var sampleDP:Array = [{label: "foo"}, {label: "foo"}]
Note that the following is not supported because the same instance
appears twice.
var foo:Object = {label: "foo"};
sampleDP:Array = [foo, foo];
Parameters
item:Object — The data provider item
|
String — The UID as a string
|
| itemToWeight | () | method |
public function itemToWeight(item:Object):NumberDetermines the weight value for an item from the data provider.
Parametersitem:Object |
Number |
| change | event |
flash.events.Event
Dispatched when the selectedIndex or selectedItem property
changes as a result of user interaction.
| leafClick | event |
com.flextoolbox.events.TreeMapEvent
Dispatched when the user clicks on a leaf item in the control.
| leafDoubleClick | event |
com.flextoolbox.events.TreeMapEvent
Dispatched when the user double-clicks on a leaf item in the control.
| leafRollOut | event |
com.flextoolbox.events.TreeMapEvent
Dispatched when the user rolls the mouse pointer out of a leaf item in the control.
| leafRollOver | event |
com.flextoolbox.events.TreeMapEvent
Dispatched when the user rolls the mouse pointer over a leaf item in the control.
<?xml version="1.0" encoding="utf-8"?>
<!-- TreeMap control example. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:toolbox="http://www.flextoolbox.com/2006/mxml">
<mx:Script>
<![CDATA[
[Bindable]
public var selectedNode:XML;
// Event handler for the TreeMap control change event.
public function treeChanged(event:Event):void
{
selectedNode=TreeMap(event.target).selectedItem as XML;
}
]]>
</mx:Script>
<mx:XMLList id="treeData">
<node label="Mail Box">
<node label="Inbox">
<node label="Marketing"/>
<node label="Product Management"/>
<node label="Personal"/>
</node>
<node label="Outbox">
<node label="Professional"/>
<node label="Personal"/>
</node>
<node label="Spam"/>
<node label="Sent"/>
</node>
</mx:XMLList>
<mx:Panel title="TreeMap Control Example" height="75%" width="75%"
paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">
<mx:Label width="100%" color="blue"
text="Select a node in the TreeMap control."/>
<mx:HDividedBox width="100%" height="100%">
<toolbox:TreeMap id="myTreeMap" width="50%" height="100%" labelField="@label"
dataProvider="{treeData}" selectable="true" branchesSelectable="true"
change="treeChanged(event)"/>
<mx:TextArea height="100%" width="50%"
text="Selected Item: {selectedNode.@label}"/>
</mx:HDividedBox>
</mx:Panel>
</mx:Application>