Class DisplacementMapBuilder

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

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

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

      public static DisplacementMapBuilder create(FloatMap mapData)
      Accepts the constructor arguments of DisplacementMap(FloatMap) and returns an instance of DisplacementMapBuilder.
      Returns:
      an instance of the DisplacementMapBuilder.
    • create

      public static DisplacementMapBuilder create(FloatMap mapData, double offsetX, double offsetY, double scaleX, double scaleY)
      Accepts the constructor arguments of DisplacementMap(FloatMap, double, double, double, double) and returns an instance of DisplacementMapBuilder.
      Returns:
      an instance of the DisplacementMapBuilder.
    • build

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

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

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

      public DisplacementMapBuilder mapData(FloatMap value)
      A builder method that invokes the setMapData method on the instance being constructed.
      Returns:
      builder instance
    • offsetX

      public DisplacementMapBuilder offsetX(double value)
      A builder method that invokes the setOffsetX method on the instance being constructed.
      Returns:
      builder instance
    • offsetY

      public DisplacementMapBuilder offsetY(double value)
      A builder method that invokes the setOffsetY method on the instance being constructed.
      Returns:
      builder instance
    • scaleX

      public DisplacementMapBuilder scaleX(double value)
      A builder method that invokes the setScaleX method on the instance being constructed.
      Returns:
      builder instance
    • scaleY

      public DisplacementMapBuilder scaleY(double value)
      A builder method that invokes the setScaleY method on the instance being constructed.
      Returns:
      builder instance
    • wrap

      public DisplacementMapBuilder wrap(boolean value)
      A builder method that invokes the setWrap method on the instance being constructed.
      Returns:
      builder instance
    • inputPropertyApply

      public DisplacementMapBuilder 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
    • mapDataPropertyApply

      public DisplacementMapBuilder mapDataPropertyApply(Consumer<ObjectProperty<FloatMap>> op)
      Applies a function to the mapDataProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.mapDataProperty().bind(anotherProperty))
      
      // Use shorthand form
      .mapDataPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • offsetXPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.offsetXProperty().bind(anotherProperty))
      
      // Use shorthand form
      .offsetXPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • offsetYPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.offsetYProperty().bind(anotherProperty))
      
      // Use shorthand form
      .offsetYPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • scaleXPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.scaleXProperty().bind(anotherProperty))
      
      // Use shorthand form
      .scaleXPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • scaleYPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.scaleYProperty().bind(anotherProperty))
      
      // Use shorthand form
      .scaleYPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • wrapPropertyApply

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

      Example:

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