Class RowConstraintsBuilder

java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.RowConstraintsBuilder

public class RowConstraintsBuilder extends Object
The RowConstraintsBuilder class constructs instances of the RowConstraints class and offers a fluent interface for creating and configuring it.

This class includes a static create method that accepts the same arguments as the original RowConstraints constructor and returns an instance of the RowConstraintsBuilder.

You can use method chaining to call the builder methods for configuring the RowConstraints. Finally, invoke the build method to generate an instance of the RowConstraints class.

Note that intermediate builder methods are not evaluated until the build method is called, meaning they are evaluated lazily.

Author:
Hidekazu Kubota <hidekazu.kubota@gmail.com>
  • Method Details

    • create

      public static RowConstraintsBuilder create()
      Returns an instance of the RowConstraintsBuilder.
      Returns:
      an instance of the RowConstraintsBuilder.
    • create

      public static RowConstraintsBuilder create(double height)
      Accepts the constructor arguments of RowConstraints(double) and returns an instance of RowConstraintsBuilder.
      Returns:
      an instance of the RowConstraintsBuilder.
    • create

      public static RowConstraintsBuilder create(double minHeight, double prefHeight, double maxHeight)
      Accepts the constructor arguments of RowConstraints(double, double, double) and returns an instance of RowConstraintsBuilder.
      Returns:
      an instance of the RowConstraintsBuilder.
    • create

      public static RowConstraintsBuilder create(double minHeight, double prefHeight, double maxHeight, Priority vgrow, VPos valignment, boolean fillHeight)
      Accepts the constructor arguments of RowConstraints(double, double, double, Priority, VPos, boolean) and returns an instance of RowConstraintsBuilder.
      Returns:
      an instance of the RowConstraintsBuilder.
    • build

      public RowConstraints build()
      Builds and returns an instance of the RowConstraints class.

      Intermediate builder methods are not evaluated until the build method is called; in other words, they are evaluated lazily.

      Returns:
      new instance of the RowConstraints class
    • apply

      Applies a function to the RowConstraints instance being constructed. Most operations on the instance can be performed using this method.
      Returns:
      builder instance
    • fillHeight

      public RowConstraintsBuilder fillHeight(boolean value)
      A builder method that invokes the setFillHeight method on the instance being constructed.
      Returns:
      builder instance
    • maxHeight

      public RowConstraintsBuilder maxHeight(double value)
      A builder method that invokes the setMaxHeight method on the instance being constructed.
      Returns:
      builder instance
    • minHeight

      public RowConstraintsBuilder minHeight(double value)
      A builder method that invokes the setMinHeight method on the instance being constructed.
      Returns:
      builder instance
    • percentHeight

      public RowConstraintsBuilder percentHeight(double value)
      A builder method that invokes the setPercentHeight method on the instance being constructed.
      Returns:
      builder instance
    • prefHeight

      public RowConstraintsBuilder prefHeight(double value)
      A builder method that invokes the setPrefHeight method on the instance being constructed.
      Returns:
      builder instance
    • valignment

      public RowConstraintsBuilder valignment(VPos value)
      A builder method that invokes the setValignment method on the instance being constructed.
      Returns:
      builder instance
    • vgrow

      public RowConstraintsBuilder vgrow(Priority value)
      A builder method that invokes the setVgrow method on the instance being constructed.
      Returns:
      builder instance
    • fillHeightPropertyApply

      public RowConstraintsBuilder fillHeightPropertyApply(Consumer<BooleanProperty> op)
      Applies a function to the fillHeightProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.fillHeightProperty().bind(anotherProperty))
      
      // Use shorthand form
      .fillHeightPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • maxHeightPropertyApply

      public RowConstraintsBuilder maxHeightPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the maxHeightProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.maxHeightProperty().bind(anotherProperty))
      
      // Use shorthand form
      .maxHeightPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • minHeightPropertyApply

      public RowConstraintsBuilder minHeightPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the minHeightProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.minHeightProperty().bind(anotherProperty))
      
      // Use shorthand form
      .minHeightPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • percentHeightPropertyApply

      public RowConstraintsBuilder percentHeightPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the percentHeightProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.percentHeightProperty().bind(anotherProperty))
      
      // Use shorthand form
      .percentHeightPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • prefHeightPropertyApply

      public RowConstraintsBuilder prefHeightPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the prefHeightProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.prefHeightProperty().bind(anotherProperty))
      
      // Use shorthand form
      .prefHeightPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • valignmentPropertyApply

      public RowConstraintsBuilder valignmentPropertyApply(Consumer<ObjectProperty<VPos>> op)
      Applies a function to the valignmentProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.valignmentProperty().bind(anotherProperty))
      
      // Use shorthand form
      .valignmentPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • vgrowPropertyApply

      public RowConstraintsBuilder vgrowPropertyApply(Consumer<ObjectProperty<Priority>> op)
      Applies a function to the vgrowProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.vgrowProperty().bind(anotherProperty))
      
      // Use shorthand form
      .vgrowPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance