DESY ACOP Beans Home

com.cosylab.gui.components.util
Class CosyUIElements.FillingGridLayout

java.lang.Object
  extended by java.awt.GridLayout
      extended by com.cosylab.gui.components.util.CosyUIElements.FillingGridLayout
All Implemented Interfaces:
java.awt.LayoutManager, java.io.Serializable
Enclosing class:
CosyUIElements

public static final class CosyUIElements.FillingGridLayout
extends java.awt.GridLayout

See Also:
Serialized Form

Constructor Summary
CosyUIElements.FillingGridLayout()
          Creates a grid layout with a default of one column per component, in a single row.
CosyUIElements.FillingGridLayout(int rows, int cols)
          Creates a grid layout with the specified number of rows and columns.
CosyUIElements.FillingGridLayout(int rows, int cols, int hgap, int vgap)
          Creates a grid layout with the specified number of rows and columns.
 
Method Summary
 void layoutContainer(java.awt.Container parent)
          Lays out the specified container using this layout.
 
Methods inherited from class java.awt.GridLayout
addLayoutComponent, getColumns, getHgap, getRows, getVgap, minimumLayoutSize, preferredLayoutSize, removeLayoutComponent, setColumns, setHgap, setRows, setVgap, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CosyUIElements.FillingGridLayout

public CosyUIElements.FillingGridLayout()
Creates a grid layout with a default of one column per component, in a single row.

Since:
JDK1.1

CosyUIElements.FillingGridLayout

public CosyUIElements.FillingGridLayout(int rows,
                                        int cols)
Creates a grid layout with the specified number of rows and columns. All components in the layout are given equal size.

One, but not both, of rows and cols can be zero, which means that any number of objects can be placed in a row or in a column.

Parameters:
rows - the rows, with the value zero meaning any number of rows.
cols - the columns, with the value zero meaning any number of columns.

CosyUIElements.FillingGridLayout

public CosyUIElements.FillingGridLayout(int rows,
                                        int cols,
                                        int hgap,
                                        int vgap)
Creates a grid layout with the specified number of rows and columns. All components in the layout are given equal size.

In addition, the horizontal and vertical gaps are set to the specified values. Horizontal gaps are placed at the left and right edges, and between each of the columns. Vertical gaps are placed at the top and bottom edges, and between each of the rows.

One, but not both, of rows and cols can be zero, which means that any number of objects can be placed in a row or in a column.

All GridLayout constructors defer to this one.

Parameters:
rows - the rows, with the value zero meaning any number of rows
cols - the columns, with the value zero meaning any number of columns
hgap - the horizontal gap
vgap - the vertical gap
Throws:
java.lang.IllegalArgumentException - if the value of both rows and cols is set to zero
Method Detail

layoutContainer

public void layoutContainer(java.awt.Container parent)
Lays out the specified container using this layout.

This method reshapes the components in the specified target container in order to satisfy the constraints of the GridLayout object.

The grid layout manager determines the size of individual components by dividing the free space in the container into equal-sized portions according to the number of rows and columns in the layout. The container's free space equals the container's size minus any insets and any specified horizontal or vertical gap. All components in a grid layout are given the same size.

Specified by:
layoutContainer in interface java.awt.LayoutManager
Overrides:
layoutContainer in class java.awt.GridLayout
Parameters:
target - the container in which to do the layout
See Also:
Container, Container.doLayout()


Copyright © 2010. All Rights Reserved.