Class FlowLayoutCorrectMinimumSize
- java.lang.Object
-
- java.awt.FlowLayout
-
- info.monitorenter.gui.chart.layouts.FlowLayoutCorrectMinimumSize
-
- All Implemented Interfaces:
java.awt.LayoutManager
,java.io.Serializable
public class FlowLayoutCorrectMinimumSize extends java.awt.FlowLayout
A flow layout that claims the correct height of the component managed in case the available width is known. The standard
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.FlowLayout
This class is inspired by the sun class
with modifications to the methodsFlowLayout
andpreferredLayoutSize(Container)
.minimumLayoutSize(Container)
- Version:
- $Revision: 1.13 $
- Author:
- Achim Westermann
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FlowLayoutCorrectMinimumSize(int align)
Constructs a newFlowLayout
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.
-
Method Summary
All Methods Instance Methods Concrete Methods 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.
-
-
-
Constructor Detail
-
FlowLayoutCorrectMinimumSize
public FlowLayoutCorrectMinimumSize(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 ofFlowLayout.LEFT
,FlowLayout.RIGHT
,FlowLayout.CENTER
,FlowLayout.LEADING
, orFlowLayout.TRAILING
.- Parameters:
align
- the alignment value
-
FlowLayoutCorrectMinimumSize
public FlowLayoutCorrectMinimumSize(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.LEADING
, orFlowLayout.TRAILING
.- Parameters:
align
- the alignment valuehgap
- the horizontal gap between components and between the components and the borders of theContainer
vgap
- the vertical gap between components and between the components and the borders of theContainer
-
-
Method Detail
-
layoutContainer
public void layoutContainer(java.awt.Container target)
Lays out the container. This method lets each visible component take its preferred size by reshaping the components in the target container in order to satisfy the alignment of thisFlowLayout
object.- Specified by:
layoutContainer
in interfacejava.awt.LayoutManager
- Overrides:
layoutContainer
in classjava.awt.FlowLayout
- Parameters:
target
- the specified component being laid out- See Also:
Container
,Container.doLayout()
-
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 container that needs to be laid out- Returns:
- the minimum dimensions to lay out the subcomponents of the specified container
- See Also:
preferredLayoutSize(java.awt.Container)
,Container
,Container.doLayout()
-
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 container that needs to be laid out- Returns:
- the preferred dimensions to lay out the subcomponents of the specified container
- See Also:
Container
,minimumLayoutSize(java.awt.Container)
,Container.getPreferredSize()
-
-