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

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

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

      public static BlendBuilder create(BlendMode mode)
      Accepts the constructor arguments of Blend(BlendMode) and returns an instance of BlendBuilder.
      Returns:
      an instance of the BlendBuilder.
    • create

      public static BlendBuilder create(BlendMode mode, Effect bottomInput, Effect topInput)
      Accepts the constructor arguments of Blend(BlendMode, Effect, Effect) and returns an instance of BlendBuilder.
      Returns:
      an instance of the BlendBuilder.
    • build

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

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

      public BlendBuilder bottomInput(Effect value)
      A builder method that invokes the setBottomInput method on the instance being constructed.
      Returns:
      builder instance
    • mode

      public BlendBuilder mode(BlendMode value)
      A builder method that invokes the setMode method on the instance being constructed.
      Returns:
      builder instance
    • opacity

      public BlendBuilder opacity(double value)
      A builder method that invokes the setOpacity method on the instance being constructed.
      Returns:
      builder instance
    • topInput

      public BlendBuilder topInput(Effect value)
      A builder method that invokes the setTopInput method on the instance being constructed.
      Returns:
      builder instance
    • bottomInputPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.bottomInputProperty().bind(anotherProperty))
      
      // Use shorthand form
      .bottomInputPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • modePropertyApply

      public BlendBuilder modePropertyApply(Consumer<ObjectProperty<BlendMode>> op)
      Applies a function to the modeProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.modeProperty().bind(anotherProperty))
      
      // Use shorthand form
      .modePropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • opacityPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.opacityProperty().bind(anotherProperty))
      
      // Use shorthand form
      .opacityPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • topInputPropertyApply

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

      Example:

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