class org.aswing.Container extends Component

Container can contain many component to be his child, all children are in its bounds, and it moved, all children moved. It be removed from stage all children will be removed from stage.

It for component like DisplayObjectContainer for DisplayObject.

  • There are two scope for Container children, One is Component children. The indices and numbers for insert(), getComponent(), removeAt(), getComponentCount() is in Component children scope.
  • Another is normal DisplayObject children, The indices and numbers for addChildAt(), getChildAt(), removeChildAt() and numChildren() is in normal DisplayObject children scope.

Authors

  • paling

Instance Fields

Show inherited public instance fieldsHide inherited public instance fields

Inherited from Component

var alignmentX:Float
var alignmentY:Float
var background:ASColor
var backgroundDecorator:GroundDecorator
var border:Border
var bounds:IntRectangle
var clipBounds:IntRectangle
var constraints:Dynamic
var currentSize:IntDimension
var dragEnabled:Bool
var dropTrigger:Bool
var enabled:Bool
var focusable:Bool
var focusableSet:Bool
var font:ASFont
var foreground:ASColor
var foregroundDecorator:GroundDecorator
var location:IntPoint
var maximumSize:IntDimension
var mideground:ASColor
var minimumSize:IntDimension
var opaque:Bool
var opaqueSet:Bool
var preferredSize:IntDimension
var resizerMargin:Insets
var styleProxy:Component
var styleTune:StyleTune
var toolTipText:String
var transitFocusFactor:Float
var ui:ComponentUI
var uiElement:Bool
var visibility:Bool
function addDragAcceptableInitiator(com:Component):Void
function componentToGlobal(p:IntPoint):IntPoint
function getClientProperty(key:String, ?defaultValue:Dynamic):Dynamic
function getDefaultBasicUIClass():Class<Dynamic>
function getFocusManager():FocusManager
function getGlobalLocation(?rv:IntPoint):IntPoint
function getInsets():Insets
function getInternalFocusObject():InteractiveObject
function getKeyboardManager():KeyboardManager
function getMousePosition():IntPoint
function getPaintBounds():IntRectangle
function getParent():Container
function getRootPaneAncestor():JRootPane
function getUIClassID():String
function globalToComponent(p:IntPoint):IntPoint
function hitTestMouse():Bool
function invalidate():Void
function invalidatePreferSizeCaches():Void
function isCachePreferSizes():Bool
function isDragAcceptableInitiator(com:Component):Bool
function isFocusOwner():Bool
function isFontValidated():Bool
function isOnStage():Bool
function isShowing():Bool
function isValid():Bool
function isValidateRoot():Bool
function makeFocus():Void
function pack():Void
function paintFocusRect(?force:Bool):Void
function paintImmediately():Void
function parentReAppendChildren():Void
function putClientProperty(key:String, value:Dynamic):Void
function reAppendToParent(?constraints:Dynamic):Void
function removeDragAcceptableInitiator(com:Component):Void
function removeFromContainer():Void
function repaint():Void
function repaintAndRevalidate():Void
function requestFocus():Bool
function revalidate():Void
function setCachePreferSizes(b:Bool):Void
function setClipSize(size:IntDimension):Void
function setDragAcceptableInitiatorAppraiser(func:Dynamic ->Bool):Void
function setFontValidated(b:Bool):Void
function setGlobalLocation(gp:IntPoint):Void
function transferFocus():Bool
function transferFocusBackward():Bool
function updateUI():Void
function validate():Void

Inherited from AWSprite

function bringToBottom(child:DisplayObject):Void
function bringToTop(child:DisplayObject):Void
function containsChild(child:DisplayObject):Bool
function getHighestIndexUnderForeground():Int
function getLowestIndexAboveBackground():Int
function isClipMasked():Bool
function setChildIndex(child:DisplayObject, index:Int):Void
function setClipMaskRect(b:IntRectangle):Void
function setClipMasked(m:Bool):Void
function toString():String

Inherited from Sprite

var buttonMode:Bool
var dropTarget:DisplayObject
var graphics:Graphics
var hitArea:Sprite
var soundTransform:SoundTransform
var useHandCursor:Bool
function startDrag(?lockCenter:Bool, ?bounds:Rectangle):Void
function startTouchDrag(touchPointID:Int, ?lockCenter:Bool, ?bounds:Rectangle):Void
function stopDrag():Void
function stopTouchDrag(touchPointID:Int):Void

Inherited from DisplayObjectContainer

var mouseChildren:Bool
var numChildren:Int
var tabChildren:Bool
var textSnapshot:TextSnapshot
function addChild(child:DisplayObject):DisplayObject
function addChildAt(child:DisplayObject, index:Int):DisplayObject
function areInaccessibleObjectsUnderPoint(point:Point):Bool
function contains(child:DisplayObject):Bool
function getChildAt(index:Int):DisplayObject
function getChildByName(name:String):DisplayObject
function getChildIndex(child:DisplayObject):Int
function getObjectsUnderPoint(point:Point):Array<DisplayObject>
function removeChild(child:DisplayObject):DisplayObject
function removeChildAt(index:Int):DisplayObject
function setChildIndex(child:DisplayObject, index:Int):Void
function swapChildren(child1:DisplayObject, child2:DisplayObject):Void
function swapChildrenAt(index1:Int, index2:Int):Void

Inherited from InteractiveObject

var accessibilityImplementation:AccessibilityImplementation
var contextMenu:ContextMenu
var doubleClickEnabled:Bool
var focusRect:Dynamic
var mouseEnabled:Bool
var tabEnabled:Bool
var tabIndex:Int

Inherited from DisplayObject

var accessibilityProperties:AccessibilityProperties
var alpha:Float
var blendMode:BlendMode
var blendShader:Shader
var cacheAsBitmap:Bool
var filters:Array<BitmapFilter>
var height:Float
var loaderInfo:LoaderInfo
var mask:DisplayObject
var mouseX:Float
var mouseY:Float
var name:String
var opaqueBackground:Null<UInt>
var parent:DisplayObjectContainer
var root:DisplayObject
var rotation:Float
var rotationX:Float
var rotationY:Float
var rotationZ:Float
var scale9Grid:Rectangle
var scaleX:Float
var scaleY:Float
var scaleZ:Float
var scrollRect:Rectangle
var stage:Stage
var transform:Transform
var visible:Bool
var width:Float
var x:Float
var y:Float
var z:Float
function getBounds(targetCoordinateSpace:DisplayObject):Rectangle
function getRect(targetCoordinateSpace:DisplayObject):Rectangle
function globalToLocal(point:Point):Point
function globalToLocal3D(point:Point):Vector3D
function hitTestObject(obj:DisplayObject):Bool
function hitTestPoint(x:Float, y:Float, ?shapeFlag:Bool):Bool
function local3DToGlobal(point3d:Vector3D):Point
function localToGlobal(point:Point):Point

Inherited from EventDispatcher

function addEventListener(type:String, listener:Dynamic ->Void?useCapture:Bool, ?priority:Int, ?useWeakReference:Bool):Void
function dispatchEvent(event:Event):Bool
function hasEventListener(type:String):Bool
function removeEventListener(type:String, listener:Dynamic ->Void?useCapture:Bool):Void
function toString():String
function willTrigger(type:String):Bool

function new(): Void

function append(com:Component, ?constraints:Dynamic = null): 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 as same as insert(-1, com, constraints).

com

the component to be added

constraints

an object expressing layout contraints for this component

See Also

function appendAll(coms:Array<Dynamic>): Void

Adds one or more component to the container with null constraints

See Also

function doLayout(): Void

layout this container

function getComponent(index:Int): Component

Gets the nth(index) component in this container. @throw RangeError if index out of container children bounds

n

the index of the component to get.

returns

the nth component in this container. returned null if the index if out of bounds.

See Also

function getComponentCount(): Int

Gets the number of components in this container.

returns

the number of components in this container.

See Also

function getFocusTraversalPolicy(): FocusTraversalPolicy

Returns the focus traversal policy of this container, it will return its parent's focus traversal policy if its self is null. If no focus traversal policy is found, it will return a default focus traversal policy. (FocusManager.getCurrentManager().getDefaultFocusTraversalPolicy()).

returns

the focus traversal policy

function getIndex(com:Component): Int

Returns the index of the child component in this container.

returns

the index of the specified child component.

See Also

function insert(i:Int, com:Component, ?constraints:Dynamic = null): 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

function insertAll(index:Int, coms:Array<Dynamic>): Void

Insets one or more component to the container with null constraints at specified starting index.

See Also

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.

See Also

function isAncestorOf(c:Component): Bool

Checks if the component is contained in the component hierarchy of this container.

c

the component

returns

true if it is an ancestor; false otherwise.

function reAppendChildren(): Void

Removes all children and then append them with their constraints.

function remove(com:Component): Component

Remove the specified child component.

returns

the component just removed, null if the component is not in this container.

function removeAll(): Void

Remove all child components.

function removeAt(i:Int): Component

Remove the specified index child component.

i

the index of component.

returns

the component just removed. or null there is not component at this position.

function removeChild(child:DisplayObject): DisplayObject

Removes a normal display object child.

If child is a Component child instance, a ArgumentError error will be thrown. Becasue you should call remove to remove a component child.

@inheritDoc

child

the child to be removed.

See Also

function removeChildAt(index:Int): DisplayObject

Removes a normal display object child with index.

If child is a Component child instance, a ArgumentError error will be thrown. Becasue you should call removeAt to remove a component child.

@inheritDoc

index

the index of the child to be removed.

See Also

function setFocusTraversalPolicy(ftp:FocusTraversalPolicy): Void

Sets the focus traversal policy to this container, or sets null to make this container use its parent's focus traversal policy. (By default, it is null)

ftp

the focus traversal policy, or null.

function setLayout(layout:LayoutManager): Void

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.

See Also