Class LightSpotBuilder

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

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

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

      public static LightSpotBuilder create(double x, double y, double z, double specularExponent, Color color)
      Accepts the constructor arguments of Spot(double, double, double, double, Color) and returns an instance of LightSpotBuilder.
      Returns:
      an instance of the LightSpotBuilder.
    • build

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

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

      public LightSpotBuilder color(Color value)
      A builder method that invokes the setColor method on the instance being constructed.
      Returns:
      builder instance
    • pointsAtX

      public LightSpotBuilder pointsAtX(double value)
      A builder method that invokes the setPointsAtX method on the instance being constructed.
      Returns:
      builder instance
    • pointsAtY

      public LightSpotBuilder pointsAtY(double value)
      A builder method that invokes the setPointsAtY method on the instance being constructed.
      Returns:
      builder instance
    • pointsAtZ

      public LightSpotBuilder pointsAtZ(double value)
      A builder method that invokes the setPointsAtZ method on the instance being constructed.
      Returns:
      builder instance
    • specularExponent

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

      public LightSpotBuilder x(double value)
      A builder method that invokes the setX method on the instance being constructed.
      Returns:
      builder instance
    • y

      public LightSpotBuilder y(double value)
      A builder method that invokes the setY method on the instance being constructed.
      Returns:
      builder instance
    • z

      public LightSpotBuilder z(double value)
      A builder method that invokes the setZ method on the instance being constructed.
      Returns:
      builder instance
    • colorPropertyApply

      public LightSpotBuilder colorPropertyApply(Consumer<ObjectProperty<Color>> op)
      Applies a function to the colorProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.colorProperty().bind(anotherProperty))
      
      // Use shorthand form
      .colorPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • pointsAtXPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.pointsAtXProperty().bind(anotherProperty))
      
      // Use shorthand form
      .pointsAtXPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • pointsAtYPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.pointsAtYProperty().bind(anotherProperty))
      
      // Use shorthand form
      .pointsAtYPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • pointsAtZPropertyApply

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

      Example:

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

      public LightSpotBuilder 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
    • xPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.xProperty().bind(anotherProperty))
      
      // Use shorthand form
      .xPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • yPropertyApply

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

      Example:

      // Use apply
      .apply(obj -> obj.yProperty().bind(anotherProperty))
      
      // Use shorthand form
      .yPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • zPropertyApply

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

      Example:

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