java.awt

Class GridBagLayout

public class GridBagLayout extends Object implements Serializable, LayoutManager2

Field Summary
double[]columnWeights
int[]columnWidths
protected Hashtable<Component,GridBagConstraints>comptable
protected GridBagConstraintsdefaultConstraints
protected GridBagLayoutInfolayoutInfo
protected static intMAXGRIDSIZE
protected static intMINSIZE
protected static intPREFERREDSIZE
int[]rowHeights
double[]rowWeights
Constructor Summary
GridBagLayout()
Method Summary
protected voidAdjustForGravity(GridBagConstraints constraints, Rectangle r)
Move and resize a rectangle according to a set of grid bag constraints.
protected voidArrangeGrid(Container parent)
Obsolete.
voidaddLayoutComponent(String name, Component component)
voidaddLayoutComponent(Component component, Object constraints)
protected voidadjustForGravity(GridBagConstraints constraints, Rectangle r)
Move and resize a rectangle according to a set of grid bag constraints.
protected voidarrangeGrid(Container parent)
GridBagConstraintsgetConstraints(Component component)
floatgetLayoutAlignmentX(Container target)
floatgetLayoutAlignmentY(Container target)
int[][]getLayoutDimensions()
protected GridBagLayoutInfogetLayoutInfo(Container parent, int sizeflag)
PointgetLayoutOrigin()
double[][]getLayoutWeights()
protected DimensiongetMinSize(Container parent, GridBagLayoutInfo info)
protected GridBagLayoutInfoGetLayoutInfo(Container parent, int sizeflag)
Obsolete.
protected DimensionGetMinSize(Container parent, GridBagLayoutInfo info)
Obsolete.
voidinvalidateLayout(Container target)
voidlayoutContainer(Container parent)
Pointlocation(int x, int y)
protected GridBagConstraintslookupConstraints(Component component)
DimensionmaximumLayoutSize(Container target)
DimensionminimumLayoutSize(Container parent)
DimensionpreferredLayoutSize(Container parent)
voidremoveLayoutComponent(Component component)
voidsetConstraints(Component component, GridBagConstraints constraints)
StringtoString()
Return a string representation of this GridBagLayout.

Field Detail

columnWeights

public double[] columnWeights

columnWidths

public int[] columnWidths

comptable

protected Hashtable<Component,GridBagConstraints> comptable

defaultConstraints

protected GridBagConstraints defaultConstraints

layoutInfo

protected GridBagLayoutInfo layoutInfo

MAXGRIDSIZE

protected static final int MAXGRIDSIZE

MINSIZE

protected static final int MINSIZE

PREFERREDSIZE

protected static final int PREFERREDSIZE

rowHeights

public int[] rowHeights

rowWeights

public double[] rowWeights

Constructor Detail

GridBagLayout

public GridBagLayout()

Method Detail

AdjustForGravity

protected void AdjustForGravity(GridBagConstraints constraints, Rectangle r)
Move and resize a rectangle according to a set of grid bag constraints. The x, y, width and height fields of the rectangle argument are adjusted to the new values.

Parameters: constraints position and size constraints r rectangle to be moved and resized

ArrangeGrid

protected void ArrangeGrid(Container parent)
Obsolete.

addLayoutComponent

public void addLayoutComponent(String name, Component component)

addLayoutComponent

public void addLayoutComponent(Component component, Object constraints)

adjustForGravity

protected void adjustForGravity(GridBagConstraints constraints, Rectangle r)
Move and resize a rectangle according to a set of grid bag constraints. The x, y, width and height fields of the rectangle argument are adjusted to the new values.

Parameters: constraints position and size constraints r rectangle to be moved and resized

Since: 1.4

arrangeGrid

protected void arrangeGrid(Container parent)

Since: 1.4

getConstraints

public GridBagConstraints getConstraints(Component component)

getLayoutAlignmentX

public float getLayoutAlignmentX(Container target)

getLayoutAlignmentY

public float getLayoutAlignmentY(Container target)

getLayoutDimensions

public int[][] getLayoutDimensions()

Since: 1.1

getLayoutInfo

protected GridBagLayoutInfo getLayoutInfo(Container parent, int sizeflag)

Since: 1.4

getLayoutOrigin

public Point getLayoutOrigin()

Since: 1.1

getLayoutWeights

public double[][] getLayoutWeights()

getMinSize

protected Dimension getMinSize(Container parent, GridBagLayoutInfo info)

Since: 1.4

GetLayoutInfo

protected GridBagLayoutInfo GetLayoutInfo(Container parent, int sizeflag)
Obsolete.

GetMinSize

protected Dimension GetMinSize(Container parent, GridBagLayoutInfo info)
Obsolete.

invalidateLayout

public void invalidateLayout(Container target)

layoutContainer

public void layoutContainer(Container parent)

location

public Point location(int x, int y)

Since: 1.1

lookupConstraints

protected GridBagConstraints lookupConstraints(Component component)

maximumLayoutSize

public Dimension maximumLayoutSize(Container target)

minimumLayoutSize

public Dimension minimumLayoutSize(Container parent)

preferredLayoutSize

public Dimension preferredLayoutSize(Container parent)

removeLayoutComponent

public void removeLayoutComponent(Component component)

setConstraints

public void setConstraints(Component component, GridBagConstraints constraints)

toString

public String toString()
Return a string representation of this GridBagLayout.

Returns: a string representation