Class LightPointBuilder

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

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

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

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

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

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

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

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

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

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

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

      public LightPointBuilder 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 LightPointBuilder 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 LightPointBuilder 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