public class

OrientableFlowLayout

extends FlowLayout
java.lang.Object
   ↳ java.awt.FlowLayout
     ↳ sun.awt.OrientableFlowLayout

Class Overview

Extends the FlowLayout class to support both vertical and horizontal layout of components. Orientation can be changed dynamically after creation by calling either of the methods @method orientHorizontally or

Summary

Constants
int BOTTOM The bottom vertical alignment constant.
int HORIZONTAL The horizontal orientation constant.
int TOP The top vertical alignment constant.
int VERTICAL The vertical orientation constant.
[Expand]
Inherited Constants
From class java.awt.FlowLayout
Public Constructors
OrientableFlowLayout()
Constructs a new flow layout with a horizontal orientation and centered alignment.
OrientableFlowLayout(int orientation)
Constructs a new flow layout with the specified orientation and a centered alignment.
OrientableFlowLayout(int orientation, int hAlign, int vAlign)
Constructs a new flow layout with the specified orientation and alignment.
OrientableFlowLayout(int orientation, int hAlign, int vAlign, int hHGap, int hVGap, int vHGap, int vVGap)
Constructs a new flow layout with the specified orientation, alignment, and gap values.
Public Methods
void layoutContainer(Container target)
Lays out the container.
Dimension minimumLayoutSize(Container target)
Returns the minimum dimensions needed to layout the components contained in the specified target container.
synchronized void orientHorizontally()
Set the layout's current orientation to horizontal.
synchronized void orientVertically()
Set the layout's current orientation to vertical.
Dimension preferredLayoutSize(Container target)
Returns the preferred dimensions for this layout given the components in the specified target container.
String toString()
Returns the String representation of this layout's values.
[Expand]
Inherited Methods
From class java.awt.FlowLayout
From class java.lang.Object
From interface java.awt.LayoutManager

Constants

public static final int BOTTOM

The bottom vertical alignment constant.

Constant Value: 2 (0x00000002)

public static final int HORIZONTAL

The horizontal orientation constant.

Constant Value: 0 (0x00000000)

public static final int TOP

The top vertical alignment constant.

Constant Value: 0 (0x00000000)

public static final int VERTICAL

The vertical orientation constant.

Constant Value: 1 (0x00000001)

Public Constructors

public OrientableFlowLayout ()

Constructs a new flow layout with a horizontal orientation and centered alignment.

public OrientableFlowLayout (int orientation)

Constructs a new flow layout with the specified orientation and a centered alignment.

Parameters
orientation the orientation, one of HORIZONTAL or VERTICAL.

public OrientableFlowLayout (int orientation, int hAlign, int vAlign)

Constructs a new flow layout with the specified orientation and alignment.

Parameters
orientation the orientation, one of HORIZONTAL or VERTICAL.
hAlign the horizontal alignment, one of LEFT, CENTER, or RIGHT.
vAlign the vertical alignment, one of TOP, CENTER, or BOTTOM.

public OrientableFlowLayout (int orientation, int hAlign, int vAlign, int hHGap, int hVGap, int vHGap, int vVGap)

Constructs a new flow layout with the specified orientation, alignment, and gap values.

Parameters
orientation the orientation, one of HORIZONTAL or VERTICAL.
hAlign the horizontal alignment, one of LEFT, CENTER, or RIGHT.
vAlign the vertical alignment, one of TOP, CENTER, or BOTTOM.
hHGap the horizontal gap between components in HORIZONTAL.
hVGap the vertical gap between components in HORIZONTAL.
vHGap the horizontal gap between components in VERTICAL.
vVGap the vertical gap between components in VERTICAL.

Public Methods

public void layoutContainer (Container target)

Lays out the container. This method will reshape the components in the target to satisfy the constraints of the layout.

Parameters
target the specified component being laid out.
See Also

public Dimension minimumLayoutSize (Container target)

Returns the minimum dimensions needed to layout the 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
See Also
  • #preferredLayoutSize.

public synchronized void orientHorizontally ()

Set the layout's current orientation to horizontal.

public synchronized void orientVertically ()

Set the layout's current orientation to vertical.

public Dimension preferredLayoutSize (Container target)

Returns the preferred dimensions for this layout given the 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

public String toString ()

Returns the String representation of this layout's values.

Returns
  • a string representation of this layout