Enum Class Align

java.lang.Object
java.lang.Enum<Align>
org.gnome.gtk.Align
All Implemented Interfaces:
Serializable, Comparable<Align>, Constable, Enumeration

@Generated("org.javagi.JavaGI") public enum Align extends Enum<Align> implements Enumeration

Controls how a widget deals with extra space in a single dimension.

Alignment only matters if the widget receives a “too large” allocation, for example if you packed the widget with the Gtk.Widget:hexpand property inside a Box, then the widget might get extra space. If you have for example a 16x16 icon inside a 32x32 space, the icon could be scaled and stretched, it could be centered, or it could be positioned to one side of the space.

Note that in horizontal context GTK_ALIGN_START and GTK_ALIGN_END are interpreted relative to text direction.

Baseline support is optional for containers and widgets, and is only available for vertical alignment. GTK_ALIGN_BASELINE_CENTER and GTK_ALIGN_BASELINE_FILL are treated similar to GTK_ALIGN_CENTER and GTK_ALIGN_FILL, except that it positions the widget to line up the baselines, where that is supported.

  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    stretch to fill all space, but align the baseline.
    a different name for GTK_ALIGN_BASELINE.
    center natural width of widget inside the allocation
    snap to right or bottom side, leaving space on left or top
    stretch to fill all space if possible, center if no meaningful way to stretch
    snap to left or top side, leaving space on right or bottom
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Align
    Deprecated.
    Use GTK_ALIGN_BASELINE_FILL instead
  • Method Summary

    Modifier and Type
    Method
    Description
    static @Nullable Type
    Get the GType of the Align class.
    int
    Get the numeric value of this enum
    static Align
    of(int value)
    Create a new Align for the provided value
    static Align
    of(MemorySegment address)
    Create a new Align for the value in the provided memory address.
    static Align
    Returns the enum constant of this class with the specified name.
    static Align[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • FILL

      public static final Align FILL
      stretch to fill all space if possible, center if no meaningful way to stretch
    • START

      public static final Align START
      snap to left or top side, leaving space on right or bottom
    • END

      public static final Align END
      snap to right or bottom side, leaving space on left or top
    • CENTER

      public static final Align CENTER
      center natural width of widget inside the allocation
    • BASELINE_FILL

      public static final Align BASELINE_FILL
      a different name for GTK_ALIGN_BASELINE.
      Since:
      4.12
    • BASELINE_CENTER

      public static final Align BASELINE_CENTER
      stretch to fill all space, but align the baseline.
      Since:
      4.12
  • Field Details

    • BASELINE

      @Deprecated public static final Align BASELINE
      Deprecated.
      Use GTK_ALIGN_BASELINE_FILL instead
      align the widget according to the baseline.
  • Method Details

    • values

      public static Align[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Align valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static Align of(int value)
      Create a new Align for the provided value
      Parameters:
      value - the enum value
      Returns:
      the enum for the provided value
    • getValue

      public int getValue()
      Get the numeric value of this enum
      Specified by:
      getValue in interface Enumeration
      Returns:
      the enum value
    • of

      public static Align of(MemorySegment address)
      Create a new Align for the value in the provided memory address.
      Parameters:
      address - the memory address holding a enum value
      Returns:
      the enum for the value in the provided memory address
    • getType

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