|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.argouml.swingext.GridLayout2
Same as the standard java class GridLayout but allows more flexability for sizing of columns and rows.
Field Summary | |
---|---|
static int |
BOTH
Resize all child components to fit their cell both horizontally and vertically. |
static int |
CENTER
Put the component in the center of its display area. |
protected int[] |
colWidth
The required cell width of each column |
static int |
EAST
Put the component on the right side of its display area, centered vertically. |
static int |
FITPARENT
Size all cells as the same width and height to fit the parent component. |
static int |
HORIZONTAL
Resize all child components to fit their cell horizontally but not vertically. |
protected int |
largestHeight
The height of the child component with the largest height |
protected int |
largestWidth
The width of the child component with the largest width |
static int |
MAXPREFERRED
Size all cells as the largest prefered width and height component. |
static int |
NONE
Do not resize the child components. |
static int |
NORTH
Put the component at the top of its display area, centered horizontally. |
static int |
NORTHEAST
Put the component at the top-right corner of its display area. |
static int |
NORTHWEST
Put each component in the top-left corner of its display area. |
static int |
ROWCOLPREFERRED
Size all cells so that all in the same row are the same height and all in the same column are the same width. |
protected int[] |
rowHeight
The required cell height of each row |
static int |
SOUTH
Put the component at the bottom of its display area, centered horizontally. |
static int |
SOUTHEAST
Put the component at the bottom-right corner of its display area. |
static int |
SOUTHWEST
Put the component at the bottom-left corner of its display area. |
static int |
VERTICAL
Resize all child components to fit their cell vertically but not horizontally. |
static int |
WEST
Put the component on the left side of its display area, centered vertically. |
Constructor Summary | |
---|---|
GridLayout2()
Construct a new GridLayout2 with a default of one column per component, in a single row. |
|
GridLayout2(int rows,
int cols)
Construct a new GridLayout2 with the specified number of rows and columns. |
|
GridLayout2(int rows,
int cols,
int cellSizing)
Construct a new GridLayout2 with the specified number of rows and columns and cell sizing scheme. |
|
GridLayout2(int rows,
int cols,
int hgap,
int vgap)
Construct a new GridLayout2 with the specified number of rows and columns and cell spacing. |
|
GridLayout2(int rows,
int cols,
int hgap,
int vgap,
int cellSizing)
Construct a new GridLayout2 with the specified number of rows and columns, cell spacing and cell sizing scheme. |
|
GridLayout2(int rows,
int cols,
int hgap,
int vgap,
int cellSizing,
int fill)
Construct a new GridLayout2 with the specified number of rows and columns, cell spacing, cell sizing scheme and filling scheme. |
|
GridLayout2(int rows,
int cols,
int hgap,
int vgap,
int cellSizing,
int fill,
int anchor)
Construct a new GridLayout2 with the specified number of rows and columns, cell spacing, cell sizing scheme and component sizing and anchoring scheme. |
Method Summary | |
---|---|
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp)
Adds the specified component with the specified name to the layout. |
protected java.awt.Dimension |
calculateSizes(java.awt.Container parent,
int[] colWidth,
int[] rowHeight,
int actualRows,
int actualCols,
int largestWidth,
int largestHeight)
|
int |
getColumns()
|
protected int |
getComponentCellHeight(int row)
|
protected int |
getComponentCellWidth(int col)
|
int |
getHgap()
|
int |
getRows()
|
int |
getVgap()
|
void |
layoutContainer(java.awt.Container parent)
|
java.awt.Dimension |
minimumLayoutSize(java.awt.Container parent)
|
protected void |
positionComponentInCell(java.awt.Component comp,
int x,
int y,
int cellWidth,
int cellHeight)
|
java.awt.Dimension |
preferredLayoutSize(java.awt.Container parent)
Determines the preferred size of the container argument using this grid layout. |
void |
removeLayoutComponent(java.awt.Component comp)
Removes the specified component with the specified name from the layout. |
void |
setCols(int cols)
|
void |
setHgap(int hgap)
|
void |
setRows(int rows)
|
void |
setVgap(int vgap)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NONE
public static final int BOTH
public static final int HORIZONTAL
public static final int VERTICAL
public static final int CENTER
public static final int NORTH
public static final int NORTHEAST
public static final int EAST
public static final int SOUTHEAST
public static final int SOUTH
public static final int SOUTHWEST
public static final int WEST
public static final int NORTHWEST
public static final int MAXPREFERRED
A possible value for the cellSizing parameter of the constructor in order to size cells so that each have the same width and height. The width is the largest prefered width and the height is the largest prefered height of all these child components.
public static final int ROWCOLPREFERRED
A possible value for the cellSizing parameter of the constructor. The width is the largest prefered width of all components in the same column and the height is the largest prefered height of all components in the same row.
public static final int FITPARENT
A possible value for the cellSizing parameter of the constructor in order to size cells so that each has the same height and width and are sized to fit their parent. This emulates the sizing done by a standard GridLayout.
protected int largestHeight
protected int largestWidth
protected int[] colWidth
protected int[] rowHeight
Constructor Detail |
public GridLayout2()
public GridLayout2(int rows, int cols)
rows
- the number of rows in the layoutcols
- the number of columns in the layoutpublic GridLayout2(int rows, int cols, int hgap, int vgap)
rows
- the number of rows in the layoutcols
- the number of columns in the layouthgap
- the horizontal gap between cellsvgap
- the vertical gap between cellspublic GridLayout2(int rows, int cols, int cellSizing)
rows
- the number of rows in the layoutcols
- the number of columns in the layoutcellSizing
- the required cell sizing schemepublic GridLayout2(int rows, int cols, int hgap, int vgap, int cellSizing)
rows
- the number of rows in the layoutcols
- the number of columns in the layouthgap
- the horizontal gap between cellsvgap
- the vertical gap between cellscellSizing
- the required cell sizing schemepublic GridLayout2(int rows, int cols, int hgap, int vgap, int cellSizing, int fill)
rows
- the number of rows in the layoutcols
- the number of columns in the layouthgap
- the horizontal gap between cellsvgap
- the vertical gap between cellscellSizing
- the required cell sizing schemefill
- the required cell filling schemepublic GridLayout2(int rows, int cols, int hgap, int vgap, int cellSizing, int fill, int anchor)
rows
- the number of rows in the layoutcols
- the number of columns in the layouthgap
- the horizontal gap between cellsvgap
- the vertical gap between cellscellSizing
- the required cell sizing schemefill
- the required cell filling schemeanchor
- the required anchoring of a child component within its cellMethod Detail |
public void addLayoutComponent(java.lang.String name, java.awt.Component comp)
addLayoutComponent
in interface java.awt.LayoutManager
name
- the name of the componentcomp
- the component to be addedpublic void removeLayoutComponent(java.awt.Component comp)
removeLayoutComponent
in interface java.awt.LayoutManager
public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
MAXPREFERRED and FITPARENT use the same formula to calculate prefered size.
The prefered width using MAXPREFERRED or FITPARENT is the largest preferred width of any of the widths in the container times the number of columns, plus the horizontal padding times the number of columns plus one, plus the left and right insets of the target container.
The preferred height using MAXPREFERRED or FITPARENT is the largest preferred height of any of the heights in the container times the number of rows, plus the vertical padding times the number of rows plus one, plus the top and bottom insets of the target container.
The prefered width using ROWCOLPREFERRED is the largest preferred is the sum of the widths of of all columns, plus the horizontal padding times the number of columns plus one, plus the left and right insets of the target container.
The prefered height using ROWCOLPREFERRED is the largest preferred is the sum of the heights of of all columns, plus the horizontal padding times the number of columns plus one, plus the left and right insets of the target container.
preferredLayoutSize
in interface java.awt.LayoutManager
parent
- the container to be laid out
public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
minimumLayoutSize
in interface java.awt.LayoutManager
public void layoutContainer(java.awt.Container parent)
layoutContainer
in interface java.awt.LayoutManager
protected java.awt.Dimension calculateSizes(java.awt.Container parent, int[] colWidth, int[] rowHeight, int actualRows, int actualCols, int largestWidth, int largestHeight)
protected int getComponentCellHeight(int row)
protected int getComponentCellWidth(int col)
protected void positionComponentInCell(java.awt.Component comp, int x, int y, int cellWidth, int cellHeight)
public int getRows()
public void setRows(int rows)
public int getColumns()
public void setCols(int cols)
public int getHgap()
public void setHgap(int hgap)
public int getVgap()
public void setVgap(int vgap)
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2003 (20040216) | ArgoUML Project Home | ArgoUML Cookbook |