Class org.aswing.JFrame

Description

Field Index

DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, ICONIFIED, MAXIMIZED, MAXIMIZED_HORIZ, MAXIMIZED_VERT, NORMAL, ON_ABILITY_CHANGED, ON_STATE_CHANGED

Inherited from JWindow

Inherited from Container

Inherited from Component

Inherited from EventDispatcher

Method Index

new JFrame()
closeReleased(), createDragRepresentMC(), getDefaultCloseOperation(), getIcon(), getMaximizedBounds(), getResizer(), getState(), getTitle(), getUIClassID(), isClosable(), isDragable(), isDragDirectly(), isResizable(), isResizeDirectly(), pack(), setClosable(), setDefaultCloseOperation(), setDragable(), setDragDirectly(), setIcon(), setMaximizedBounds(), setResizable(), setResizeDirectly(), setResizer(), setState(), setTitle(), updateUI()

Inherited from JWindow

Inherited from Container

Inherited from Component

Inherited from EventDispatcher

Constructor Detail

JFrame

public function JFrame(owner, title, modal:Boolean)

JFrame(title:String, modal:Boolean)
JFrame(title:String)
JFrame(owner, title:String, modal:Boolean)
JFrame(owner, title:String)
JFrame(owner)
JFrame()

Parameters

ownerthe owner of this window, a JWindow or a MovieClip, default is ASWingUtils.getRootMovieClip()
titlethe String to display in the dialog's title bar. default is undefined.
modaltrue for a modal dialog, false for one that allows other windows to be active at the same time, default is false.

See Also

Field Detail

ON_STATE_CHANGED

static public ON_STATE_CHANGED:String
When the frame's state changed.
onStateChanged Event{source:JFrame}

ON_ABILITY_CHANGED

static public ON_ABILITY_CHANGED:String
When the frame's ability changed. Include:
  • resizable
  • closable
  • dragable

onAbilityChanged Event{source:JFrame}

NORMAL

static public NORMAL:Number

See Also

ICONIFIED

static public ICONIFIED:Number

See Also

MAXIMIZED_HORIZ

static public MAXIMIZED_HORIZ:Number

See Also

MAXIMIZED_VERT

static public MAXIMIZED_VERT:Number

See Also

MAXIMIZED

static public MAXIMIZED:Number

See Also

DO_NOTHING_ON_CLOSE

static public DO_NOTHING_ON_CLOSE:Number

HIDE_ON_CLOSE

static public HIDE_ON_CLOSE:Number

DISPOSE_ON_CLOSE

static public DISPOSE_ON_CLOSE:Number

Method Detail

updateUI

public function updateUI():Void

Description copied from Component

Resets the UI property to a value from the current look and feel. Component subclasses must override this method like this:

   public void updateUI() {
      setUI((SliderUI)UIManager.getUI(this);
   }
  

Overrides

updateUI() in org.aswing.JWindow

getUIClassID

public function getUIClassID():String

Description copied from Component

Returns the UIDefaults key used to look up the name of the org.aswing.plaf.ComponentUI class that defines the look and feel for this component. Most applications will never need to call this method. Subclasses of Component that support pluggable look and feel should override this method to return a UIDefaults key that maps to the ComponentUI subclass that defines their look and feel.

Overrides

getUIClassID() in org.aswing.JWindow

setTitle

public function setTitle(t:String):Void

Sets the text to be displayed in the title bar for this frame.

Parameters

tthe text to be displayed in the title bar, null to display no text in the title bar.

getTitle

public function getTitle():String

Returns the text displayed in the title bar for this frame.

Return

the text displayed in the title bar for this frame.

setIcon

public function setIcon(ico:Icon):Void

Sets the icon to be displayed in the title bar for this frame.

Parameters

icothe icon to be displayed in the title bar, null to display no icon in the title bar.

getIcon

public function getIcon():Icon

Returns the icon displayed in the title bar for this frame.

Return

the icon displayed in the title bar for this frame.

setResizable

public function setResizable(b:Boolean):Void

Sets whether this frame is resizable by the user.

"resizable" means include capability of restore normal resize, maximize, iconified and resize by drag.

Parameters

btrue user can resize the frame by click resize buttons or drag to scale the frame, false user can't.

See Also

isResizable

public function isResizable():Boolean

Returns whether this frame is resizable by the user. By default, all frames are initially resizable.

"resizable" means include capability of restore normal resize, maximize, iconified and resize by drag.

See Also

setDragable

public function setDragable(b:Boolean):Void

Sets whether this frame can be dragged by the user. By default, it's true.

"dragable" means drag to move the frame.

Parameters

b

See Also

isDragable

public function isDragable():Boolean

Returns whether this frame can be dragged by the user. By default, it's true.

See Also

setClosable

public function setClosable(b:Boolean):Void

Sets whether this frame can be closed by the user. By default, it's true. Whether the frame will be hide or dispose, depend on the value returned by getDefaultCloseOperation.

Parameters

btrue user can click close button to generate the close event, false user can't.

See Also

isClosable

public function isClosable():Boolean

Returns whether this frame can be closed by the user. By default, it's true.

See Also

pack

public function pack():Void

Only did effect when state is NORMAL

getMaximizedBounds

public function getMaximizedBounds():Rectangle

Gets maximized bounds for this frame.
If the maximizedBounds was setted by setMaximizedBounds it will return the setted value. else if the owner is a JWindow it will return the owner's content pane's bounds, if the owner is a movieclip it will return the movie's stage bounds.

setMaximizedBounds

public function setMaximizedBounds(b:Rectangle):Void

Sets the maximized bounds for this frame.

Parameters

bbounds for the maximized state, null to back to use default bounds descripted in getMaximizedBounds's comments.

See Also

setDefaultCloseOperation

public function setDefaultCloseOperation(operation:Number):Void

Sets the operation that will happen by default when the user initiates a "close" on this frame. You must specify one of the following choices:

  • DO_NOTHING_ON_CLOSE (defined in WindowConstants): Don't do anything; require the program to handle the operation in the windowClosing method of a registered EventListener object.
  • HIDE_ON_CLOSE (defined in WindowConstants): Automatically hide the frame after invoking any registered EventListener objects.
  • DISPOSE_ON_CLOSE (defined in WindowConstants): Automatically hide and dispose the frame after invoking any registered EventListener objects.

The value is set to HIDE_ON_CLOSE by default. if you set a value is not three of them, think of it is will be changed to default value.

Parameters

operationthe operation which should be performed when the user closes the frame

See Also

getDefaultCloseOperation

public function getDefaultCloseOperation():Number

Returns the operation that will happen by default when the user initiates a "close" on this frame.

See Also

setState

public function setState(s:Number):Void

getState

public function getState():Number

setResizer

public function setResizer(r:Resizer):Void

getResizer

public function getResizer():Resizer

setResizeDirectly

public function setResizeDirectly(b:Boolean):Void

Indicate whether need resize frame directly when drag the resizer arrow. if set to false, there will be a rectange to represent then size what will be resized to. if set to true, the frame will be resize directly when drag, but this is need more cpu counting.
Default is false.

See Also

isResizeDirectly

public function isResizeDirectly():Boolean

Return whether need resize frame directly when drag the resizer arrow.

See Also

setDragDirectly

public function setDragDirectly(b:Boolean):Void

Indicate whether need move frame directly when drag the frame. if set to false, there will be a rectange to represent then bounds what will be move to. if set to true, the frame will be move directly when drag, but this is need more cpu counting.
Default is false.

isDragDirectly

public function isDragDirectly():Boolean

Return whether need move frame directly when drag the frame.

See Also

closeReleased

public function closeReleased():Void

Call this method tring to close the Frame depend on the defaultCloseOperation

createDragRepresentMC

public function createDragRepresentMC():MovieClip

This is just for FrameUI