Class ClampLayout.Builder<B extends ClampLayout.Builder<B>>

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

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

      public B setMaximumSize(int maximumSize)

      The maximum size to allocate to the children.

      It is the width if the layout is horizontal, or the height if it is vertical.

      Parameters:
      maximumSize - the value for the maximum-size property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTighteningThreshold

      public B setTighteningThreshold(int tighteningThreshold)

      The size above which the children are clamped.

      Starting from this size, the layout will tighten its grip on the children, slowly allocating less and less of the available size up to the maximum allocated size. Below that threshold and below the maximum size, the children will be allocated all the available size.

      If the threshold is greater than the maximum size to allocate to the children, they will be allocated the whole size up to the maximum. If the threshold is lower than the minimum size to allocate to the children, that size will be used as the tightening threshold.

      Effectively, tightening the grip on a child before it reaches its maximum size makes transitions to and from the maximum size smoother when resizing.

      Parameters:
      tighteningThreshold - the value for the tightening-threshold property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setUnit

      public B setUnit(LengthUnit unit)

      The length unit for maximum size and tightening threshold.

      Allows the sizes to vary depending on the text scale factor.

      Parameters:
      unit - the value for the unit property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.4