public class GridLayout extends Layout
Constructor and Description |
---|
GridLayout(int rows,
int columns)
Creates a new instance of GridLayout with the given rows and columns
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Indicates whether some other object is "equal to" this one.
|
int |
getColumns() |
Dimension |
getPreferredSize(Container parent)
Returns the container preferred size
|
int |
getRows() |
boolean |
isAutoFit()
Auto fits columns/rows to available screen space
|
boolean |
isFillLastRow()
When set to true makes the grid layout fill the last row of the layout
entirely if the number of elements in that row is bigger.
|
void |
layoutContainer(Container parent)
Layout the given parent container children
|
boolean |
obscuresPotential(Container parent)
Some layout managers can obscure their child components in some cases this
returns true if the basic underpinnings are in place for that.
|
void |
setAutoFit(boolean autoFit)
Auto fits columns/rows to available screen space
|
void |
setFillLastRow(boolean fillLastRow)
When set to true makes the grid layout fill the last row of the layout
entirely if the number of elements in that row is bigger.
|
String |
toString()
Returns a string representation of the object.
|
addLayoutComponent, getComponentConstraint, hashCode, isConstraintTracking, isOverlapSupported, removeLayoutComponent
public GridLayout(int rows, int columns)
rows
- - number of rows.columns
- - number of columns.IllegalArgumentException
- if rows < 1 or columns < 1public void layoutContainer(Container parent)
Layout
layoutContainer
in class Layout
parent
- the given parent containerpublic Dimension getPreferredSize(Container parent)
Layout
getPreferredSize
in class Layout
parent
- the parent containerpublic String toString()
Object
public int getRows()
public int getColumns()
public boolean equals(Object o)
Object
public boolean isFillLastRow()
public void setFillLastRow(boolean fillLastRow)
fillLastRow
- the fillLastRow to setpublic boolean isAutoFit()
public void setAutoFit(boolean autoFit)
autoFit
- the autoFit to setpublic boolean obscuresPotential(Container parent)
Layout
obscuresPotential
in class Layout
parent
- parent container