Class LightSpotBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.LightSpotBuilder
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 Summary
Modifier and TypeMethodDescriptionapply(Consumer<Light.Spot> func) Applies a function to the Spot instance being constructed.build()Builds and returns an instance of theSpotclass.A builder method that invokes thesetColormethod on the instance being constructed.Applies a function to thecolorPropertyof the instance being constructed.static LightSpotBuildercreate()Returns an instance of theLightSpotBuilder.static LightSpotBuilderAccepts the constructor arguments ofSpot(double, double, double, double, Color)and returns an instance ofLightSpotBuilder.pointsAtX(double value) A builder method that invokes thesetPointsAtXmethod on the instance being constructed.Applies a function to thepointsAtXPropertyof the instance being constructed.pointsAtY(double value) A builder method that invokes thesetPointsAtYmethod on the instance being constructed.Applies a function to thepointsAtYPropertyof the instance being constructed.pointsAtZ(double value) A builder method that invokes thesetPointsAtZmethod on the instance being constructed.Applies a function to thepointsAtZPropertyof the instance being constructed.specularExponent(double value) A builder method that invokes thesetSpecularExponentmethod on the instance being constructed.Applies a function to thespecularExponentPropertyof the instance being constructed.x(double value) A builder method that invokes thesetXmethod on the instance being constructed.Applies a function to thexPropertyof the instance being constructed.y(double value) A builder method that invokes thesetYmethod on the instance being constructed.Applies a function to theyPropertyof the instance being constructed.z(double value) A builder method that invokes thesetZmethod on the instance being constructed.Applies a function to thezPropertyof the instance being constructed.
-
Method Details
-
create
Returns an instance of theLightSpotBuilder.- 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 ofSpot(double, double, double, double, Color)and returns an instance ofLightSpotBuilder.- Returns:
- an instance of the
LightSpotBuilder.
-
build
-
apply
Applies a function to the Spot instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
color
A builder method that invokes thesetColormethod on the instance being constructed.- Returns:
- builder instance
-
pointsAtX
A builder method that invokes thesetPointsAtXmethod on the instance being constructed.- Returns:
- builder instance
-
pointsAtY
A builder method that invokes thesetPointsAtYmethod on the instance being constructed.- Returns:
- builder instance
-
pointsAtZ
A builder method that invokes thesetPointsAtZmethod on the instance being constructed.- Returns:
- builder instance
-
specularExponent
A builder method that invokes thesetSpecularExponentmethod on the instance being constructed.- Returns:
- builder instance
-
x
A builder method that invokes thesetXmethod on the instance being constructed.- Returns:
- builder instance
-
y
A builder method that invokes thesetYmethod on the instance being constructed.- Returns:
- builder instance
-
z
A builder method that invokes thesetZmethod on the instance being constructed.- 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
-
pointsAtXPropertyApply
Applies a function to thepointsAtXPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.pointsAtXProperty().bind(anotherProperty)) // Use shorthand form .pointsAtXPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
pointsAtYPropertyApply
Applies a function to thepointsAtYPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.pointsAtYProperty().bind(anotherProperty)) // Use shorthand form .pointsAtYPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
pointsAtZPropertyApply
Applies a function to thepointsAtZPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.pointsAtZProperty().bind(anotherProperty)) // Use shorthand form .pointsAtZPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
specularExponentPropertyApply
Applies a function to thespecularExponentPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.specularExponentProperty().bind(anotherProperty)) // Use shorthand form .specularExponentPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
xPropertyApply
-
yPropertyApply
-
zPropertyApply
-