Packagecom.jwopitz.containers
Classpublic class TileCanvas
InheritanceTileCanvas Inheritance mx.containers.Canvas

A TileCanvas container lays out its children in a grid of equal-sized cells based on the columnWidth and rowHeight values. A TileCanvas container's direction property determines whether its cells are laid out horizontally or vertically, beginning from the upper-left corner of the TileCanvas container.



Public Properties
 PropertyDefined by
  columnGap : int
The amount of spacing between columns.
TileCanvas
  columns : int
The maximum number of columns allowed.
TileCanvas
  columnWidth : int
The width of the columns.
TileCanvas
  dataProvider : Object
The set of data to be viewed.
TileCanvas
  direction : String
Determines how children are placed in the container.
TileCanvas
  dragEnabled : Boolean
A flag that indicates whether you can drag items out of this control and drop them on other controls.
TileCanvas
  dragMoveEnabled : Boolean
A flag that indicates whether items can be moved instead of just copied from the control as part of a drag-and-drop operation.
TileCanvas
  dropEnabled : Boolean
A flag that indicates whether dragged items can be dropped onto the control.
TileCanvas
  enableAutoUpdate : Boolean = true
Flag indicating if the dataProvider will autoUpdate.
TileCanvas
  enableMoveOnRefresh : Boolean = true
Flag that determines if the animation effect takes place after the dataProvider refresh event is triggered.
TileCanvas
  enableRefreshOnMove : Boolean = true
Flag indicating if the dataProvider gets refreshed after a drag and drop operation.
TileCanvas
  itemAddOn : Function
Serves as a place to add extra functionality to the items generated from the itemRenderer.
TileCanvas
  itemRenderer : IFactory
The custom item renderer for the control.
TileCanvas
  itemSpawnPoint : Point
Registers the x and y coordinates where new instances created by the itemRenderer will originate from.
TileCanvas
  rowGap : int
The amount of spacing between rows.
TileCanvas
  rowHeight : int
The height of the rows.
TileCanvas
  rows : int
The maximum number of rows allowed.
TileCanvas
Public Methods
 MethodDefined by
  
Constructor
TileCanvas
Protected Methods
 MethodDefined by
  
calculateItemPosition(columnIndex:int, rowIndex:int):Point
Called for every item in the dataProvider to retrieve the appropriate x and y coordinates to move to.
TileCanvas
  
defaultItemAddOn(value:Container):void
An empty placeholder method called on each new instance generated from the itemRenderer.
TileCanvas
  
getItemInstance():Container
A convenience method for creating new instances from the itemRenderer and initializing certain properties.
TileCanvas
  
getItemUnderMouse():Container
Retreives the item under the mouse.
TileCanvas
  
If enableRefreshOnMove == true then a drag and drop operation will trigger a reordering of the data in the dataProvider to reflect the data order in the list.
TileCanvas
  
Iterates through each item in the dataProvider to determine its column and row index based on the its position within the context of the maximum allowed columns or maximum allowed rows.
TileCanvas
  
Updates the number of actual rows and columns based on the number of items in the dataProvider.
TileCanvas
Events
 EventSummaryDefined by
    TileCanvas
    TileCanvas
Property detail
columnGapproperty
columnGap:int  [read-write]

The amount of spacing between columns.

Implementation
    public function get columnGap():int
    public function set columnGap(value:int):void
columnsproperty 
columns:int  [read-write]

The maximum number of columns allowed. Once the number of items in the dataProvider exceeds the maxColumns per row, it positions the items in excess in the next row. This is dependant of the value of direction.

This property can be used as the source for data binding.

Implementation
    public function get columns():int
    public function set columns(value:int):void
columnWidthproperty 
columnWidth:int  [read-write]

The width of the columns. Each item in the dataProvider will be rendered to this width.

Implementation
    public function get columnWidth():int
    public function set columnWidth(value:int):void
dataProviderproperty 
dataProvider:Object  [read-write]

The set of data to be viewed.

This property can be used as the source for data binding.

Implementation
    public function get dataProvider():Object
    public function set dataProvider(value:Object):void
directionproperty 
direction:String  [read-write]

Determines how children are placed in the container.

This property can be used as the source for data binding.

Implementation
    public function get direction():String
    public function set direction(value:String):void
dragEnabledproperty 
dragEnabled:Boolean  [read-write]

A flag that indicates whether you can drag items out of this control and drop them on other controls.

Implementation
    public function get dragEnabled():Boolean
    public function set dragEnabled(value:Boolean):void
dragMoveEnabledproperty 
dragMoveEnabled:Boolean  [read-write]

A flag that indicates whether items can be moved instead of just copied from the control as part of a drag-and-drop operation.

Implementation
    public function get dragMoveEnabled():Boolean
    public function set dragMoveEnabled(value:Boolean):void
dropEnabledproperty 
dropEnabled:Boolean  [read-write]

A flag that indicates whether dragged items can be dropped onto the control.

Implementation
    public function get dropEnabled():Boolean
    public function set dropEnabled(value:Boolean):void
enableAutoUpdateproperty 
public var enableAutoUpdate:Boolean = true

Flag indicating if the dataProvider will autoUpdate.

enableMoveOnRefreshproperty 
public var enableMoveOnRefresh:Boolean = true

Flag that determines if the animation effect takes place after the dataProvider refresh event is triggered.

enableRefreshOnMoveproperty 
public var enableRefreshOnMove:Boolean = true

Flag indicating if the dataProvider gets refreshed after a drag and drop operation.

itemAddOnproperty 
itemAddOn:Function  [read-write]

Serves as a place to add extra functionality to the items generated from the itemRenderer. For instance, it may be desired to have each item have a context menu on mouseEvents. A custom addOn function would be used to achieve this. The addOn function's signature is expected as function (value:Container):void

Implementation
    public function get itemAddOn():Function
    public function set itemAddOn(value:Function):void
itemRendererproperty 
itemRenderer:IFactory  [read-write]

The custom item renderer for the control.

Implementation
    public function get itemRenderer():IFactory
    public function set itemRenderer(value:IFactory):void
itemSpawnPointproperty 
public var itemSpawnPoint:Point

Registers the x and y coordinates where new instances created by the itemRenderer will originate from.

rowGapproperty 
rowGap:int  [read-write]

The amount of spacing between rows.

Implementation
    public function get rowGap():int
    public function set rowGap(value:int):void
rowHeightproperty 
rowHeight:int  [read-write]

The height of the rows. Each item in the dataProvider will be rendered to this height.

Implementation
    public function get rowHeight():int
    public function set rowHeight(value:int):void
rowsproperty 
rows:int  [read-write]

The maximum number of rows allowed. Once the number of items in the dataProvider exceeds the maxRows per column, it positions the items in excess in the next column. This is dependant of the value of direction.

This property can be used as the source for data binding.

Implementation
    public function get rows():int
    public function set rows(value:int):void
Constructor detail
TileCanvas()constructor
public function TileCanvas()

Constructor

Method detail
calculateItemPosition()method
protected function calculateItemPosition(columnIndex:int, rowIndex:int):Point

Called for every item in the dataProvider to retrieve the appropriate x and y coordinates to move to.

Parameters
columnIndex:int — The column position of the item.
 
rowIndex:int — The row position of the item.

Returns
Point — The actual x and y coordinates based on the columnIndex and rowIndex for the item.
defaultItemAddOn()method 
protected function defaultItemAddOn(value:Container):void

An empty placeholder method called on each new instance generated from the itemRenderer.

Parameters
value:Container — The instance genereated from the itemRendere in which to add functionality.
getItemInstance()method 
protected function getItemInstance():Container

A convenience method for creating new instances from the itemRenderer and initializing certain properties.

Returns
Container — A new instance from the itemRenderer.
getItemUnderMouse()method 
protected function getItemUnderMouse():Container

Retreives the item under the mouse.

Returns
Container — The item under the mouse.
updateDataProviderItems()method 
protected function updateDataProviderItems():void

If enableRefreshOnMove == true then a drag and drop operation will trigger a reordering of the data in the dataProvider to reflect the data order in the list.

updateItemLocations()method 
protected function updateItemLocations():void

Iterates through each item in the dataProvider to determine its column and row index based on the its position within the context of the maximum allowed columns or maximum allowed rows.

See also

calculateItemPosition
updateRowsAndColumns()method 
protected function updateRowsAndColumns():void

Updates the number of actual rows and columns based on the number of items in the dataProvider.

Event detail
columnsChangeevent 
Event object type: flash.events.Event

rowsChangeevent  
Event object type: flash.events.Event