Class Constraint.Builder<B extends Constraint.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Enclosing class:
Constraint

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

      public B setConstant(double constant)
      The constant value to be added to the Gtk.Constraint:source-attribute.
      Parameters:
      constant - the value for the constant property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setMultiplier

      public B setMultiplier(double multiplier)
      The multiplication factor to be applied to the Gtk.Constraint:source-attribute.
      Parameters:
      multiplier - the value for the multiplier property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setRelation

      public B setRelation(ConstraintRelation relation)
      The order relation between the terms of the constraint.
      Parameters:
      relation - the value for the relation property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setSource

      public B setSource(ConstraintTarget source)

      The source of the constraint.

      The constraint will set the Gtk.Constraint:target-attribute property of the target using the Gtk.Constraint:source-attribute property of the source.

      Parameters:
      source - the value for the source property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setSourceAttribute

      public B setSourceAttribute(ConstraintAttribute sourceAttribute)
      The attribute of the Gtk.Constraint:source read by the constraint.
      Parameters:
      sourceAttribute - the value for the source-attribute property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setStrength

      public B setStrength(int strength)

      The strength of the constraint.

      The strength can be expressed either using one of the symbolic values of the Gtk.ConstraintStrength enumeration, or any positive integer value.

      Parameters:
      strength - the value for the strength property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTarget

      public B setTarget(ConstraintTarget target)

      The target of the constraint.

      The constraint will set the Gtk.Constraint:target-attribute property of the target using the Gtk.Constraint:source-attribute property of the source widget.

      Parameters:
      target - the value for the target property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTargetAttribute

      public B setTargetAttribute(ConstraintAttribute targetAttribute)
      The attribute of the Gtk.Constraint:target set by the constraint.
      Parameters:
      targetAttribute - the value for the target-attribute property
      Returns:
      the Builder instance is returned, to allow method chaining