Class ConstraintGuide

All Implemented Interfaces:
ConstraintTarget, Proxy

@Generated("org.javagi.JavaGI") public class ConstraintGuide extends GObject implements ConstraintTarget

An invisible layout element in a GtkConstraintLayout.

The GtkConstraintLayout treats guides like widgets. They can be used as the source or target of a GtkConstraint.

Guides have a minimum, maximum and natural size. Depending on the constraints that are applied, they can act like a guideline that widgets can be aligned to, or like flexible space.

Unlike a GtkWidget, a GtkConstraintGuide will not be drawn.

  • Constructor Details

    • ConstraintGuide

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

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

    • getType

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

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

      protected ConstraintGuide 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 GObject
      Returns:
      the instance as if it were its parent type
    • getMaxSize

      public void getMaxSize(@Nullable Out<Integer> width, @Nullable Out<Integer> height)
      Gets the maximum size of guide.
      Parameters:
      width - return location for the maximum width
      height - return location for the maximum height
    • getMinSize

      public void getMinSize(@Nullable Out<Integer> width, @Nullable Out<Integer> height)
      Gets the minimum size of guide.
      Parameters:
      width - return location for the minimum width
      height - return location for the minimum height
    • getName

      public @Nullable String getName()
      Retrieves the name set using gtk_constraint_guide_set_name().
      Returns:
      the name of the guide
    • getNatSize

      public void getNatSize(@Nullable Out<Integer> width, @Nullable Out<Integer> height)
      Gets the natural size of guide.
      Parameters:
      width - return location for the natural width
      height - return location for the natural height
    • getStrength

      public ConstraintStrength getStrength()
      Retrieves the strength set using gtk_constraint_guide_set_strength().
      Returns:
      the strength of the constraint on the natural size
    • setMaxSize

      public void setMaxSize(int width, int height)

      Sets the maximum size of guide.

      If this ConstraintGuide is attached to a GtkConstraintLayout, the constraints will be updated to reflect the new size.

      Parameters:
      width - the new maximum width, or -1 to not change it
      height - the new maximum height, or -1 to not change it
    • setMinSize

      public void setMinSize(int width, int height)

      Sets the minimum size of guide.

      If this ConstraintGuide is attached to a GtkConstraintLayout, the constraints will be updated to reflect the new size.

      Parameters:
      width - the new minimum width, or -1 to not change it
      height - the new minimum height, or -1 to not change it
    • setName

      public void setName(@Nullable String name)

      Sets a name for the given GtkConstraintGuide.

      The name is useful for debugging purposes.

      Parameters:
      name - a name for the this ConstraintGuide
    • setNatSize

      public void setNatSize(int width, int height)

      Sets the natural size of guide.

      If this ConstraintGuide is attached to a GtkConstraintLayout, the constraints will be updated to reflect the new size.

      Parameters:
      width - the new natural width, or -1 to not change it
      height - the new natural height, or -1 to not change it
    • setStrength

      public void setStrength(ConstraintStrength strength)
      Sets the strength of the constraint on the natural size of the given GtkConstraintGuide.
      Parameters:
      strength - the strength of the constraint
    • builder

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