Package org.openstreetmap.josm.gui.util
Class MultiLineFlowLayout
- java.lang.Object
-
- java.awt.FlowLayout
-
- org.openstreetmap.josm.gui.util.MultiLineFlowLayout
-
- All Implemented Interfaces:
LayoutManager
,Serializable
public class MultiLineFlowLayout extends FlowLayout
This is an extension of the flow layout that prefers wrapping the text instead of increasing the component width when there is not enough space.This allows for a better preferred size computation. It should be used in all places where a flow layout fills the full width of the parent container.
This does not support baseline alignment.
- Since:
- 10622
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MultiLineFlowLayout()
Same asFlowLayout()
MultiLineFlowLayout(int align)
Same asFlowLayout(int)
MultiLineFlowLayout(int align, int hgap, int vgap)
Same asFlowLayout(int, int, int)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private Dimension
getLayoutSize(Container target, Function<Component,Dimension> baseSize)
private static int
getWidthOf(Container target)
Dimension
minimumLayoutSize(Container target)
Dimension
preferredLayoutSize(Container target)
String
toString()
-
Methods inherited from class java.awt.FlowLayout
addLayoutComponent, getAlignment, getAlignOnBaseline, getHgap, getVgap, layoutContainer, removeLayoutComponent, setAlignment, setAlignOnBaseline, setHgap, setVgap
-
-
-
-
Constructor Detail
-
MultiLineFlowLayout
public MultiLineFlowLayout()
Same asFlowLayout()
-
MultiLineFlowLayout
public MultiLineFlowLayout(int align, int hgap, int vgap)
Same asFlowLayout(int, int, int)
- Parameters:
align
- Alignmenthgap
- horizontal gapvgap
- vertical gap
-
MultiLineFlowLayout
public MultiLineFlowLayout(int align)
Same asFlowLayout(int)
- Parameters:
align
- Alignment
-
-
Method Detail
-
preferredLayoutSize
public Dimension preferredLayoutSize(Container target)
- Specified by:
preferredLayoutSize
in interfaceLayoutManager
- Overrides:
preferredLayoutSize
in classFlowLayout
-
minimumLayoutSize
public Dimension minimumLayoutSize(Container target)
- Specified by:
minimumLayoutSize
in interfaceLayoutManager
- Overrides:
minimumLayoutSize
in classFlowLayout
-
getLayoutSize
private Dimension getLayoutSize(Container target, Function<Component,Dimension> baseSize)
-
getWidthOf
private static int getWidthOf(Container target)
-
toString
public String toString()
- Overrides:
toString
in classFlowLayout
-
-