info.aduna.swing
Class GridBagUtil

java.lang.Object
  extended by info.aduna.swing.GridBagUtil

public class GridBagUtil
extends Object

Facilitates the use of GridBagLayout.

See Also:
GridBagLayout, GridBagConstraints

Constructor Summary
GridBagUtil()
           
 
Method Summary
static void constrain(Container cont, Component comp, int grid_x, int grid_y, int grid_width, int grid_height)
          Constrain a component to a location and size in the specified container.
static void constrain(Container cont, Component comp, int grid_x, int grid_y, int grid_width, int grid_height, int fill, int anchor, double weight_x, double weight_y, int top, int left, int bottom, int right)
          Constrain a component in a container.
static void constrain(Container cont, Component comp, int grid_x, int grid_y, int grid_width, int grid_height, int top, int left, int bottom, int right)
          Constrain a component to a location and size in the specified container, also setting a certain amount of space around it.
static void constrain(Container cont, Component comp, Rectangle gridBounds, int fill, int anchor, Point2D.Double weight, Insets insets)
          Constrain a component in a container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridBagUtil

public GridBagUtil()
Method Detail

constrain

public static void constrain(Container cont,
                             Component comp,
                             int grid_x,
                             int grid_y,
                             int grid_width,
                             int grid_height)
Constrain a component to a location and size in the specified container.

Parameters:
cont - the container in which the component is to be constrained.
comp - the component to constrain.
grid_x - the x-coordinate of the component.
grid_y - the y-coordinate of the component.
grid_width - the width of the component.
grid_height - the height of the component.

constrain

public static void constrain(Container cont,
                             Component comp,
                             int grid_x,
                             int grid_y,
                             int grid_width,
                             int grid_height,
                             int top,
                             int left,
                             int bottom,
                             int right)
Constrain a component to a location and size in the specified container, also setting a certain amount of space around it.

Parameters:
cont - the container in which the component is to be constrained.
comp - the component to constrain.
grid_x - the x-coordinate of the component.
grid_y - the y-coordinate of the component.
grid_width - the width of the component.
grid_height - the height of the component.
top - the amount of space above the component (in pixels).
left - the amount of space to the left of the component (in pixels).
bottom - the amount of space below the component (in pixels).
right - the amount of space to the right of the component (in pixels).

constrain

public static void constrain(Container cont,
                             Component comp,
                             int grid_x,
                             int grid_y,
                             int grid_width,
                             int grid_height,
                             int fill,
                             int anchor,
                             double weight_x,
                             double weight_y,
                             int top,
                             int left,
                             int bottom,
                             int right)
Constrain a component in a container.

Parameters:
cont - the container in which the component is to be constrained.
comp - the component to constrain.
grid_x - the x-coordinate of the component.
grid_y - the y-coordinate of the component.
grid_width - the width of the component.
grid_height - the height of the component.
fill - how to fill out the component.
anchor - where to anchor the component.
weight_x - the x-weight of the component.
weight_y - the y-weight of the component.
top - the amount of space above the component (in pixels).
left - the amount of space to the left of the component (in pixels).
bottom - the amount of space below the component (in pixels).
right - the amount of space to the right of the component (in pixels).

constrain

public static void constrain(Container cont,
                             Component comp,
                             Rectangle gridBounds,
                             int fill,
                             int anchor,
                             Point2D.Double weight,
                             Insets insets)
Constrain a component in a container.

Parameters:
comp - The component to constrain.
gridBounds - The bounds of the component.
fill - how to fill out the component.
anchor - where to anchor the component.
weight - The weight where to anchor the component
insets - The amount of space in pixels around the component.


Copyright © 1997-2008 Aduna. All Rights Reserved.