Interface Layout
- All Known Implementing Classes:
Layout.BorderLayoutInstaller,Layout.ForBoxLayout,Layout.ForFlowLayout,Layout.ForGridLayout,Layout.ForMigLayout,Layout.None,Layout.Unspecific
border(), flow(), grid(int, int)...
and then supplied to the style API through ComponentStyleDelegate.layout(Layout)
so that the layout can then be installed onto a component dynamically.
The various layout types hold necessary information
and implementation logic required for installing the layout onto a component
through the installFor(JComponent) method,
which will be used by the style engine of SwingTree
every time the layout object state changes compared to the previous state
effectively making the layout mechanics of a component fully dynamic.
You may implement this interface to create custom layout configurations
for other kinds of LayoutManager implementations.
This interface also contains various implementations
for supporting the most common types of LayoutManagers.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classTheLayout.BorderLayoutInstallerlayout is a layout that represents aBorderLayoutlayout configuration for a component, which consists of the horizontal gap and vertical gap.static final classTheLayout.ForBoxLayoutlayout is a layout that represents aBoxLayoutlayout configuration for a component, which consists of the axis.static final classAn immutableLayoutimplementation that configures and installs aResponsiveGridFlowLayoutonto a component.static final classALayoutwhich installs aUniformGridLayoutonto a component, created through one of thegrid(int, int)factory methods.static final classAn immutableLayoutimplementation that configures and installs aMigLayoutonto a component.static final classTheLayout.Nonelayout removes any existingLayoutManagerfrom a component (sets it tonull), enabling fully manual positioning of child components viaComponent.setBounds(int, int, int, int).static final classTheLayout.Unspecificlayout is a layout that represents the lack of a specific layout being set for a component. -
Method Summary
Modifier and TypeMethodDescriptionstatic Layoutborder()A factory method for creating a layout that installs theBorderLayoutonto a component based on the supplied parameters.static Layoutborder(int horizontalGap, int verticalGap) A factory method for creating a layout that installs theBorderLayoutonto a component based on the supplied parameters.static Layoutbox()A factory method for creating a layout that installs theBoxLayoutonto a component with a default axis ofUI.Axis.HORIZONTAL.static Layoutbooleanstatic Layout.ForFlowLayoutflow()A factory method for creating aLayout.ForFlowLayoutconfiguration that installs aResponsiveGridFlowLayoutwith centered alignment and default gaps of 5 pixels.static Layout.ForFlowLayoutA convenience factory method that creates a centeredLayout.ForFlowLayoutpre-loaded with per-childFlowCellconstraints.static Layout.ForFlowLayoutflow(UI.HorizontalAlignment align) A factory method for creating aLayout.ForFlowLayoutconfiguration that installs aResponsiveGridFlowLayoutwith the given alignment and default gaps of 5 pixels.static Layout.ForFlowLayoutflow(UI.HorizontalAlignment align, int hgap, int vgap) A factory method for creating aLayout.ForFlowLayoutconfiguration that installs aResponsiveGridFlowLayoutonto a component with the given alignment and gaps.static Layout.ForFlowLayoutflow(UI.HorizontalAlignment align, FlowCell... childConstraints) A convenience factory method that creates aLayout.ForFlowLayoutwith the given alignment and per-childFlowCellconstraints pre-loaded.static Layout.ForGridLayoutgrid(int rows, int cols) A factory method for aLayout.ForGridLayoutwhich installs aUniformGridLayoutwith the given numbers of rows and columns and no gaps onto a component.static Layout.ForGridLayoutgrid(int rows, int cols, int horizontalGap, int verticalGap) A factory method for aLayout.ForGridLayoutwhich installs aUniformGridLayoutwith the given numbers of rows and columns and the given gaps onto a component.static Layout.ForGridLayoutgrid(UniformGridLayout.Mode mode, UniformGridLayout.CollapseEmpty collapseEmpty, int rows, int cols) A factory method for aLayout.ForGridLayoutwhich installs aUniformGridLayoutwith the given settings and numbers of rows and columns, and no gaps, onto a component.static Layout.ForGridLayoutgrid(UniformGridLayout.Mode mode, UniformGridLayout.CollapseEmpty collapseEmpty, int rows, int cols, int horizontalGap, int verticalGap) A factory method for aLayout.ForGridLayoutwhich installs aUniformGridLayoutwith the given settings, numbers of rows and columns and gaps onto a component.static Layout.ForGridLayoutgrid(UniformGridLayout.Mode mode, UniformGridLayout.CollapseEmpty collapseEmpty, UniformGridLayout.OverflowGrowth overflowGrowth, int rows, int cols) A factory method for aLayout.ForGridLayoutwhich installs aUniformGridLayoutwith every one of its settings and the given numbers of rows and columns, and no gaps, onto a component.static Layout.ForGridLayoutgrid(UniformGridLayout.Mode mode, UniformGridLayout.CollapseEmpty collapseEmpty, UniformGridLayout.OverflowGrowth overflowGrowth, int rows, int cols, int horizontalGap, int verticalGap) A factory method for aLayout.ForGridLayoutwhich installs aUniformGridLayoutwith every one of its settings, the given numbers of rows and columns and the given gaps onto a component.inthashCode()voidinstallFor(JComponent component) Installs this layout for the supplied component.static Layout.ForMigLayoutA convenience overload ofmig(LayoutConstraint)that accepts a plain constraint string instead of aLayoutConstraintobject.static Layout.ForMigLayoutA convenience overload ofmig(LayoutConstraint, LayoutConstraint)that accepts plain constraint strings instead ofLayoutConstraintobjects.static Layout.ForMigLayoutA convenience overload ofmig(LayoutConstraint, LayoutConstraint, LayoutConstraint)that accepts plain constraint strings instead ofLayoutConstraintobjects.static Layout.ForMigLayoutmig(String constr, MigAddConstraint... childConstraints) A convenience factory method that creates aMigLayout-based layout configuration from a plain constraint string together with per-childMigAddConstraints for the component's direct children.static Layout.ForMigLayoutmig(LayoutConstraint constr) A factory method for creating aMigLayout-based layout configuration from a single type-safeLayoutConstraint, with no column or row constraints.static Layout.ForMigLayoutmig(LayoutConstraint constr, LayoutConstraint rowConstr) A factory method for creating aMigLayout-based layout configuration from type-safeLayoutConstraintobjects, without column constraints.static Layout.ForMigLayoutmig(LayoutConstraint constr, LayoutConstraint colConstr, LayoutConstraint rowConstr) The preferred factory method for creating aMigLayout-based layout configuration from type-safeLayoutConstraintobjects.static Layout.ForMigLayoutmig(LayoutConstraint constr, MigAddConstraint... childConstraints) A convenience factory method that creates aMigLayout-based layout configuration from a single type-safeLayoutConstrainttogether with per-childMigAddConstraints for the component's direct children.static Layout.Nonenone()Returns aLayout.Nonelayout that removes any existingLayoutManagerfrom a component (sets it tonull), enabling manual positioning of child components via theirComponent.setBounds(int, int, int, int)method.static Layout.NoneA convenience factory that creates aLayout.Nonelayout pre-loaded with per-childBounds.static LayoutA factory method for creating a layout that does nothing (i.e.
-
Method Details
-
hashCode
int hashCode() -
equals
-
installFor
Installs this layout for the supplied component.- Parameters:
component- The component to install this layout for.
-
unspecific
A factory method for creating a layout that does nothing (i.e. it does not install any layout for a component). This is a no-op layout that can be used to represent the lack of a specific layout being set for a component without having to set the layout tonull.- Returns:
- A layout that does nothing, i.e. it does not install any layout for a component.
-
none
Returns aLayout.Nonelayout that removes any existingLayoutManagerfrom a component (sets it tonull), enabling manual positioning of child components via theirComponent.setBounds(int, int, int, int)method.To also specify the initial bounds of child components declaratively, chain
Layout.None.withChildBounds(Bounds...)on the returned instance, or use thenone(Bounds...)shorthand factory.- Returns:
- A
Layout.Nonelayout that removes any existing layout manager from a component.
-
none
A convenience factory that creates aLayout.Nonelayout pre-loaded with per-childBounds. This is a shorthand for:
WhenLayout.none().withChildBounds(childBounds)installForis called, the layout manager is first removed from the component (enabling absolute positioning), and then each suppliedBoundsentry is applied to the corresponding child by index viaComponent.setBounds(int, int, int, int). Because the underlying storage is a sparseAssociation, you only need to supply bounds for the children you actually want to position; children without an entry are left untouched.- Parameters:
childBounds- TheBoundsto apply to the component's children, in child-index order.- Returns:
- A
Layout.Nonelayout that removes any layout manager and applies the given bounds to the corresponding children.
-
mig
static Layout.ForMigLayout mig(LayoutConstraint constr, LayoutConstraint colConstr, LayoutConstraint rowConstr) The preferred factory method for creating aMigLayout-based layout configuration from type-safeLayoutConstraintobjects.LayoutConstraintis a composable, type-safe wrapper around MigLayout constraint strings. The recommended way to use it is through the constants and factory methods available viaimport static swingtree.UI.*, which can then be combined withLayoutConstraint.and(LayoutConstraint):
Usingimport static swingtree.UI.*; // ... Layout.mig( FILL.and(WRAP(2)), "[shrink][grow]", "[]8[]" )LayoutConstraintinstead of raw strings catches typos at call-site and makes constraint composition explicit and refactor-friendly. See the MigLayout whitepaper for full constraint documentation.The returned
Layout.ForMigLayoutinstance supports fluent chaining to specify per-child component constraints via the variousLayout.ForMigLayout.withChildConstraints(MigAddConstraint...)overloads.- Parameters:
constr- The general layout constraints for theMigLayout(e.g.FILL.and(WRAP(2))).colConstr- The column constraints for theMigLayout(e.g.LayoutConstraint.of("[shrink][grow]")).rowConstr- The row constraints for theMigLayout(e.g.LayoutConstraint.of("[]8[]")).- Returns:
- A
Layout.ForMigLayoutconfigured with the supplied constraints.
-
mig
A factory method for creating aMigLayout-based layout configuration from type-safeLayoutConstraintobjects, without column constraints. This is the preferred approach over the plain-Stringoverloads.See
mig(LayoutConstraint, LayoutConstraint, LayoutConstraint)for full details on theLayoutConstraintAPI and chaining child constraints.- Parameters:
constr- The general layout constraints for theMigLayout.rowConstr- The row constraints for theMigLayout.- Returns:
- A
Layout.ForMigLayoutconfigured with the supplied constraints.
-
mig
A factory method for creating aMigLayout-based layout configuration from a single type-safeLayoutConstraint, with no column or row constraints. This is the preferred approach over the plain-Stringoverload.See
mig(LayoutConstraint, LayoutConstraint, LayoutConstraint)for full details on theLayoutConstraintAPI and chaining child constraints.- Parameters:
constr- The general layout constraints for theMigLayout.- Returns:
- A
Layout.ForMigLayoutconfigured with the supplied constraints.
-
mig
A convenience factory method that creates aMigLayout-based layout configuration from a single type-safeLayoutConstrainttogether with per-childMigAddConstraints for the component's direct children.The
childConstraintsare mapped positionally: the first entry is applied to the first child, the second to the second child, and so on. Excess entries (more constraints than children) are silently ignored; children without a matching entry keep whatever constraint the parentMigLayoutalready has for them.This is a shorthand for:
SeeLayout.mig(constr).withChildConstraints(childConstraints)mig(LayoutConstraint, LayoutConstraint, LayoutConstraint)for full details on theLayoutConstraintAPI.- Parameters:
constr- The general layout constraints for theMigLayout.childConstraints- TheMigAddConstraints to apply to the component's children, in child-index order.- Returns:
- A
Layout.ForMigLayoutconfigured with the supplied constraints.
-
mig
A convenience overload ofmig(LayoutConstraint, LayoutConstraint, LayoutConstraint)that accepts plain constraint strings instead ofLayoutConstraintobjects. Each string is wrapped viaLayoutConstraint.of(String...)before being forwarded.Prefer the
LayoutConstraint-based overloads for new code, as they are composable and less error-prone than raw strings. Click here for more information about MigLayout.- Parameters:
constr- The general layout constraints string for theMigLayout.colConstr- The column constraints string for theMigLayout.rowConstr- The row constraints string for theMigLayout.- Returns:
- A
Layout.ForMigLayoutconfigured with the supplied constraints.
-
mig
A convenience overload ofmig(LayoutConstraint, LayoutConstraint)that accepts plain constraint strings instead ofLayoutConstraintobjects. Each string is wrapped viaLayoutConstraint.of(String...)before being forwarded.Prefer the
LayoutConstraint-based overloads for new code, as they are composable and less error-prone than raw strings. Click here for more information about MigLayout.- Parameters:
constr- The general layout constraints string for theMigLayout.rowConstr- The row constraints string for theMigLayout.- Returns:
- A
Layout.ForMigLayoutconfigured with the supplied constraints.
-
mig
A convenience overload ofmig(LayoutConstraint)that accepts a plain constraint string instead of aLayoutConstraintobject. The string is wrapped viaLayoutConstraint.of(String...)before being forwarded.Prefer the
LayoutConstraint-based overloads for new code, as they are composable and less error-prone than raw strings. In case you are not familiar with the MigLayout constraints, you can find more information about them here.- Parameters:
constr- The general layout constraints string for theMigLayout.- Returns:
- A
Layout.ForMigLayoutconfigured with the supplied constraints.
-
mig
A convenience factory method that creates aMigLayout-based layout configuration from a plain constraint string together with per-childMigAddConstraints for the component's direct children.The
childConstraintsare mapped positionally: the first entry is applied to the first child, the second to the second child, and so on. This is a shorthand for:
Prefer theLayout.mig(constr).withChildConstraints(childConstraints)LayoutConstraint-based overloadmig(LayoutConstraint, MigAddConstraint...)for new code.- Parameters:
constr- The general layout constraints string for theMigLayout.childConstraints- TheMigAddConstraints to apply to the component's children, in child-index order.- Returns:
- A
Layout.ForMigLayoutconfigured with the supplied constraints.
-
flow
A factory method for creating aLayout.ForFlowLayoutconfiguration that installs aResponsiveGridFlowLayoutonto a component with the given alignment and gaps.The returned
Layout.ForFlowLayoutsupports fluent chaining to specify per-childFlowCellconstraints via the variousLayout.ForFlowLayout.withChildConstraints(FlowCell...)overloads, enabling fully reactive responsive layouts when used together withUIForAnySwing.withLayout(sprouts.Val).- Parameters:
align- The alignment for the layout, which has to be one ofhgap- The horizontal gap between components, in pixels.vgap- The vertical gap between component rows, in pixels.- Returns:
- A
Layout.ForFlowLayoutconfigured with the supplied alignment and gaps.
-
flow
A factory method for creating aLayout.ForFlowLayoutconfiguration that installs aResponsiveGridFlowLayoutwith the given alignment and default gaps of 5 pixels.The returned
Layout.ForFlowLayoutsupports fluent chaining to specify per-childFlowCellconstraints. Seeflow(UI.HorizontalAlignment, int, int)for full details.- Parameters:
align- The horizontal alignment for the flow of components.- Returns:
- A
Layout.ForFlowLayoutconfigured with the supplied alignment.
-
flow
A factory method for creating aLayout.ForFlowLayoutconfiguration that installs aResponsiveGridFlowLayoutwith centered alignment and default gaps of 5 pixels.The returned
Layout.ForFlowLayoutsupports fluent chaining to specify per-childFlowCellconstraints. Seeflow(UI.HorizontalAlignment, int, int)for full details.- Returns:
- A
Layout.ForFlowLayoutwith centered alignment and 5-pixel gaps.
-
flow
A convenience factory method that creates a centeredLayout.ForFlowLayoutpre-loaded with per-childFlowCellconstraints. This is a shorthand for:
EachLayout.flow().withChildConstraints(childConstraints)FlowCellis typically created viaUILayoutConstants.AUTO_SPAN(Configurator):
Changing theimport static swingtree.UI.*; // ... Var<Layout> layout = Var.of( Layout.flow( AUTO_SPAN( it -> it.small(12).medium(6) ), AUTO_SPAN( it -> it.small(12).medium(6) ) ) ); UI.panel() .withLayout(layout) .add( label("Left") ) .add( label("Right") );layoutproperty at runtime will reinstall the layout and re-push all childFlowCellconstraints, making the span behaviour fully reactive.- Parameters:
childConstraints- TheFlowCellconstraints to apply to the component's children in child-index order.- Returns:
- A
Layout.ForFlowLayoutwith centered alignment and the given child constraints.
-
flow
A convenience factory method that creates aLayout.ForFlowLayoutwith the given alignment and per-childFlowCellconstraints pre-loaded. This is a shorthand for:
SeeLayout.flow(align).withChildConstraints(childConstraints)flow(FlowCell...)for a usage example and reactive design notes.- Parameters:
align- The horizontal alignment for the flow of components.childConstraints- TheFlowCellconstraints to apply to the component's children in child-index order.- Returns:
- A
Layout.ForFlowLayoutwith the given alignment and child constraints.
-
border
A factory method for creating a layout that installs theBorderLayoutonto a component based on the supplied parameters.- Parameters:
horizontalGap- The horizontal gap for the layout.verticalGap- The vertical gap for the layout.- Returns:
- A layout that installs the
BorderLayoutonto a component.
-
border
A factory method for creating a layout that installs theBorderLayoutonto a component based on the supplied parameters. The installed layout will have a default gap of 0 pixels.- Returns:
- A layout that installs the
BorderLayoutonto a component.
-
grid
A factory method for aLayout.ForGridLayoutwhich installs aUniformGridLayoutwith the given numbers of rows and columns and the given gaps onto a component. The grid is built in the modeUniformGridLayout.Mode.WRAP_AFTER_COLUMNSand leaves out the rows and columns which no child occupies (UniformGridLayout.CollapseEmpty.ROWS_AND_COLUMNS).So in a style like
it.layout(Layout.grid(2, 5, 5, 5)), 8 children are laid out in 2 rows of 5 columns, and 3 children share the whole component in a single row of 3 columns. A number of rows or columns of 0 means "as many as the children need", and the gaps are scaled by the UI scale factor every time the component is laid out. Usegrid(UniformGridLayout.Mode, UniformGridLayout.CollapseEmpty, int, int, int, int)to choose other settings.- Parameters:
rows- The number of rows, or 0 for as many rows as the children need.cols- The number of columns, or 0 for as many columns as the children need.horizontalGap- The space between neighbouring columns, in pixels at a UI scale factor of 1.verticalGap- The space between neighbouring rows, in pixels at a UI scale factor of 1.- Returns:
- A
Layout.ForGridLayoutwhich installs aUniformGridLayoutonto a component.
-
grid
A factory method for aLayout.ForGridLayoutwhich installs aUniformGridLayoutwith the given numbers of rows and columns and no gaps onto a component. The grid is built in the modeUniformGridLayout.Mode.WRAP_AFTER_COLUMNSand leaves out the rows and columns which no child occupies (UniformGridLayout.CollapseEmpty.ROWS_AND_COLUMNS). Seegrid(int, int, int, int)for an example.- Parameters:
rows- The number of rows, or 0 for as many rows as the children need.cols- The number of columns, or 0 for as many columns as the children need.- Returns:
- A
Layout.ForGridLayoutwhich installs aUniformGridLayoutonto a component.
-
grid
static Layout.ForGridLayout grid(UniformGridLayout.Mode mode, UniformGridLayout.CollapseEmpty collapseEmpty, int rows, int cols, int horizontalGap, int verticalGap) A factory method for aLayout.ForGridLayoutwhich installs aUniformGridLayoutwith the given settings, numbers of rows and columns and gaps onto a component.The
modedecides how the grid is built from the numbers of rows and columns, andcollapseEmptydecides which of the rows and columns that no child occupies are left out. So in a style likeit.layout(Layout.grid(Mode.SPREAD_OVER_ROWS, CollapseEmpty.NONE, 2, 5, 5, 5)), the children are spread over 2 rows with every empty cell kept, and withLayout.grid(Mode.WRAP_AFTER_COLUMNS, CollapseEmpty.NONE, 2, 5, 5, 5), 3 children take the first 3 cells of a grid of 2 rows and 5 columns. To lay children out exactly like aGridLayout, addOverflowGrowth.ADD_COLUMNSthroughgrid(UniformGridLayout.Mode, UniformGridLayout.CollapseEmpty, UniformGridLayout.OverflowGrowth, int, int, int, int), which is the growth policy that makes room the way aGridLayoutmakes room. SeeUniformGridLayout.ModeandUniformGridLayout.CollapseEmptyfor what each setting does.- Parameters:
mode- How the grid is built from the numbers of rows and columns.collapseEmpty- Which of the rows and columns that no child occupies are left out.rows- The number of rows, or 0 for as many rows as the children need.cols- The number of columns, or 0 for as many columns as the children need.horizontalGap- The space between neighbouring columns, in pixels at a UI scale factor of 1.verticalGap- The space between neighbouring rows, in pixels at a UI scale factor of 1.- Returns:
- A
Layout.ForGridLayoutwhich installs aUniformGridLayoutonto a component.
-
grid
static Layout.ForGridLayout grid(UniformGridLayout.Mode mode, UniformGridLayout.CollapseEmpty collapseEmpty, int rows, int cols) A factory method for aLayout.ForGridLayoutwhich installs aUniformGridLayoutwith the given settings and numbers of rows and columns, and no gaps, onto a component. Seegrid(UniformGridLayout.Mode, UniformGridLayout.CollapseEmpty, int, int, int, int)for what the settings do.- Parameters:
mode- How the grid is built from the numbers of rows and columns.collapseEmpty- Which of the rows and columns that no child occupies are left out.rows- The number of rows, or 0 for as many rows as the children need.cols- The number of columns, or 0 for as many columns as the children need.- Returns:
- A
Layout.ForGridLayoutwhich installs aUniformGridLayoutonto a component.
-
grid
static Layout.ForGridLayout grid(UniformGridLayout.Mode mode, UniformGridLayout.CollapseEmpty collapseEmpty, UniformGridLayout.OverflowGrowth overflowGrowth, int rows, int cols, int horizontalGap, int verticalGap) A factory method for aLayout.ForGridLayoutwhich installs aUniformGridLayoutwith every one of its settings, the given numbers of rows and columns and the given gaps onto a component.On top of
grid(UniformGridLayout.Mode, UniformGridLayout.CollapseEmpty, int, int, int, int),overflowGrowthdecides how the grid grows when it holds more children than cells. So in a style likeit.layout(Layout.grid(Mode.WRAP_AFTER_COLUMNS, CollapseEmpty.NONE, OverflowGrowth.ADD_ROWS_AND_COLUMNS, 2, 5, 5, 5)), 13 children are laid out in 3 rows of 6 columns, because growing both numbers keeps the grid closer to the declared ratio of 2 rows to 5 columns than a third row alone would. SeeUniformGridLayout.OverflowGrowthfor what each setting does.- Parameters:
mode- How the grid is built from the numbers of rows and columns.collapseEmpty- Which of the rows and columns that no child occupies are left out.overflowGrowth- How the grid grows when it holds more children than cells.rows- The number of rows, or 0 for as many rows as the children need.cols- The number of columns, or 0 for as many columns as the children need.horizontalGap- The space between neighbouring columns, in pixels at a UI scale factor of 1.verticalGap- The space between neighbouring rows, in pixels at a UI scale factor of 1.- Returns:
- A
Layout.ForGridLayoutwhich installs aUniformGridLayoutonto a component.
-
grid
static Layout.ForGridLayout grid(UniformGridLayout.Mode mode, UniformGridLayout.CollapseEmpty collapseEmpty, UniformGridLayout.OverflowGrowth overflowGrowth, int rows, int cols) A factory method for aLayout.ForGridLayoutwhich installs aUniformGridLayoutwith every one of its settings and the given numbers of rows and columns, and no gaps, onto a component. Seegrid(UniformGridLayout.Mode, UniformGridLayout.CollapseEmpty, UniformGridLayout.OverflowGrowth, int, int, int, int)for what the settings do.- Parameters:
mode- How the grid is built from the numbers of rows and columns.collapseEmpty- Which of the rows and columns that no child occupies are left out.overflowGrowth- How the grid grows when it holds more children than cells.rows- The number of rows, or 0 for as many rows as the children need.cols- The number of columns, or 0 for as many columns as the children need.- Returns:
- A
Layout.ForGridLayoutwhich installs aUniformGridLayoutonto a component.
-
box
A factory method for creating a layout that installs theBoxLayoutonto a component based on the suppliedUI.Axisparameter. The axis determines whether the layout will be a horizontal or verticalBoxLayout.- Parameters:
axis- The axis for the layout, which has to be one of- Returns:
- A layout that installs the
BoxLayoutonto a component.
-
box
A factory method for creating a layout that installs theBoxLayoutonto a component with a default axis ofUI.Axis.HORIZONTAL.- Returns:
- A layout that installs the default
BoxLayoutonto a component.
-