Packagetwaver
Classpublic class Layer
InheritanceLayer Inheritance Data Inheritance flash.events.EventDispatcher
Implements ILayer

This class defines the layer object that represents a stonealone layer in element box. All elements contained in element box has a layer id property to indicate which layer this element located. All elements with same layer id are located in the same layer.

Layer is an invisible container of element box. It manages contains elements and can be moved up and down. It can be visible or invisible, editable or not editable.

All layers are managed by LayerBox which is work for ElementBox.

To know more information about this layer object, check interface twaver.ILayer for more details.



Public Properties
 PropertyDefined By
 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
  editable : Boolean
Check whether this layer is editable.
Layer
 InheritedhasChildren : Boolean
[read-only] Check whether this data has children objects.
Data
 Inheritedicon : String
Get icon value for this data.
Data
 Inheritedid : Object
[read-only] Get the ID value of this data.
Data
  movable : Boolean
Check whether this layer is movable.
Layer
 Inheritedname : String
Get name of this data.
Data
 Inheritedparent : IData
Get parent data object.
Data
 InheritedtoolTip : String
Get the tooltip text of this data.
Data
  visible : Boolean
Whether this layer is visible in views.
Layer
Public Methods
 MethodDefined By
  
Layer(id:Object, name:String = null)
Constructor
Layer
 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
Deserialize given XML data to data objects.
Data
 Inherited
dispatchPropertyChangeEvent(property:String, oldValue:Object, newValue:Object):Boolean
Dispatch property change event to all installed listeners.
Data
 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
Get specified property value from this data.
Data
 Inherited
hasOwnProperty(name:String):Boolean
Whether this data has specified property.
Data
 Inherited
isDescendantOf(data:IData):Boolean
Check whether this data is a descendant of the specified data object.
Data
 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
Serialize this data object into XML.
Data
 Inherited
setClient(clientProp:String, newValue:*):IClient
Set client property for this data.
Data
 Inherited
setPropertyValue(property:String, value:Object):void
Set specified property name value on this data.
Data
 Inherited
toChildren(matchFunction:Function = null):ICollection
Iterate children collection by given callback function.
Data
 Inherited
toString():String
[override]
Data
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
Deserialize specified property from the given XML data contains property value.
Data
 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
onParentChanged(oldParent:IData, newParent:IData):void
Called back when data parent changed.
Data
 Inherited
onPropertyChanged(property:String, oldValue:Object, newValue:Object):void
Called back when a property of this data is changed.
Data
 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
Property Detail
editableproperty
editable:Boolean

Check whether this layer is editable. If true, all elements inside this layer will be editable.


Implementation
    public function get editable():Boolean
    public function set editable(value:Boolean):void
movableproperty 
movable:Boolean

Check whether this layer is movable. If true, layer is able to be moved up or down in layer box.


Implementation
    public function get movable():Boolean
    public function set movable(value:Boolean):void
visibleproperty 
visible:Boolean

Whether this layer is visible in views. If visible, all elements contained are visible. Otherwise, all elements in this layer will invisible.


Implementation
    public function get visible():Boolean
    public function set visible(value:Boolean):void
Constructor Detail
Layer()Constructor
public function Layer(id:Object, name:String = null)

Constructor

Parameters
id:Object — the layer id used to indicate this layer. This should be unique value in one layer box.
 
name:String (default = null) — layer name. A simple string text that can be any value.