Class CenterLayout

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class CenterLayout extends LayoutManager

Manages up to three children.

The start widget is allocated at the start of the layout (left in left-to-right locales and right in right-to-left ones), and the end widget at the end.

The center widget is centered regarding the full width of the layout's.

  • Constructor Details

    • CenterLayout

      public CenterLayout(MemorySegment address)
      Create a CenterLayout instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • CenterLayout

      public CenterLayout()
      Create a new CenterLayout.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the CenterLayout class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected CenterLayout asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class LayoutManager
      Returns:
      the instance as if it were its parent type
    • getBaselinePosition

      public BaselinePosition getBaselinePosition()
      Returns the baseline position of the layout.
      Returns:
      The current baseline position of self.
    • getCenterWidget

      public @Nullable Widget getCenterWidget()
      Returns the center widget of the layout.
      Returns:
      the current center widget of this CenterLayout
    • getEndWidget

      public @Nullable Widget getEndWidget()
      Returns the end widget of the layout.
      Returns:
      the current end widget of this CenterLayout
    • getOrientation

      public Orientation getOrientation()
      Gets the current orienration of the layout manager.
      Returns:
      The current orientation of this CenterLayout
    • getShrinkCenterLast

      public boolean getShrinkCenterLast()
      Gets whether this CenterLayout shrinks the center widget after other children.
      Returns:
      whether to shrink the center widget after others
      Since:
      4.12
    • getStartWidget

      public @Nullable Widget getStartWidget()
      Returns the start widget of the layout.
      Returns:
      The current start widget of this CenterLayout
    • setBaselinePosition

      public void setBaselinePosition(BaselinePosition baselinePosition)
      Sets the new baseline position of this CenterLayout
      Parameters:
      baselinePosition - the new baseline position
    • setCenterWidget

      public void setCenterWidget(@Nullable Widget widget)

      Sets the new center widget of self.

      To remove the existing center widget, pass null.

      Parameters:
      widget - the new center widget
    • setEndWidget

      public void setEndWidget(@Nullable Widget widget)

      Sets the new end widget of self.

      To remove the existing center widget, pass null.

      Parameters:
      widget - the new end widget
    • setOrientation

      public void setOrientation(Orientation orientation)
      Sets the orientation of self.
      Parameters:
      orientation - the new orientation
    • setShrinkCenterLast

      public void setShrinkCenterLast(boolean shrinkCenterLast)

      Sets whether to shrink the center widget after other children.

      By default, when there's no space to give all three children their natural widths, the start and end widgets start shrinking and the center child keeps natural width until they reach minimum width.

      If set to FALSE, start and end widgets keep natural width and the center widget starts shrinking instead.

      Parameters:
      shrinkCenterLast - whether to shrink the center widget after others
      Since:
      4.12
    • setStartWidget

      public void setStartWidget(@Nullable Widget widget)

      Sets the new start widget of self.

      To remove the existing start widget, pass null.

      Parameters:
      widget - the new start widget
    • builder

      public static CenterLayout.Builder<? extends CenterLayout.Builder> builder()
      A CenterLayout.Builder object constructs a CenterLayout with the specified properties. Use the various set...() methods to set properties, and finish construction with CenterLayout.Builder.build().
      Returns:
      the builder object