Class org.aswing.GridBagConstraints

Description

The GridBagConstraints class specifies constraints for components that are laid out using the GridBagLayout class.

Field Index

anchor, BOTH, CENTER, EAST, fill, gridheight, gridwidth, gridx, gridy, HORIZONTAL, insets, ipadx, ipady, NONE, NORTH, NORTHEAST, NORTHWEST, RELATIVE, REMAINDER, SOUTH, SOUTHEAST, SOUTHWEST, VERTICAL, weightx, weighty, WEST

Method Index

new GridBagConstraints()
clone()

Constructor Detail

GridBagConstraints

public function GridBagConstraints()

Creates a GridBagConstraint object with all of its fields set to their default value.

Field Detail

RELATIVE

static public RELATIVE:Number
Specifies that this component is the next-to-last component in its column or row (gridwidth, gridheight), or that this component be placed next to the previously added component (gridx, gridy).

See Also

REMAINDER

static public REMAINDER:Number
Specifies that this component is the last component in its column or row.

NONE

static public NONE:Number
Do not resize the component.

BOTH

static public BOTH:Number
Resize the component both horizontally and vertically.

HORIZONTAL

static public HORIZONTAL:Number
Resize the component horizontally but not vertically.

VERTICAL

static public VERTICAL:Number
Resize the component vertically but not horizontally.

CENTER

static public CENTER:Number
Put the component in the center of its display area.

NORTH

static public NORTH:Number
Put the component at the top of its display area, centered horizontally.

NORTHEAST

static public NORTHEAST:Number
Put the component at the top-right corner of its display area.

EAST

static public EAST:Number
Put the component on the right side of its display area, centered vertically.

SOUTHEAST

static public SOUTHEAST:Number
Put the component at the bottom-right corner of its display area.

SOUTH

static public SOUTH:Number
Put the component at the bottom of its display area, centered horizontally.

SOUTHWEST

static public SOUTHWEST:Number
Put the component at the bottom-left corner of its display area.

WEST

static public WEST:Number
Put the component on the left side of its display area, centered vertically.

NORTHWEST

static public NORTHWEST:Number
Put the component at the top-left corner of its display area.

gridx

public gridx:Number
Specifies the cell containing the leading edge of the component's display area, where the first cell in a row has gridx=0. The leading edge of a component's display area is its left edge for a horizontal, left-to-right container and its right edge for a horizontal, right-to-left container. The value RELATIVE specifies that the component be placed immediately following the component that was added to the container just before this component was added.

The default value is RELATIVE. gridx should be a non-negative value.

See Also

gridy

public gridy:Number
Specifies the cell at the top of the component's display area, where the topmost cell has gridy=0. The value RELATIVE specifies that the component be placed just below the component that was added to the container just before this component was added.

The default value is RELATIVE. gridy should be a non-negative value.

See Also

gridwidth

public gridwidth:Number
Specifies the number of cells in a row for the component's display area.

Use REMAINDER to specify that the component be the last one in its row. Use RELATIVE to specify that the component be the next-to-last one in its row.

gridwidth should be non-negative and the default value is 1.

See Also

gridheight

public gridheight:Number
Specifies the number of cells in a column for the component's display area.

Use REMAINDER to specify that the component be the last one in its column. Use RELATIVE to specify that the component be the next-to-last one in its column.

gridheight should be a non-negative value and the default value is 1.

See Also

weightx

public weightx:Number
Specifies how to distribute extra horizontal space.

The grid bag layout manager calculates the weight of a column to be the maximum weightx of all the components in a column. If the resulting layout is smaller horizontally than the area it needs to fill, the extra space is distributed to each column in proportion to its weight. A column that has a weight of zero receives no extra space.

If all the weights are zero, all the extra space appears between the grids of the cell and the left and right edges.

The default value of this field is 0. weightx should be a non-negative value.

See Also

weighty

public weighty:Number
Specifies how to distribute extra vertical space.

The grid bag layout manager calculates the weight of a row to be the maximum weighty of all the components in a row. If the resulting layout is smaller vertically than the area it needs to fill, the extra space is distributed to each row in proportion to its weight. A row that has a weight of zero receives no extra space.

If all the weights are zero, all the extra space appears between the grids of the cell and the top and bottom edges.

The default value of this field is 0. weighty should be a non-negative value.

See Also

anchor

public anchor:Number
This field is used when the component is smaller than its display area. It determines where, within the display area, to place the component. The default value is CENTER.

See Also

  • org.aswing.ComponentOrientation

fill

public fill:Number
This field is used when the component's display area is larger than the component's requested size. It determines whether to resize the component, and if so, how.

The following values are valid for fill:

  • NONE: Do not resize the component.
  • HORIZONTAL: Make the component wide enough to fill its display area horizontally, but do not change its height.
  • VERTICAL: Make the component tall enough to fill its display area vertically, but do not change its width.
  • BOTH: Make the component fill its display area entirely.

The default value is NONE.

insets

public insets:Insets
This field specifies the external padding of the component, the minimum amount of space between the component and the edges of its display area.

The default value is new Insets(0, 0, 0, 0).

ipadx

public ipadx:Number
This field specifies the internal padding of the component, how much space to add to the minimum width of the component. The width of the component is at least its minimum width plus (ipadx * 2) pixels.

The default value is 0.

See Also

ipady

public ipady:Number
This field specifies the internal padding, that is, how much space to add to the minimum height of the component. The height of the component is at least its minimum height plus (ipady * 2) pixels.

The default value is 0.

See Also

Method Detail

clone

public function clone():GridBagConstraints