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

public class ColumnConstraintsBuilder extends Object
The ColumnConstraintsBuilder class constructs instances of the ColumnConstraints 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 ColumnConstraints constructor and returns an instance of the ColumnConstraintsBuilder.

You can use method chaining to call the builder methods for configuring the ColumnConstraints. Finally, invoke the build method to generate an instance of the ColumnConstraints 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 ColumnConstraintsBuilder create()
      Returns an instance of the ColumnConstraintsBuilder.
      Returns:
      an instance of the ColumnConstraintsBuilder.
    • create

      public static ColumnConstraintsBuilder create(double width)
      Accepts the constructor arguments of ColumnConstraints(double) and returns an instance of ColumnConstraintsBuilder.
      Returns:
      an instance of the ColumnConstraintsBuilder.
    • create

      public static ColumnConstraintsBuilder create(double minWidth, double prefWidth, double maxWidth)
      Accepts the constructor arguments of ColumnConstraints(double, double, double) and returns an instance of ColumnConstraintsBuilder.
      Returns:
      an instance of the ColumnConstraintsBuilder.
    • create

      public static ColumnConstraintsBuilder create(double minWidth, double prefWidth, double maxWidth, Priority hgrow, HPos halignment, boolean fillWidth)
      Accepts the constructor arguments of ColumnConstraints(double, double, double, Priority, HPos, boolean) and returns an instance of ColumnConstraintsBuilder.
      Returns:
      an instance of the ColumnConstraintsBuilder.
    • build

      public ColumnConstraints build()
      Builds and returns an instance of the ColumnConstraints 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 ColumnConstraints class
    • apply

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

      public ColumnConstraintsBuilder fillWidth(boolean value)
      A builder method that invokes the setFillWidth method on the instance being constructed.
      Returns:
      builder instance
    • halignment

      public ColumnConstraintsBuilder halignment(HPos value)
      A builder method that invokes the setHalignment method on the instance being constructed.
      Returns:
      builder instance
    • hgrow

      public ColumnConstraintsBuilder hgrow(Priority value)
      A builder method that invokes the setHgrow method on the instance being constructed.
      Returns:
      builder instance
    • maxWidth

      public ColumnConstraintsBuilder maxWidth(double value)
      A builder method that invokes the setMaxWidth method on the instance being constructed.
      Returns:
      builder instance
    • minWidth

      public ColumnConstraintsBuilder minWidth(double value)
      A builder method that invokes the setMinWidth method on the instance being constructed.
      Returns:
      builder instance
    • percentWidth

      public ColumnConstraintsBuilder percentWidth(double value)
      A builder method that invokes the setPercentWidth method on the instance being constructed.
      Returns:
      builder instance
    • prefWidth

      public ColumnConstraintsBuilder prefWidth(double value)
      A builder method that invokes the setPrefWidth method on the instance being constructed.
      Returns:
      builder instance
    • fillWidthPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.fillWidthProperty().bind(anotherProperty))
      
      // Use shorthand form
      .fillWidthPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • halignmentPropertyApply

      public ColumnConstraintsBuilder halignmentPropertyApply(Consumer<ObjectProperty<HPos>> op)
      Applies a function to the halignmentProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.halignmentProperty().bind(anotherProperty))
      
      // Use shorthand form
      .halignmentPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • hgrowPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.hgrowProperty().bind(anotherProperty))
      
      // Use shorthand form
      .hgrowPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • maxWidthPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.maxWidthProperty().bind(anotherProperty))
      
      // Use shorthand form
      .maxWidthPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • minWidthPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.minWidthProperty().bind(anotherProperty))
      
      // Use shorthand form
      .minWidthPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • percentWidthPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.percentWidthProperty().bind(anotherProperty))
      
      // Use shorthand form
      .percentWidthPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • prefWidthPropertyApply

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

      Example:

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