|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.GridLayout | +--com.klg.jclass.util.swing.JCGridLayout
JCGridLayout
is an improved subclass of GridLayout
.
It lays out a grid of rows and columns based on the attributes of the
individual rows and columns. Whereas GridLayout
uses
the widest and tallest child to size each cell, JCGridLayout
uses the widest element in a column to set the width of that
column, and the tallest element in a row to set the height of that row.
Field Summary | |
protected int[] |
col_widths
Array of column widths. |
protected int |
cols
The number of columns in the layout, as set by the user. |
protected int |
hgap
The horiztonal gap between items. |
protected int[] |
row_heights
Array of row heights. |
protected int |
rows
The number of rows in the layout, as set by the user. |
static int |
VARIABLE
|
protected int |
vgap
The vertical gap between items. |
Constructor Summary | |
JCGridLayout(int rows,
int cols)
Creates a grid layout with the specified number of rows and columns. |
|
JCGridLayout(int rows,
int cols,
int hgap,
int vgap)
Creates a grid layout with the specified rows, columns, horizontal gap, and vertical gap. |
Method Summary | |
protected void |
getGridSizes(Container parent,
boolean min)
Traverses the children and determines row heights and column widths. |
void |
layoutContainer(Container parent)
Performs the layout of the children. |
Dimension |
minimumLayoutSize(Container parent)
Returns the minimum dimensions needed to layout the components contained in the specified panel. |
Dimension |
preferredLayoutSize(Container parent)
Calculates the preferred size for this layout. |
protected void |
setBounds(int pos,
int row,
int col,
Component comp,
int x,
int y,
int w,
int h)
Positions the component. |
Methods inherited from class java.awt.GridLayout |
addLayoutComponent, getColumns, getHgap, getRows, getVgap, removeLayoutComponent, setColumns, setHgap, setRows, setVgap, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int hgap
protected int vgap
protected int rows
protected int cols
protected int[] row_heights
getGridSizes()
.
protected int[] col_widths
getGridSizes()
.
public static final int VARIABLE
Constructor Detail |
public JCGridLayout(int rows, int cols)
rows
- the number of rows in the layoutcols
- the number of columns in the layoutpublic JCGridLayout(int rows, int cols, int hgap, int vgap)
rows
- the rows; VARIABLE (0) means 'any number.'
Only one of 'rows' and 'cols' can be VARIABLE, not both.cols
- the columns; VARIABLE (0) means 'any number.'
Only one of 'rows' and 'cols' can be VARIABLE, not both.hgap
- the horizontal gap variablevgap
- the vertical gap variable
IllegalArgumentException
- If the rows and columns are invalid.Method Detail |
protected void getGridSizes(Container parent, boolean min)
parent
- the component which needs to be laid outmin
- if true
, the minimum size is used; otherwise, the
preferred size is usedpublic Dimension preferredLayoutSize(Container parent)
preferredLayoutSize
in interface LayoutManager
preferredLayoutSize
in class GridLayout
parent
- the component which needs to be laid out
public Dimension minimumLayoutSize(Container parent)
minimumLayoutSize
in interface LayoutManager
minimumLayoutSize
in class GridLayout
parent
- the component which needs to be laid out
protected void setBounds(int pos, int row, int col, Component comp, int x, int y, int w, int h)
pos
- the component's index in its parents child listrow
- component's position (row)col
- component's position (column)comp
- h
- w
- x
- y
- public void layoutContainer(Container parent)
layoutContainer
in interface LayoutManager
layoutContainer
in class GridLayout
parent
- the specified component being laid out
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |