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

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

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

      public static LightDistantBuilder create(double azimuth, double elevation, Color color)
      Accepts the constructor arguments of Distant(double, double, Color) and returns an instance of LightDistantBuilder.
      Returns:
      an instance of the LightDistantBuilder.
    • build

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

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

      public LightDistantBuilder azimuth(double value)
      A builder method that invokes the setAzimuth method on the instance being constructed.
      Returns:
      builder instance
    • color

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

      public LightDistantBuilder elevation(double value)
      A builder method that invokes the setElevation method on the instance being constructed.
      Returns:
      builder instance
    • azimuthPropertyApply

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

      Example:

      Returns:
      builder instance
    • colorPropertyApply

      public LightDistantBuilder 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:

      Returns:
      builder instance
    • elevationPropertyApply

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

      Example:

      Returns:
      builder instance