Class org.aswing.ASWingUtils

Field Index

BOTTOM, CENTER, HORIZONTAL, LEFT, RIGHT, TOP, VERTICAL

Method Index

applyTextFontAndColor(), applyTextFormatAndColor(), boundsTextField(), computeStringWidth(), createPaneToHold(), getRoot(), getRootMovieClip(), getVisibleMaximizedBounds(), getWindowAncestor(), layoutCompoundLabel(), layoutText(), layoutTextWidth(), setRootMovieClip(), updateAllComponentUI(), updateComponentTreeUI()

Field Detail

CENTER

static public CENTER:Number
A fast access to ASWingConstants Constant

See Also

TOP

static public TOP:Number
A fast access to ASWingConstants Constant

See Also

LEFT

static public LEFT:Number
A fast access to ASWingConstants Constant

See Also

BOTTOM

static public BOTTOM:Number
A fast access to ASWingConstants Constant

See Also

RIGHT

static public RIGHT:Number
A fast access to ASWingConstants Constant

See Also

HORIZONTAL

static public HORIZONTAL:Number
A fast access to ASWingConstants Constant

See Also

VERTICAL

static public VERTICAL:Number
A fast access to ASWingConstants Constant

See Also

Method Detail

getVisibleMaximizedBounds

static public function getVisibleMaximizedBounds(mc:MovieClip):Rectangle

getVisibleMaximizedBounds(mc:MovieClip)
getVisibleMaximizedBounds() default to return the _root's visible bounds Returns the currently visible maximized bounds at the stage of a MovieClip.

setRootMovieClip

static public function setRootMovieClip(root:MovieClip):Void

Sets the root movieclip for components base on. Default is _root.

getRootMovieClip

static public function getRootMovieClip():MovieClip

Returns the root movieclip which components base on.

See Also

createPaneToHold

static public function createPaneToHold(com:Component, layout:LayoutManager, constraints:Object):Container

Creates and return a pane to hold the component with specified layout manager and constraints.

getWindowAncestor

static public function getWindowAncestor(c:Component):JWindow

Return

the first Window ancestor of c, or null if component is not contained inside a window

updateAllComponentUI

static public function updateAllComponentUI():Void

When call setLookAndFeel it will not change the UIs at created components. Call this method to update all existing component's UIs.

See Also

updateComponentTreeUI

static public function updateComponentTreeUI(com:Component):Void

A simple minded look and feel change: ask each node in the tree to updateUI() -- that is, to initialize its UI property with the current look and feel.

See Also

getRoot

static public function getRoot(c:Component):Component

Returns the root component for the current component tree.

Return

the first ancestor of c that's ordinaryly a MCPanel or a JWindow(or JFrame).

boundsTextField

static public function boundsTextField(tf:TextField, r:Rectangle):Void

applyTextFontAndColor

static public function applyTextFontAndColor(text:TextField, font:ASFont, color:ASColor):Void

Apply the font and color to the textfield.

Parameters

text
font
color

applyTextFormatAndColor

static public function applyTextFormatAndColor(text:TextField, textFormat:ASTextFormat, color:ASColor):Void

Apply the textformat and color to the textfield.

Parameters

text
textFormat
color

layoutCompoundLabel

static public function layoutCompoundLabel(f:ASFont, text:String, icon:Icon, verticalAlignment:Number, horizontalAlignment:Number, verticalTextPosition:Number, horizontalTextPosition:Number, viewR:Rectangle, iconR:Rectangle, textR:Rectangle, textIconGap:Number):String

Compute and return the location of the icons origin, the location of origin of the text baseline, and a possibly clipped version of the compound labels string. Locations are computed relative to the viewR rectangle.

computeStringWidth

static public function computeStringWidth(atf:ASTextFormat, str:String):Number

layoutTextWidth

static public function layoutTextWidth(text:String, textR:Rectangle, availTextWidth:Number, tf:ASTextFormat):String

before call this method textR.width must be filled with correct value of whole text.

layoutText

static public function layoutText(f:ASFont, text:String, verticalAlignment:Number, horizontalAlignment:Number, viewR:Rectangle, textR:Rectangle):String

Compute and return the location of origin of the text baseline, and a possibly clipped version of the text string. Locations are computed relative to the viewR rectangle.