gov.lanl.Pids
Class GridbagLayoutHelper

java.lang.Object
  |
  +--gov.lanl.Pids.GridbagLayoutHelper

public final class GridbagLayoutHelper
extends java.lang.Object

The class GridbagLayoutHelper contains methods for performing Gridbag layout operations.

Version:
11/06/98 $Id: GridbagLayoutHelper.java,v 1.2 2002/06/08 17:38:35 dwforslund Exp $
Author:
Jim George, Torsten Staab

Method Summary
static int add1component(java.awt.Container cont, java.awt.Component c1, int yrow)
          adds one component stretches over 2 xgrids and returns the next row number
static int add2components(java.awt.Container cont, java.awt.Component c1, javax.swing.JComponent c2, int yrow)
          adds two components side-by-side in the row and returns the next row number
static int addcomponentinrow(java.awt.Container cont, java.awt.Component c1, int xcol, int yrow)
          adds a component in the row and returns the next col number
static void constrain(java.awt.Container container, java.awt.Component component, 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)
          adds component with constraints to the container
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

constrain

public static final void constrain(java.awt.Container container,
                                   java.awt.Component component,
                                   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)
adds component with constraints to the container

Parameters:
container - the container to which the component will be added
component - the component/widget which will be added to the container
grid_x - the x grid position of the component
grid_y - the y grid position of the component
grid_width - the width of the component in grid cells
grid_height - the height of the component in grid cells
fill - which dimensions of the component will grow
anchor - specifies how the component will be displayed if smaller than cells
weight_x - specifies how extra space in x will be distributed
weight_y - specifies how extra space in y will be distributed
top - the top margin
left - the left margin
bottom - the bottom margin
right - the right margin
See Also:
GridBagConstraints

add1component

public static final int add1component(java.awt.Container cont,
                                      java.awt.Component c1,
                                      int yrow)
adds one component stretches over 2 xgrids and returns the next row number

Parameters:
cont - the container to add the component to
c1 - the component to add
yrow - the ygrid row in which to add the component; xgrid is 0

add2components

public static final int add2components(java.awt.Container cont,
                                       java.awt.Component c1,
                                       javax.swing.JComponent c2,
                                       int yrow)
adds two components side-by-side in the row and returns the next row number

Parameters:
cont - the container to add the components to
c1 - left most component to add; at xgrid of 0
c2 - right most component to add; at xgrid of 1
yrow - the ygrid row in which to add the component

addcomponentinrow

public static final int addcomponentinrow(java.awt.Container cont,
                                          java.awt.Component c1,
                                          int xcol,
                                          int yrow)
adds a component in the row and returns the next col number

Parameters:
cont - the container to add the components to
c1 - left most component to add; at xgrid of 0
xcol - the xgrid col in which to add the component
yrow - the ygrid row in which to add the component


Copyright © 2000 University of California. All Rights Reserved.