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

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

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

      public static BoxBlurBuilder create(double width, double height, int iterations)
      Accepts the constructor arguments of BoxBlur(double, double, int) and returns an instance of BoxBlurBuilder.
      Returns:
      an instance of the BoxBlurBuilder.
    • build

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

      public BoxBlurBuilder apply(Consumer<BoxBlur> func)
      Applies a function to the BoxBlur instance being constructed. Most operations on the instance can be performed using this method.
      Returns:
      builder instance
    • height

      public BoxBlurBuilder height(double value)
      A builder method that invokes the setHeight method on the instance being constructed.
      Returns:
      builder instance
    • input

      public BoxBlurBuilder input(Effect value)
      A builder method that invokes the setInput method on the instance being constructed.
      Returns:
      builder instance
    • iterations

      public BoxBlurBuilder iterations(int value)
      A builder method that invokes the setIterations method on the instance being constructed.
      Returns:
      builder instance
    • width

      public BoxBlurBuilder width(double value)
      A builder method that invokes the setWidth method on the instance being constructed.
      Returns:
      builder instance
    • heightPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.heightProperty().bind(anotherProperty))
      
      // Use shorthand form
      .heightPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • inputPropertyApply

      public BoxBlurBuilder inputPropertyApply(Consumer<ObjectProperty<Effect>> op)
      Applies a function to the inputProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.inputProperty().bind(anotherProperty))
      
      // Use shorthand form
      .inputPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • iterationsPropertyApply

      public BoxBlurBuilder iterationsPropertyApply(Consumer<IntegerProperty> op)
      Applies a function to the iterationsProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.iterationsProperty().bind(anotherProperty))
      
      // Use shorthand form
      .iterationsPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • widthPropertyApply

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

      Example:

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