Class BoxLayout.Builder<B extends BoxLayout.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
Orientable.Builder<B>, BuilderInterface
Enclosing class:
BoxLayout

public static class BoxLayout.Builder<B extends BoxLayout.Builder<B>> extends LayoutManager.Builder<B> implements Orientable.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public BoxLayout build()
      Finish building the BoxLayout object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to BoxLayout.
      Overrides:
      build in class LayoutManager.Builder<B extends BoxLayout.Builder<B>>
      Returns:
      a new instance of BoxLayout with the properties that were set in the Builder object.
    • setBaselineChild

      public B setBaselineChild(int baselineChild)

      The child that determines the baseline of the box in vertical layout.

      If the child does baseline positioning, then its baseline is lined up with the baseline of the box. If it doesn't, then the bottom edge of the child is used.

      Parameters:
      baselineChild - the value for the baseline-child property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.12
    • setBaselinePosition

      public B setBaselinePosition(BaselinePosition baselinePosition)

      The position of the allocated baseline within the extra space allocated to each child.

      This property is only relevant for horizontal layouts containing at least one child with a baseline alignment.

      Parameters:
      baselinePosition - the value for the baseline-position property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setHomogeneous

      public B setHomogeneous(boolean homogeneous)
      Whether the box layout should distribute the available space equally among the children.
      Parameters:
      homogeneous - the value for the homogeneous property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setSpacing

      public B setSpacing(int spacing)
      The space to put between the children.
      Parameters:
      spacing - the value for the spacing property
      Returns:
      the Builder instance is returned, to allow method chaining