Class BoxLayout

java.lang.Object
com.vaadin.featurepack.desktop.layouts.AbstractLayout
com.vaadin.featurepack.desktop.layouts.BoxLayout
All Implemented Interfaces:
Serializable

public class BoxLayout extends AbstractLayout
Box layout arranges components along the specified axis.
Author:
Vaadin Ltd
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Aligns the components to the center of the container.
    static final String
    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).
    static final String
    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).
    static final int
    Indicates that components should be laid out left to right (of right to left, if the corresponding direction is used).
    static final int
    Indicates that components should be laid out top to bottom.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BoxLayout(int axis)
    Constructs a new BoxLayout using the given axis.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the axis for this layout.
    getConstraints(com.vaadin.flow.component.Component component)
     
    protected void
    onContainerAttach(com.vaadin.flow.component.AttachEvent event)
     
    void
    Sets the horizontal alignment for this layout.
    void
    Sets the vertical alignment for this layout.
    void
    setConstraints(com.vaadin.flow.component.Component component, Object constraints)
     
    void
    setContainer(com.vaadin.flow.component.Component container)
     

    Methods inherited from class com.vaadin.featurepack.desktop.layouts.AbstractLayout

    addComponent, getComponents, getContainer, onContainerDetach, removeComponent

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • HORIZONTAL

      public static final int HORIZONTAL
      Indicates 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 VERTICAL
      Indicates that components should be laid out top to bottom.
      See Also:
    • FLEX_START

      public static final String 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

      public static final String FLEX_CENTER
      Aligns the components to the center of the container.
      See Also:
    • FLEX_END

      public static final String 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 new BoxLayout using the given axis.
  • Method Details

    • onContainerAttach

      protected void onContainerAttach(com.vaadin.flow.component.AttachEvent event)
      Overrides:
      onContainerAttach in class AbstractLayout
    • setContainer

      public void setContainer(com.vaadin.flow.component.Component container)
      Overrides:
      setContainer in class AbstractLayout
    • getAxis

      public int getAxis()
      Gets the axis for this layout. Possible values are BoxLayout.X_AXIS and BoxLayout.Y_AXIS.
    • setAlignmentX

      public void setAlignmentX(String align)
      Sets the horizontal alignment for this layout. Possible values are BoxLayout.ALIGN_START, BoxLayout.ALIGN_CENTER and BoxLayout.ALIGN_END.
    • setAlignmentY

      public void setAlignmentY(String align)
      Sets the vertical alignment for this layout. Possible values are BoxLayout.ALIGN_START, BoxLayout.ALIGN_CENTER and BoxLayout.ALIGN_END.
    • setConstraints

      public void setConstraints(com.vaadin.flow.component.Component component, Object constraints)
      Specified by:
      setConstraints in class AbstractLayout
      Throws:
      UnsupportedOperationException - BoxLayout does not support constraints
    • getConstraints

      public Object getConstraints(com.vaadin.flow.component.Component component)
      Specified by:
      getConstraints in class AbstractLayout
      Throws:
      UnsupportedOperationException - BoxLayout does not support constraints