Class LightDistantBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.LightDistantBuilder
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 Summary
Modifier and TypeMethodDescriptionapply(Consumer<Light.Distant> func) Applies a function to the Distant instance being constructed.azimuth(double value) A builder method that invokes thesetAzimuthmethod on the instance being constructed.Applies a function to theazimuthPropertyof the instance being constructed.build()Builds and returns an instance of theDistantclass.A builder method that invokes thesetColormethod on the instance being constructed.Applies a function to thecolorPropertyof the instance being constructed.static LightDistantBuildercreate()Returns an instance of theLightDistantBuilder.static LightDistantBuilderAccepts the constructor arguments ofDistant(double, double, Color)and returns an instance ofLightDistantBuilder.elevation(double value) A builder method that invokes thesetElevationmethod on the instance being constructed.Applies a function to theelevationPropertyof the instance being constructed.
-
Method Details
-
create
Returns an instance of theLightDistantBuilder.- Returns:
- an instance of the
LightDistantBuilder.
-
create
Accepts the constructor arguments ofDistant(double, double, Color)and returns an instance ofLightDistantBuilder.- Returns:
- an instance of the
LightDistantBuilder.
-
build
-
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
A builder method that invokes thesetAzimuthmethod on the instance being constructed.- Returns:
- builder instance
-
color
A builder method that invokes thesetColormethod on the instance being constructed.- Returns:
- builder instance
-
elevation
A builder method that invokes thesetElevationmethod on the instance being constructed.- Returns:
- builder instance
-
azimuthPropertyApply
Applies a function to theazimuthPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.azimuthProperty().bind(anotherProperty)) // Use shorthand form .azimuthPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
colorPropertyApply
Applies a function to thecolorPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.colorProperty().bind(anotherProperty)) // Use shorthand form .colorPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
elevationPropertyApply
Applies a function to theelevationPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.elevationProperty().bind(anotherProperty)) // Use shorthand form .elevationPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-