Class BoxLayout
java.lang.Object
com.vaadin.featurepack.desktop.layouts.AbstractLayout
com.vaadin.featurepack.desktop.layouts.BoxLayout
- All Implemented Interfaces:
Serializable
Box layout arranges components along the specified axis.
- Author:
- Vaadin Ltd
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAligns the components to the center of the container.static final StringAligns the components to the start of the container (the bottom edge when using Y axis, or right / left edge when using X axis, depending of the direction).static final StringAligns the components to the start of the container (the top edge when using Y axis, or left / right edge when using X axis, depending of the direction).static final intIndicates that components should be laid out left to right (of right to left, if the corresponding direction is used).static final intIndicates that components should be laid out top to bottom. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetAxis()Gets the axis for this layout.getConstraints(com.vaadin.flow.component.Component component) protected voidonContainerAttach(com.vaadin.flow.component.AttachEvent event) voidsetAlignmentX(String align) Sets the horizontal alignment for this layout.voidsetAlignmentY(String align) Sets the vertical alignment for this layout.voidsetConstraints(com.vaadin.flow.component.Component component, Object constraints) voidsetContainer(com.vaadin.flow.component.Component container) Methods inherited from class com.vaadin.featurepack.desktop.layouts.AbstractLayout
addComponent, getComponents, getContainer, onContainerDetach, removeComponent
-
Field Details
-
HORIZONTAL
public static final int HORIZONTALIndicates that components should be laid out left to right (of right to left, if the corresponding direction is used).- See Also:
-
VERTICAL
public static final int VERTICALIndicates that components should be laid out top to bottom.- See Also:
-
FLEX_START
Aligns the components to the start of the container (the top edge when using Y axis, or left / right edge when using X axis, depending of the direction).- See Also:
-
FLEX_CENTER
Aligns the components to the center of the container.- See Also:
-
FLEX_END
Aligns the components to the start of the container (the bottom edge when using Y axis, or right / left edge when using X axis, depending of the direction).- See Also:
-
-
Constructor Details
-
BoxLayout
public BoxLayout(int axis) Constructs a newBoxLayoutusing the given axis.
-
-
Method Details
-
onContainerAttach
protected void onContainerAttach(com.vaadin.flow.component.AttachEvent event) - Overrides:
onContainerAttachin classAbstractLayout
-
setContainer
public void setContainer(com.vaadin.flow.component.Component container) - Overrides:
setContainerin classAbstractLayout
-
getAxis
public int getAxis()Gets the axis for this layout. Possible values areBoxLayout.X_AXISandBoxLayout.Y_AXIS. -
setAlignmentX
Sets the horizontal alignment for this layout. Possible values areBoxLayout.ALIGN_START,BoxLayout.ALIGN_CENTERandBoxLayout.ALIGN_END. -
setAlignmentY
Sets the vertical alignment for this layout. Possible values areBoxLayout.ALIGN_START,BoxLayout.ALIGN_CENTERandBoxLayout.ALIGN_END. -
setConstraints
- Specified by:
setConstraintsin classAbstractLayout- Throws:
UnsupportedOperationException- BoxLayout does not support constraints
-
getConstraints
- Specified by:
getConstraintsin classAbstractLayout- Throws:
UnsupportedOperationException- BoxLayout does not support constraints
-