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

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

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

      public static SepiaToneBuilder create(double level)
      Accepts the constructor arguments of SepiaTone(double) and returns an instance of SepiaToneBuilder.
      Returns:
      an instance of the SepiaToneBuilder.
    • build

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

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

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

      public SepiaToneBuilder level(double value)
      A builder method that invokes the setLevel method on the instance being constructed.
      Returns:
      builder instance
    • inputPropertyApply

      public SepiaToneBuilder 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
    • levelPropertyApply

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

      Example:

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