public class IlvGridFlowLayout extends GridLayout implements SwingConstants
IlvGridFlowLayout
is an extension of GridLayout
that lays out the
components of a container in a rectangular grid. The container is divided into equal-sized
rectangles and one component is placed in each rectangle. The class IlvGridFlowLayout
automatically computes the number of rows and columns by first making the components flow
along either the horizontal or vertical axis. When no more components will fit along
the flow axis, the layout adds grid cells along the orthogonal axis as needed to
accommodate the overflow components.
The fact that IlvGridFlowLayout
has a preferred flow axis means that panels
using this layout work better in certain contexts than others. For example, a panel
with a horizontal IlvGridFlowLayout
will layout nicely when the panel is
placed in the north or south areas of a BorderLayout
. A panel with the same
layout will layout less nicely when it is placed in the east or west areas of a
BorderLayout
. Conversely, a panel with a vertical
IlvGridFlowLayout
will layout nicely when the panel is placed in the east or
west areas of a BorderLayout
, but will layout less nicely when placed in
the north or south areas of a BorderLayout
.BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
Constructor and Description |
---|
IlvGridFlowLayout(int flowDirection)
Creates a grid layout that automatically computes the number of rows and columns by
making components flow along the specified direction until no more components fit.
|
IlvGridFlowLayout(int flowDirection,
int hgap,
int vgap)
Creates a grid layout that automatically computes the number of rows and columns by
making components flow along the specified direction until no more components fit.
|
Modifier and Type | Method and Description |
---|---|
void |
layoutContainer(Container container)
Lays out the specified container using this layout.
|
Dimension |
minimumLayoutSize(Container container)
Determines the minimum size of the container argument using this grid layout.
|
Dimension |
preferredLayoutSize(Container container)
Determines the preferred size of the container argument using this layout.
|
addLayoutComponent, getColumns, getHgap, getRows, getVgap, removeLayoutComponent, setColumns, setHgap, setRows, setVgap, toString
public IlvGridFlowLayout(int flowDirection)
flowDirection
- The layout flow direction. The value must be one of the Swing
constants SwingConstants.HORIZONTAL
or SwingConstants.VERTICAL
.public IlvGridFlowLayout(int flowDirection, int hgap, int vgap)
flowDirection
- The layout flow direction. The value must be one of the Swing
constants SwingConstants.HORIZONTAL
or SwingConstants.VERTICAL
.hgap
- The horizontal gap placed between each grid column.vgap
- The vertical gap placed between each grid row.public void layoutContainer(Container container)
layoutContainer
in interface LayoutManager
layoutContainer
in class GridLayout
container
- The container in which to do the layout.public Dimension preferredLayoutSize(Container container)
preferredLayoutSize
in interface LayoutManager
preferredLayoutSize
in class GridLayout
container
- The container in which to do the layout.public Dimension minimumLayoutSize(Container container)
minimumLayoutSize
in interface LayoutManager
minimumLayoutSize
in class GridLayout
container
- The container in which to do the layout.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.