public class FlowLayoutCorrectMinimumSize
extends java.awt.FlowLayout
FlowLayout
does
not claim the correct size but chooses the maximum width of all components to
render which is worthless as the fact of flow breaks is not taken into
account.
This class is inspired by the sun class
with modifications to the methods
FlowLayout
and
preferredLayoutSize(Container)
.
minimumLayoutSize(Container)
Constructor | Description |
---|---|
FlowLayoutCorrectMinimumSize(int align) |
Constructs a new
FlowLayout with the specified alignment and
a default 5-unit horizontal and vertical gap. |
FlowLayoutCorrectMinimumSize(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 | Description |
---|---|---|
void |
layoutContainer(java.awt.Container target) |
Lays out the 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.
|
public FlowLayoutCorrectMinimumSize(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 FlowLayout.LEFT
,
FlowLayout.RIGHT
, FlowLayout.CENTER
,
FlowLayout.LEADING
, or FlowLayout.TRAILING
.align
- the alignment valuepublic FlowLayoutCorrectMinimumSize(int align, int hgap, int vgap)
The value of the alignment argument must be one of
FlowLayout.LEFT
, FlowLayout.RIGHT
,
FlowLayout.CENTER
, FlowLayout.LEADING
, or
FlowLayout.TRAILING
.
align
- the alignment valuehgap
- the horizontal gap between components and between the components
and the borders of the Container
vgap
- the vertical gap between components and between the components
and the borders of the Container
public void layoutContainer(java.awt.Container target)
FlowLayout
object.layoutContainer
in class java.awt.FlowLayout
target
- the specified component being laid outContainer
,
Container.doLayout()
public java.awt.Dimension minimumLayoutSize(java.awt.Container target)
minimumLayoutSize
in class java.awt.FlowLayout
target
- the container that needs to be laid outpreferredLayoutSize(java.awt.Container)
,
Container
,
Container.doLayout()
public java.awt.Dimension preferredLayoutSize(java.awt.Container target)
preferredLayoutSize
in class java.awt.FlowLayout
target
- the container that needs to be laid outContainer
,
minimumLayoutSize(java.awt.Container)
,
Container.getPreferredSize()
Copyright © 2001 - 2010 LGPL, All Rights Footloose.