
 |
Chapter 19 java.awt Reference |
 |
GridBagLayout
Name
GridBagLayout
The GridBagLayout LayoutManager
provides the means to layout components in a flexible grid-based display
model.
Maximum number of rows and columns within container managed by GridBagLayout.
Used for internal sizing purposes.
Used for internal sizing purposes.
The weightx values of the components
in the row with the most elements.
The width values of the components
in the row with the most elements.
The height values of the components
in the column with the most elements.
The weighty values of the components
in the column with the most elements.
Internal table to manage components.
Constraints to use for Components
that have none.
Internal information about the GridBagLayout.
- Description
-
Constructs a GridBagLayout
object.
- Parameters
-
- comp
-
The component being
added.
- constraints
-
An object describing
the constraints on this component.
- Implements
-
LayoutManager2.addLayoutComponent()
- Description
-
Adds the component comp to
container subject to the given constraints.
This is a more generalized version of addLayoutComponent(String,
Component). It corresponds to java.awt.Container's
add(Component, Object).
- Parameters
-
- name
-
Name of component to
add.
- component
-
Actual component
being added.
- Implements
-
LayoutManager.addLayoutComponent()
- Description
-
Does nothing.
- Parameters
-
- component
-
Component whose
constraints are desired
- Returns
-
GridBagConstraints for component
requested.
- Parameters
-
- target
-
The container to inspect.
- Returns
-
The value .5 for all containers.
- Description
-
This method returns the preferred alignment of the given container target.
A return value of 0 is left aligned, .5 is centered, and 1 is right aligned.
- Parameters
-
- target
-
The container to inspect.
- Returns
-
The value .5 for all containers.
- Description
-
This method returns the preferred alignment of the given container target.
A return value of 0 is top aligned, .5 is centered, and 1 is bottom aligned.
- Returns
-
Returns two single dimension arrays as a multi-dimensional array. Index
0 is an array of widths (columnWidths
instance variable), while index 1 is an array of heights (rowHeights
instance variable).
- Returns
-
Returns the origin of the components within the Container
whose LayoutManager is GridBagLayout.
- Returns
-
Returns two single dimension arrays as a multi-dimensional array. Index
0 is an array of columns weights (columnWeights
instance variable), while index 1 is an array of row weights (rowWeights
instance variable).
- Parameters
-
- target
-
The container to invalidate.
- Description
-
Does nothing.
- Parameters
-
- target
-
The container that needs to be redrawn.
- Implements
-
LayoutManager.layoutContainer()
- Description
-
Draws components contained within target.
- Parameters
-
- x
-
The x coordinate of the
grid position to find.
- y
-
The y coordinate of the
grid position to find.
- Returns
-
Returns the grid element under the location provided at position (x,
y) in pixels. Note that the
returned Point uses the GridBagLayout's
grid for its coordinate space.
- Description
-
Locates the grid position in the Container
under the given location.
- Parameters
-
- target
-
The container to inspect.
- Returns
-
A Dimension whose horizontal
and vertical components are Integer.MAX_VALUE.
- Description
-
For GridBagLayout, a maximal
Dimension is always returned.
- Parameters
-
- target
-
The container whose
size needs to be calculated.
- Returns
-
Minimum Dimension of container
target.
- Implements
-
LayoutManager.minimumLayoutSize()
- Description
-
Calculates minimum size of target
container.
- Parameters
-
- target
-
The container whose
size needs to be calculated.
- Returns
-
Preferred Dimension of container
target
- Implements
-
LayoutManager.preferredLayoutSize()
- Description
-
Calculates preferred size of target
container.
- Parameters
-
- component
-
Component to stop tracking.
- Implements
-
LayoutManager.removeLayoutComponent()
- Description
-
Does nothing.
- Parameters
-
- component
-
Component to set constraints for
- constraints
-
Constraints for component
- Description
-
Changes the GridBagConstraints
on component to those provided.
- Returns
-
A string representation of the GridBagLayout
object.
- Overrides
-
Object.toString()
- Parameters
-
- constraints
-
Constraints to
use for adjustment of Rectangle.
- r
-
Rectangular area that needs
to be adjusted.
- Description
-
Helper routine for laying out a cell of the grid. The routine adjusts the
values for r based upon the
constraints.
- Parameters
-
- target
-
Container
to layout.
- Description
-
Helper routine that does the actual arrangement of components in target.
- Parameters
-
- target
-
Container
to get information about.
- sizeFlag
-
One of the constants
MINSIZE or PREFERREDSIZE.
- Returns
-
Returns an internal class used to help size the container.
- Parameters
-
- target
-
Container
to calculate size.
- info
-
Specifics about the
container's constraints.
- Returns
-
Minimum Dimension of container
target based on info.
- Description
-
Helper routine for calculating size of container.
- Parameters
-
- comp
-
Component
in question.
- Returns
-
A reference to the GridBagConstraints
object for this component.
- Description
-
Helper routine for calculating size of container.
Component, Container,
Dimension, GridBagConstraints,
Hashtable, LayoutManager,
LayoutManager2, Object,
Point, Rectangle,
String
|