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

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

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

      public static MotionBlurBuilder create(double angle, double radius)
      Accepts the constructor arguments of MotionBlur(double, double) and returns an instance of MotionBlurBuilder.
      Returns:
      an instance of the MotionBlurBuilder.
    • build

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

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

      public MotionBlurBuilder angle(double value)
      A builder method that invokes the setAngle method on the instance being constructed.
      Returns:
      builder instance
    • input

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

      public MotionBlurBuilder radius(double value)
      A builder method that invokes the setRadius method on the instance being constructed.
      Returns:
      builder instance
    • anglePropertyApply

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

      Example:

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

      public MotionBlurBuilder 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
    • radiusPropertyApply

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

      Example:

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