Packagetwaver
Classpublic class Grid
InheritanceGrid Inheritance Follower Inheritance Node Inheritance Element Inheritance Data Inheritance flash.events.EventDispatcher

Grid element represent a grid with columns and rows. Grid hold a set of cells. Each cell can hold another grid. You can specify the height or width of columns and rows.

Grid is a good element to present a grid-like telecom equipment panel or chassis. You can divide an equipment rick or slot with columns or rows, add cards, ports on the grid at the cells, then very easy to build a complex equipment panel.

Check out "Grid Editor Demo" in TWaver Flex online demo and the related source code to know more about the usage of grid element



Public Properties
 PropertyDefined By
 InheritedagentLinks : ICollection
[read-only] Get all agential links of this node.
Node
 InheritedalarmState : AlarmState
[read-only] Get alarm state object of this element.
Element
 InheritedcenterLocation : Point
Get the location of this node's center point.
Node
 Inheritedchildren : ICollection
[read-only] Get all children data objects of this data object.
Data
 InheritedchildrenCount : int
[read-only] Get all children total count for this data.
Data
 InheritedclientProperties : ICollection
[read-only] Get a ICollection that contians all client proerty name.
Data
  elementUIClass : Class
[override] [read-only] Get element ui class name.
Grid
 Inheritedfollowers : ICollection
[read-only] Get all followers of this node with a collection.
Node
 InheritedfromAgentLinks : ICollection
[read-only] Get all agential from/start links of this node with a collection.
Node
 InheritedfromLinks : ICollection
[read-only] Get all links start from this node.
Node
 InheritedhasChildren : Boolean
[read-only] Check whether this data has children objects.
Data
 Inheritedheight : Number
Get node height value.
Node
 Inheritedhost : Node
Get the host node of this follower.
Follower
 Inheritedicon : String
Get icon value for this data.
Data
 Inheritedid : Object
[read-only] Get the ID value of this data.
Data
 Inheritedimage : String
Get image url of this node.
Node
 InheritedlayerID : Object
Get layer ID of this element.
Element
 Inheritedlinks : ICollection
[read-only] Get all connected links of this node with a collection.
Node
 Inheritedlocation : Point
[override] Set the location for this node.
Follower
 InheritedloopedLinks : ICollection
[read-only] Get all looped links on this node with a collection.
Node
 Inheritedname : String
Get name of this data.
Data
 Inheritedparent : IData
Get parent data object.
Data
 Inheritedrect : Rectangle
[read-only] Get node bounds.
Node
 Inheritedsize : Size
[read-only] Get node size.
Node
 InheritedstyleProperties : ICollection
[read-only] Get a ICollection that contians all style proerty name.
Element
 InheritedtoAgentLinks : ICollection
[read-only] Get all agential to/end links of this node with a collection.
Node
 InheritedtoLinks : ICollection
[read-only] Get all to/end links end to this node.
Node
 InheritedtoolTip : String
Get the tooltip text of this data.
Data
 Inheritedwidth : Number
Get node width.
Node
 Inheritedx : Number
[read-only] Get x location of this node.
Node
 Inheritedy : Number
[read-only] Get y location of this node.
Node
Public Methods
 MethodDefined By
  
Grid(id:Object = null)
The constructor of grid element.
Grid
 Inherited
addChild(child:IData, index:int = -1):Boolean
Add a child data object for this data.
Data
 Inherited
addPropertyChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add a property change listener to this data to monitoring property change event.
Data
 Inherited
clearChildren():Boolean
Clear all children from this data.
Data
 Inherited
deserializeXML(serializer:XMLSerializer, xml:XML):void
[override] inheritDoc
Element
 Inherited
dispatchPropertyChangeEvent(property:String, oldValue:Object, newValue:Object):Boolean
Dispatch property change event to all installed listeners.
Data
  
getCellObject(point:Point):Object
Get the cell object of the specified location.
Grid
  
getCellRect(rowIndex:Number, columnIndex:Number):Rectangle
Get the cell bounds by specified row and column index.
Grid
 Inherited
getChildAt(index:int):IData
Get child as specified index location.
Data
 Inherited
getClient(clientProp:String):*
Get specified client property value.
Data
 Inherited
getPropertyValue(property:String):Object
[override] Get an user defined property on this data.
Element
 Inherited
getStyle(styleProp:String, returnDefaultIfNull:Boolean = true):*
Get the specified style property value.
Element
 Inherited
hasAgentLinks():Boolean
Check whether this node has agential links.
Node
 Inherited
hasOwnProperty(name:String):Boolean
Whether this data has specified property.
Data
 Inherited
Check whether this element has been adjusted to bottom.
Element
 Inherited
isDescendantOf(data:IData):Boolean
Check whether this data is a descendant of the specified data object.
Data
 Inherited
isHostOn(node:Node):Boolean
Check whether the specified node is my host or on my host chain.
Follower
 Inherited
isLoopedHostOn(follower:Follower):Boolean
Check whether specified follower is on a looped host chain.
Follower
 Inherited
isParentOf(data:IData):Boolean
Check whether this data is the parent of specified data.
Data
 Inherited
isRelatedTo(data:IData):Boolean
Check whether this data has descendant relationship with the specified data.
Data
 Inherited
removeChild(child:IData):Boolean
Remove the specified child object.
Data
 Inherited
removePropertyChangeListener(listener:Function):void
Remove the specified property change listener.
Data
 Inherited
serializeXML(serializer:XMLSerializer, newInstance:IData):void
[override] inheritDoc
Follower
 Inherited
setCenterLocation(x:Number, y:Number):void
Set a new location for this node's center point.
Node
 Inherited
setClient(clientProp:String, newValue:*):IClient
Set client property for this data.
Data
 Inherited
setLocation(x:Number, y:Number):void
Set a new location for this node.
Node
 Inherited
setPropertyValue(property:String, value:Object):void
[override] Set an user defined property on this data.
Element
 Inherited
setSize(width:Number, height:Number):void
Set node size.
Node
 Inherited
setStyle(styleProp:String, newValue:*):IStyle
Set a style for this element.
Element
 Inherited
toChildren(matchFunction:Function = null):ICollection
Iterate children collection by given callback function.
Data
 Inherited
toString():String
[override]
Data
 Inherited
translate(dx:Number, dy:Number):void
Translate node location to specified offset.
Node
Protected Methods
 MethodDefined By
 Inherited
deserializeClient(serializer:XMLSerializer, clientXML:XML, clientProp:String):void
Deserialize client property from given XML data.
Data
 Inherited
deserializeProperty(serializer:XMLSerializer, propertyXML:XML, property:String):void
[override] inheritDoc
Element
 Inherited
deserializeStyle(serializer:XMLSerializer, styleXML:XML, styleProp:String):void
Deserialize style from given XML data.
Element
 Inherited
handleHostPropertyChange(e:PropertyChangeEvent):void
Called when host property is changed.
Follower
 Inherited
onChildAdded(child:IData, index:int):void
Called back when a child is added.
Data
 Inherited
onChildRemoved(child:IData, index:int):void
Called back when a child is removed.
Data
 Inherited
onChildrenCleared(children:Array):void
Called back when all children are cleared from this data.
Data
 Inherited
onClientChanged(styleProp:String, oldValue:*, newValue:*):void
Called when client property is changed.
Data
 Inherited
onHostChanged(oldHost:Node, newHost:Node):void
Called when host node is changed.
Follower
 Inherited
onParentChanged(oldParent:IData, newParent:IData):void
[override] Called back when data parent changed.
Node
 Inherited
onPropertyChanged(property:String, oldValue:Object, newValue:Object):void
[override] Called back when a property of this data is changed.
Node
 Inherited
onStyleChanged(styleProp:String, oldValue:*, newValue:*):void
[override] Called when style property is changed.
Follower
 Inherited
serializeClient(serializer:XMLSerializer, clientPrope:String, newInstance:IData):void
Serialize given client property into the specified XML serializer.
Data
 Inherited
serializeProperty(serializer:XMLSerializer, property:String, newInstance:IData):void
Serialize given property into the specified XML serializer.
Data
 Inherited
serializeStyle(serializer:XMLSerializer, stylePrope:String, newInstance:IData):void
Serialize specified property into XML.
Element
 Inherited
updateFollower(e:PropertyChangeEvent):void
Update follower after host property is changed
Follower
 Inherited
updateFollowerImpl(e:PropertyChangeEvent):void
Core implementation of methd updateFollower
Follower
Property Detail
elementUIClassproperty
elementUIClass:Class  [read-only] [override]

Get element ui class name. UI class is used to paint/draw element on network canvas. TWaver Flex will create UI object for the element instance by this returned class name.


Implementation
    public function get elementUIClass():Class
Constructor Detail
Grid()Constructor
public function Grid(id:Object = null)

The constructor of grid element.

Parameters
id:Object (default = null) — the ID of grid element.
Method Detail
getCellObject()method
public function getCellObject(point:Point):Object

Get the cell object of the specified location. The returned object is a simple object with "rowIndex", "columnIndex" and "rect" values.

Parameters

point:Point — the cell this point located.

Returns
Object — the cell object specified point is located.
getCellRect()method 
public function getCellRect(rowIndex:Number, columnIndex:Number):Rectangle

Get the cell bounds by specified row and column index.

Parameters

rowIndex:Number — row index of the cell
 
columnIndex:Number — column index of the cell

Returns
Rectangle — specified cell bounds