Package org.jdesktop.swingx
Class WrapLayout
- java.lang.Object
-
- java.awt.FlowLayout
-
- org.jdesktop.swingx.WrapLayout
-
- All Implemented Interfaces:
java.awt.LayoutManager
,java.io.Serializable
public class WrapLayout extends java.awt.FlowLayout
FlowLayout subclass that fully supports wrapping of components.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description WrapLayout()
Constructs a newWrapLayout
with a left alignment and a default 5-unit horizontal and vertical gap.WrapLayout(int align)
Constructs a newFlowLayout
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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WrapLayout
public WrapLayout()
Constructs a newWrapLayout
with a left alignment and a default 5-unit horizontal and vertical gap.
-
WrapLayout
public WrapLayout(int align)
Constructs a newFlowLayout
with the specified alignment and a default 5-unit horizontal and vertical gap. The value of the alignment argument must be one ofWrapLayout
,WrapLayout
, orWrapLayout
.- Parameters:
align
- the alignment value
-
WrapLayout
public WrapLayout(int align, int hgap, int vgap)
Creates a new flow layout manager with the indicated alignment and the indicated horizontal and vertical gaps.The value of the alignment argument must be one of
WrapLayout
,WrapLayout
, orWrapLayout
.- Parameters:
align
- the alignment valuehgap
- the horizontal gap between componentsvgap
- the vertical gap between components
-
-
Method Detail
-
preferredLayoutSize
public java.awt.Dimension preferredLayoutSize(java.awt.Container target)
Returns the preferred dimensions for this layout given the visible components in the specified target container.- Specified by:
preferredLayoutSize
in interfacejava.awt.LayoutManager
- Overrides:
preferredLayoutSize
in classjava.awt.FlowLayout
- Parameters:
target
- the component which needs to be laid out- Returns:
- the preferred dimensions to lay out the subcomponents of the specified container
-
minimumLayoutSize
public java.awt.Dimension minimumLayoutSize(java.awt.Container target)
Returns the minimum dimensions needed to layout the visible components contained in the specified target container.- Specified by:
minimumLayoutSize
in interfacejava.awt.LayoutManager
- Overrides:
minimumLayoutSize
in classjava.awt.FlowLayout
- Parameters:
target
- the component which needs to be laid out- Returns:
- the minimum dimensions to lay out the subcomponents of the specified container
-
layoutSize
private java.awt.Dimension layoutSize(java.awt.Container target, boolean preferred)
Returns the minimum or preferred dimension needed to layout the target container.- Parameters:
target
- target to get layout size forpreferred
- should preferred size be calculated- Returns:
- the dimension to layout the target container
-
addRow
private void addRow(java.awt.Dimension dim, int rowWidth, int rowHeight)
-
-