Class org.aswing.BorderLayout

Description

A border layout lays out a container, arranging and resizing its components to fit in five regions: north, south, east, west, and center. Each region may contain no more than one component, and is identified by a corresponding constant: NORTH, SOUTH, EAST, WEST, and CENTER. When adding a component to a container with a border layout, use one of these five constants, for example:

    Panel p = new Panel();
    p.setLayout(new BorderLayout());
    p.add(new Button("Okay"), BorderLayout.SOUTH);
 
As a convenience, BorderLayout interprets the absence of a string specification the same as the constant CENTER:
    Panel p2 = new Panel();
    p2.setLayout(new BorderLayout());
    p2.add(new TextArea());  // Same as p.add(new TextArea(), BorderLayout.CENTER);
 

Field Index

AFTER_LAST_LINE, AFTER_LINE_ENDS, BEFORE_FIRST_LINE, BEFORE_LINE_BEGINS, CENTER, EAST, LINE_END, LINE_START, NORTH, PAGE_END, PAGE_START, SOUTH, WEST

Method Index

new BorderLayout()
addLayoutComponent(), getHgap(), getLayoutAlignmentX(), getLayoutAlignmentY(), getVgap(), layoutContainer(), minimumLayoutSize(), preferredLayoutSize(), removeLayoutComponent(), setHgap(), setVgap(), toString()

Inherited from EmptyLayout

Constructor Detail

BorderLayout

public function BorderLayout(hgap:Number, vgap:Number)

Constructs a border layout with the specified gaps between components. The horizontal gap is specified by hgap and the vertical gap is specified by vgap.

Parameters

hgapthe horizontal gap.
vgapthe vertical gap.

Field Detail

NORTH

static public NORTH:String
The north layout constraint (top of container).

SOUTH

static public SOUTH:String
The south layout constraint (bottom of container).

EAST

static public EAST:String
The east layout constraint (right side of container).

WEST

static public WEST:String
The west layout constraint (left side of container).

CENTER

static public CENTER:String
The center layout constraint (middle of container).

BEFORE_FIRST_LINE

static public BEFORE_FIRST_LINE:String

AFTER_LAST_LINE

static public AFTER_LAST_LINE:String

BEFORE_LINE_BEGINS

static public BEFORE_LINE_BEGINS:String

AFTER_LINE_ENDS

static public AFTER_LINE_ENDS:String

PAGE_START

static public PAGE_START:String

PAGE_END

static public PAGE_END:String

LINE_START

static public LINE_START:String

LINE_END

static public LINE_END:String

Method Detail

getHgap

public function getHgap():Number

setHgap

public function setHgap(hgap:Number):Void

getVgap

public function getVgap():Number

setVgap

public function setVgap(vgap:Number):Void

addLayoutComponent

public function addLayoutComponent(comp:Component, constraints:Object):Void

Description copied from EmptyLayout

do nothing

Specified By

addLayoutComponent() in org.aswing.LayoutManager

Overrides

addLayoutComponent() in org.aswing.EmptyLayout

removeLayoutComponent

public function removeLayoutComponent(comp:Component):Void

minimumLayoutSize

public function minimumLayoutSize(target:Container):Dimension

Description copied from EmptyLayout

new Dimension(0, 0);

Specified By

minimumLayoutSize() in org.aswing.LayoutManager

Overrides

minimumLayoutSize() in org.aswing.EmptyLayout

preferredLayoutSize

public function preferredLayoutSize(target:Container):Dimension

Description copied from EmptyLayout

return target.getSize();

Specified By

preferredLayoutSize() in org.aswing.LayoutManager

Overrides

preferredLayoutSize() in org.aswing.EmptyLayout

getLayoutAlignmentX

public function getLayoutAlignmentX(target:Container):Number

getLayoutAlignmentY

public function getLayoutAlignmentY(target:Container):Number

layoutContainer

public function layoutContainer(target:Container):Void

Lays out the container argument using this border layout.

This method actually reshapes the components in the specified container in order to satisfy the constraints of this BorderLayout object. The NORTH and SOUTH components, if any, are placed at the top and bottom of the container, respectively. The WEST and EAST components are then placed on the left and right, respectively. Finally, the CENTER object is placed in any remaining space in the middle.

Most applications do not call this method directly. This method is called when a container calls its doLayout method.

Parameters

targetthe container in which to do the layout.

Specified By

layoutContainer() in org.aswing.LayoutManager

Overrides

layoutContainer() in org.aswing.EmptyLayout

See Also

toString

public function toString():String