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

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

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

      public static LightingBuilder create(Light light)
      Accepts the constructor arguments of Lighting(Light) and returns an instance of LightingBuilder.
      Returns:
      an instance of the LightingBuilder.
    • build

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

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

      public LightingBuilder bumpInput(Effect value)
      A builder method that invokes the setBumpInput method on the instance being constructed.
      Returns:
      builder instance
    • contentInput

      public LightingBuilder contentInput(Effect value)
      A builder method that invokes the setContentInput method on the instance being constructed.
      Returns:
      builder instance
    • diffuseConstant

      public LightingBuilder diffuseConstant(double value)
      A builder method that invokes the setDiffuseConstant method on the instance being constructed.
      Returns:
      builder instance
    • light

      public LightingBuilder light(Light value)
      A builder method that invokes the setLight method on the instance being constructed.
      Returns:
      builder instance
    • specularConstant

      public LightingBuilder specularConstant(double value)
      A builder method that invokes the setSpecularConstant method on the instance being constructed.
      Returns:
      builder instance
    • specularExponent

      public LightingBuilder specularExponent(double value)
      A builder method that invokes the setSpecularExponent method on the instance being constructed.
      Returns:
      builder instance
    • surfaceScale

      public LightingBuilder surfaceScale(double value)
      A builder method that invokes the setSurfaceScale method on the instance being constructed.
      Returns:
      builder instance
    • bumpInputPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.bumpInputProperty().bind(anotherProperty))
      
      // Use shorthand form
      .bumpInputPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • contentInputPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.contentInputProperty().bind(anotherProperty))
      
      // Use shorthand form
      .contentInputPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • diffuseConstantPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.diffuseConstantProperty().bind(anotherProperty))
      
      // Use shorthand form
      .diffuseConstantPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • lightPropertyApply

      public LightingBuilder lightPropertyApply(Consumer<ObjectProperty<Light>> op)
      Applies a function to the lightProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.lightProperty().bind(anotherProperty))
      
      // Use shorthand form
      .lightPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • specularConstantPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.specularConstantProperty().bind(anotherProperty))
      
      // Use shorthand form
      .specularConstantPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • specularExponentPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.specularExponentProperty().bind(anotherProperty))
      
      // Use shorthand form
      .specularExponentPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • surfaceScalePropertyApply

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

      Example:

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