Container can contain many component to be his child, all children are in its bounds, and it moved, all children moved. It be removed(destroy) all children will be removed.
static public ON_COM_ADDED:String
static public ON_COM_REMOVED:String
public function invalidate():Void
Invalidates the container. The container and all parents above it are marked as needing to be laid out. This method can be called often, so it needs to execute quickly.
invalidate() in org.aswing.Component
public function validate():Void
Validates this container and all of its subcomponents.
The validate
method is used to cause a container
to lay out its subcomponents again. It should be invoked when
this container's subcomponents are modified (added to or
removed from the container, or layout-related information
changed) after the container has been displayed.
validate() in org.aswing.Component
public function addTo(parent:Container):Void
Create and add this component to a Container. the method must only can call in a Container's method, else the Container's layout maybe wrong and Container event will not be called
public function destroy():Void
Destroy a Container. A Container was called destroy, it will call its children destroy first, This can ensure that all its children as not displayable after it be removed.
destroy() in org.aswing.Component
public function append(com:Component, constraints:Object):Void
On Component just can add to one Container.
So if the com has a parent, it will remove from its parent first, then add to
this container.
This method is shortcut of insert(-1, com, constraints)
.
com | the component to be added |
constraints | an object expressing layout contraints for this component |
public function insert(i:Number, com:Component, constraints:Object):Void
Add component to spesified index. So if the com has a parent, it will remove from its parent first, then add to this container.
i | index the position at which to insert the component, or less than 0 value to append the component to the end |
com | the component to be added |
constraints | an object expressing layout contraints for this component |
Error | when index > children count |
Error | when add container's parent(or itself) to itself |
public function remove(com:Component):Component
Remove the specified child component.
the component just removed, null if the component is not in this container.
public function removeAt(i:Number):Component
Remove the specified index child component.
i | the index of component, less than 0 mean the component in the end of children list. |
the component just removed. or null there is not component at this position.