public class WrapLayout
extends java.awt.FlowLayout
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID |
Constructor and Description |
---|
WrapLayout()
Constructs a new
WrapLayout with a left
alignment and a default 5-unit horizontal and vertical gap. |
WrapLayout(int align)
Constructs a new
FlowLayout with the specified
alignment and a default 5-unit horizontal and vertical gap. |
WrapLayout(int align,
int hgap,
int vgap)
Creates a new flow layout manager with the indicated alignment
and the indicated horizontal and vertical gaps.
|
Modifier and Type | Method and Description |
---|---|
private void |
addRow(java.awt.Dimension dim,
int rowWidth,
int rowHeight) |
private java.awt.Dimension |
layoutSize(java.awt.Container target,
boolean preferred)
Returns the minimum or preferred dimension needed to layout the target
container.
|
java.awt.Dimension |
minimumLayoutSize(java.awt.Container target)
Returns the minimum dimensions needed to layout the visible
components contained in the specified target container.
|
java.awt.Dimension |
preferredLayoutSize(java.awt.Container target)
Returns the preferred dimensions for this layout given the
visible components in the specified target container.
|
private static final long serialVersionUID
public WrapLayout()
WrapLayout
with a left
alignment and a default 5-unit horizontal and vertical gap.public WrapLayout(int align)
FlowLayout
with the specified
alignment and a default 5-unit horizontal and vertical gap.
The value of the alignment argument must be one of
WrapLayout
, WrapLayout
,
or WrapLayout
.align
- the alignment valuepublic WrapLayout(int align, int hgap, int vgap)
The value of the alignment argument must be one of
WrapLayout
, WrapLayout
,
or WrapLayout
.
align
- the alignment valuehgap
- the horizontal gap between componentsvgap
- the vertical gap between componentspublic java.awt.Dimension preferredLayoutSize(java.awt.Container target)
preferredLayoutSize
in interface java.awt.LayoutManager
preferredLayoutSize
in class java.awt.FlowLayout
target
- the component which needs to be laid outpublic java.awt.Dimension minimumLayoutSize(java.awt.Container target)
minimumLayoutSize
in interface java.awt.LayoutManager
minimumLayoutSize
in class java.awt.FlowLayout
target
- the component which needs to be laid outprivate java.awt.Dimension layoutSize(java.awt.Container target, boolean preferred)
target
- target to get layout size forpreferred
- should preferred size be calculatedprivate void addRow(java.awt.Dimension dim, int rowWidth, int rowHeight)