Groovy Documentation

simplejpa.swing
[Java] Class WrapLayout

java.lang.Object
  java.awt.FlowLayout
      simplejpa.swing.WrapLayout

public class WrapLayout
extends FlowLayout

FlowLayout subclass that fully supports wrapping of components.


Field Summary
private Dimension preferredLayoutSize

 
Fields inherited from class FlowLayout
LEFT, CENTER, RIGHT, LEADING, TRAILING
 
Constructor Summary
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.

 
Method Summary
private void addRow(Dimension dim, int rowWidth, int rowHeight)

void layoutContainer(Container target)

Layout the components in the Container using the layout logic of the parent FlowLayout class.

private Dimension layoutSize(Container target, boolean preferred)

Returns the minimum or preferred dimension needed to layout the target container.

Dimension minimumLayoutSize(Container target)

Returns the minimum dimensions needed to layout the visible components contained in the specified target container.

Dimension preferredLayoutSize(Container target)

Returns the preferred dimensions for this layout given the visible components in the specified target container.

 
Methods inherited from class FlowLayout
toString, addLayoutComponent, layoutContainer, minimumLayoutSize, preferredLayoutSize, removeLayoutComponent, getAlignment, setAlignment, getHgap, getVgap, setHgap, setVgap, getAlignOnBaseline, setAlignOnBaseline, getClass, hashCode, equals, notify, notifyAll, wait, wait, wait
 
Methods inherited from class Object
getClass, hashCode, equals, toString, notify, notifyAll, wait, wait, wait
 

Field Detail

preferredLayoutSize

private Dimension preferredLayoutSize


 
Constructor Detail

WrapLayout

public WrapLayout()
Constructs a new WrapLayout with a left alignment and a default 5-unit horizontal and vertical gap.


WrapLayout

public WrapLayout(int align)
Constructs a new 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.
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, or WrapLayout.

Parameters:
align - the alignment value
hgap - the horizontal gap between components
vgap - the vertical gap between components


 
Method Detail

addRow

private void addRow(Dimension dim, int rowWidth, int rowHeight)


layoutContainer

@Override
public void layoutContainer(Container target)
Layout the components in the Container using the layout logic of the parent FlowLayout class.
Parameters:
target - the Container using this WrapLayout


layoutSize

private Dimension layoutSize(Container target, boolean preferred)
Returns the minimum or preferred dimension needed to layout the target container.
Parameters:
target - target to get layout size for
preferred - should preferred size be calculated
Returns:
the dimension to layout the target container


minimumLayoutSize

@Override
public Dimension minimumLayoutSize(Container target)
Returns the minimum dimensions needed to layout the visible components contained in the specified target container.
Parameters:
target - the component which needs to be laid out
Returns:
the minimum dimensions to lay out the subcomponents of the specified container


preferredLayoutSize

@Override
public Dimension preferredLayoutSize(Container target)
Returns the preferred dimensions for this layout given the visible components in the specified target container.
Parameters:
target - the component which needs to be laid out
Returns:
the preferred dimensions to lay out the subcomponents of the specified container


 

Groovy Documentation