Package org.jorigin.gui.layout
Class WrapLayout
- java.lang.Object
-
- java.awt.FlowLayout
-
- org.jorigin.gui.layout.WrapLayout
-
- All Implemented Interfaces:
java.awt.LayoutManager,java.io.Serializable
public class WrapLayout extends java.awt.FlowLayoutFlowLayoutsubclass that fully supports wrapping of components. This code was originally published by Rob Camick (http://tips4java.wordpress.com/)- Since:
- 1.0.8
- Version:
- 1.0.8
- Author:
- Rob Camick
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WrapLayout()Constructs a newWrapLayoutwith a left alignment and a default 5-unit horizontal and vertical gap.WrapLayout(int align)Constructs a newFlowLayoutwith 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 java.awt.DimensionminimumLayoutSize(java.awt.Container target)Returns the minimum dimensions needed to layout the visible components contained in the specified target container.java.awt.DimensionpreferredLayoutSize(java.awt.Container target)Returns the preferred dimensions for this layout given the visible components in the specified target container.
-
-
-
Constructor Detail
-
WrapLayout
public WrapLayout()
Constructs a newWrapLayoutwith a left alignment and a default 5-unit horizontal and vertical gap.
-
WrapLayout
public WrapLayout(int align)
Constructs a newFlowLayoutwith the specified alignment and a default 5-unit horizontal and vertical gap. The value of the alignment argument must be one ofFlowLayout.LEFT,FlowLayout.RIGHT,FlowLayout.CENTER,FlowLayout.LEADINGorFlowLayout.TRAILING- 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
FlowLayout.LEFT,FlowLayout.RIGHT,FlowLayout.CENTER,FlowLayout.LEADINGorFlowLayout.TRAILING- Parameters:
align- the alignment value.hgap- the horizontal gap between components.vgap- 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:
preferredLayoutSizein interfacejava.awt.LayoutManager- Overrides:
preferredLayoutSizein 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:
minimumLayoutSizein interfacejava.awt.LayoutManager- Overrides:
minimumLayoutSizein 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
-
-