|
JComponentPack 1.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.zfqjava.swing.GridLayout2
public class GridLayout2
GridLayout2 provides a layout and it's behavior as
same as java.awt.GridLayout, but it has features to
use component preferrred size and minimum size.
| Constructor Summary | |
|---|---|
GridLayout2()
Creates a grid layout with a default of one column per component, in a single row. |
|
GridLayout2(int rows,
int cols)
Creates a grid layout with the specified number of rows and columns. |
|
GridLayout2(int rows,
int cols,
int hgap,
int vgap)
Creates a grid layout with the specified number of rows and columns. |
|
| Method Summary | |
|---|---|
void |
addLayoutComponent(Component comp,
Object constraints)
Adds the specified component to the layout, using the specified constraint object. |
void |
addLayoutComponent(String name,
Component comp)
If the layout manager uses a per-component string, adds the component comp to the layout,
associating it
with the string specified by name. |
int |
getColumns()
Gets the number of columns in this layout. |
int |
getHgap()
Gets the horizontal gap between components. |
float |
getLayoutAlignmentX(Container parent)
Returns the alignment along the x axis. |
float |
getLayoutAlignmentY(Container parent)
Returns the alignment along the y axis. |
int |
getRows()
Gets the number of rows in this layout. |
int |
getVgap()
Gets the vertical gap between components. |
void |
invalidateLayout(Container parent)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded. |
void |
layoutContainer(Container parent)
Lays out the specified container. |
Dimension |
maximumLayoutSize(Container parent)
Calculates the maximum size dimensions for the specified container, given the components it contains. |
Dimension |
minimumLayoutSize(Container parent)
Calculates the minimum size dimensions for the specified container, given the components it contains. |
Dimension |
preferredLayoutSize(Container parent)
Calculates the preferred size dimensions for the specified container, given the components it contains. |
void |
removeLayoutComponent(Component comp)
Removes the specified component from the layout. |
void |
setColumns(int cols)
Sets the number of columns in this layout to the specified value. |
void |
setHgap(int hgap)
Sets the horizontal gap between components to the specified value. |
void |
setRows(int rows)
Sets the number of rows in this layout to the specified value. |
void |
setVgap(int vgap)
Sets the vertical gap between components to the specified value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GridLayout2()
public GridLayout2(int rows,
int cols)
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.
rows - the rows, with the value zero meaning
any number of rows.cols - the columns, with the value zero meaning
any number of columns.
public GridLayout2(int rows,
int cols,
int hgap,
int vgap)
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.
rows - the rows, with the value zero meaning
any number of rowscols - the columns, with the value zero meaning
any number of columnshgap - the horizontal gapvgap - the vertical gap
IllegalArgumentException - if the value of both
rows and cols is
set to zero| Method Detail |
|---|
public int getRows()
public void setRows(int rows)
rows - the number of rows in this layout
IllegalArgumentException - if the value of both
rows and cols is set to zeropublic int getColumns()
public void setColumns(int cols)
cols - the number of columns in this layout
IllegalArgumentException - if the value of both
rows and cols is set to zeropublic int getHgap()
public void setHgap(int hgap)
hgap - the horizontal gap between componentspublic int getVgap()
public void setVgap(int vgap)
vgap - the vertical gap between components
public void addLayoutComponent(String name,
Component comp)
comp to the layout,
associating it
with the string specified by name.
addLayoutComponent in interface LayoutManagername - the string to be associated with the componentcomp - the component to be added
public void addLayoutComponent(Component comp,
Object constraints)
addLayoutComponent in interface LayoutManager2comp - the component to be addedconstraints - where/how the component is added to the layout.public void removeLayoutComponent(Component comp)
removeLayoutComponent in interface LayoutManagercomp - the component to be removedpublic Dimension preferredLayoutSize(Container parent)
preferredLayoutSize in interface LayoutManagerparent - the container to be laid outminimumLayoutSize(java.awt.Container)public Dimension minimumLayoutSize(Container parent)
minimumLayoutSize in interface LayoutManagerparent - the component to be laid outpreferredLayoutSize(java.awt.Container)public Dimension maximumLayoutSize(Container parent)
maximumLayoutSize in interface LayoutManager2Component.getMaximumSize(),
LayoutManagerpublic void layoutContainer(Container parent)
layoutContainer in interface LayoutManagerparent - the container to be laid outpublic void invalidateLayout(Container parent)
invalidateLayout in interface LayoutManager2public float getLayoutAlignmentX(Container parent)
getLayoutAlignmentX in interface LayoutManager2public float getLayoutAlignmentY(Container parent)
getLayoutAlignmentY in interface LayoutManager2
|
JComponentPack 1.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||