Package tripleplay.ui.layout
Class FlowLayout
java.lang.Object
tripleplay.ui.Layout
tripleplay.ui.layout.FlowLayout
Lays out elements in horizontal rows, starting a new row when a width limit is reached. By
default, the hint width is used as the limit; this can be overridden with a fixed value.
TODO: vertical
-
Nested Class Summary
Nested classes/interfaces inherited from class tripleplay.ui.Layout
Layout.Constraint
-
Field Summary
Modifier and TypeFieldDescriptionstatic final float
The default gap between rows and elements in a row. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionalign
(Style.VAlign align) Sets the alignment used for positioning elements within their row.pythagoras.f.Dimension
computeSize
(Container<?> elems, float hintX, float hintY) Computes and returns the size needed to arrange children of the supplied container according to their preferred size, given the specified x and y size hints.gaps
(float gap) Sets the gap, in pixels, to use between rows and between elements within a row.gaps
(float hgap, float vgap) Sets the gap, in pixels, to use between rows and between elements within a row.void
Lays out the supplied elements into a region of the specified dimensions.stretch()
Stretch elements vertically to the maximum height of other elements in the same row.wrapAt
(float width) Sets the maximum width of a row of elements.
-
Field Details
-
DEFAULT_GAP
public static final float DEFAULT_GAPThe default gap between rows and elements in a row.- See Also:
-
-
Constructor Details
-
FlowLayout
public FlowLayout()
-
-
Method Details
-
wrapAt
Sets the maximum width of a row of elements. This should normally be used whenever a flow layout governsElements
that have horizontal siblings. By default, the hint width is used. -
gaps
Sets the gap, in pixels, to use between rows and between elements within a row. -
gaps
Sets the gap, in pixels, to use between rows and between elements within a row.- Parameters:
hgap
- the gap to use between elements in a rowvgap
- the gap to use between rows
-
align
Sets the alignment used for positioning elements within their row. By default, elements are not stretched and centered vertically:Style.VAlign.CENTER
. -
stretch
Stretch elements vertically to the maximum height of other elements in the same row. This clears any previously set vertical alignment. -
computeSize
Description copied from class:Layout
Computes and returns the size needed to arrange children of the supplied container according to their preferred size, given the specified x and y size hints.- Specified by:
computeSize
in classLayout
-
layout
Description copied from class:Layout
Lays out the supplied elements into a region of the specified dimensions.
-