API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.awt. GridBagLayout View Source
Author(s)
Doug Stein
Bill Spitzak (orignial NeWS & OLIT implementation)
Since
JDK1.0
Version
1.79, 05/12/06
Serial
Hierarchy
 Object
      GridBagLayout
Implements
 LayoutManager2
 Serializable
Subclasses
Description
public class GridBagLayout
  The GridBagLayout class is a flexible layout manager that aligns components vertically, horizontally or along their baseline without requiring that the components be of the same size.
Constructors
public GridBagLayout ()
Creates a grid bag layout manager.
Methods
Hide/Show inherited methods
public void addLayoutComponent (Component comp, Object constraints) [Specified in LayoutManager2]
  Adds the specified component to the layout, using the specified constraints object.
public void addLayoutComponent (String name, Component comp)
Has no effect, since this layout manager does not use a per-component string.
protected void adjustForGravity (GridBagConstraints constraints, Rectangle r)
  Adjusts the x, y, width, and height fields to the correct values depending on the constraint geometry and pads.
protected void AdjustForGravity (GridBagConstraints constraints, Rectangle r)
  This method is obsolete and supplied for backwards compatability only; new code should call adjustForGravity instead.
protected void arrangeGrid (Container parent)
  Lays out the grid.
protected void ArrangeGrid (Container parent)
  This method is obsolete and supplied for backwards compatability only; new code should call arrangeGrid instead.
public GridBagConstraints getConstraints (Component comp)
  Gets the constraints for the specified component.
public float getLayoutAlignmentX (Container parent) [Specified in LayoutManager2]
  Returns the alignment along the x axis.
public float getLayoutAlignmentY (Container parent) [Specified in LayoutManager2]
  Returns the alignment along the y axis.
public int getLayoutDimensions ()
  Determines column widths and row heights for the layout grid.
protected GridBagLayoutInfo getLayoutInfo (Container parent, int sizeflag)
  Fills in an instance of GridBagLayoutInfo for the current set of managed children.
protected GridBagLayoutInfo GetLayoutInfo (Container parent, int sizeflag)
  This method is obsolete and supplied for backwards compatability only; new code should call getLayoutInfo instead.
public Point getLayoutOrigin ()
  Determines the origin of the layout area, in the graphics coordinate space of the target container.
public double getLayoutWeights ()
  Determines the weights of the layout grid's columns and rows.
protected Dimension getMinSize (Container parent, GridBagLayoutInfo info)
  Figures out the minimum size of the master based on the information from getLayoutInfo.
protected Dimension GetMinSize (Container parent, GridBagLayoutInfo info)
  This method is obsolete and supplied for backwards compatability only; new code should call getMinSize instead.
public void invalidateLayout (Container target) [Specified in LayoutManager2]
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
public void layoutContainer (Container parent)
  Lays out the specified container using this grid bag layout.
public Point location (int x, int y)
  Determines which cell in the layout grid contains the point specified by (x, y).
protected GridBagConstraints lookupConstraints (Component comp)
  Retrieves the constraints for the specified component.
public Dimension maximumLayoutSize (Container target) [Specified in LayoutManager2]
  Returns the maximum dimensions for this layout given the components in the specified target container.
public Dimension minimumLayoutSize (Container parent)
  Determines the minimum size of the parent container using this grid bag layout.
public Dimension preferredLayoutSize (Container parent)
  Determines the preferred size of the parent container using this grid bag layout.
public void removeLayoutComponent (Component comp)
  Removes the specified component from this layout.
public void setConstraints (Component comp, GridBagConstraints constraints)
  Sets the constraints for the specified component in this layout.
public String toString ()
  Returns a string representation of this grid bag layout's values.
Fields
Hide/Show inherited fields
public double columnWeights
  This field holds the overrides to the column weights.
public int columnWidths
  This field holds the overrides to the column minimum width.
protected Hashtable<Component, GridBagConstraints> comptable
  This hashtable maintains the association between a component and its gridbag constraints.
protected GridBagConstraints defaultConstraints
  This field holds a gridbag constraints instance containing the default values, so if a component does not have gridbag constraints associated with it, then the component will be assigned a copy of the defaultConstraints.
pack-privatefinalstatic int EMPIRICMULTIPLIER = "2"
protected GridBagLayoutInfo layoutInfo
  This field holds the layout information for the gridbag.
protectedfinalstatic int MAXGRIDSIZE = "512"
  This field is no longer used to reserve arrays and keeped for backward compatibility.
protectedfinalstatic int MINSIZE = "1"
The smallest grid that can be laid out by the grid bag layout.
protectedfinalstatic int PREFERREDSIZE = "2"
The preferred grid size that can be laid out by the grid bag layout.
pack-privatetransient boolean rightToLeft
public int rowHeights
  This field holds the overrides to the row minimum heights.
public double rowWeights
  This field holds the overrides to the row weights.
pack-privatefinalstatic long serialVersionUID = "8838754796412211005"
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar