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 theSpot
class.A builder method that invokes thesetColor
method on the instance being constructed.Applies a function to thecolorProperty
of the instance being constructed.static LightSpotBuilder
create()
Returns an instance of theLightSpotBuilder
.static LightSpotBuilder
Accepts the constructor arguments ofSpot(double, double, double, double, Color)
and returns an instance ofLightSpotBuilder
.pointsAtX
(double value) A builder method that invokes thesetPointsAtX
method on the instance being constructed.Applies a function to thepointsAtXProperty
of the instance being constructed.pointsAtY
(double value) A builder method that invokes thesetPointsAtY
method on the instance being constructed.Applies a function to thepointsAtYProperty
of the instance being constructed.pointsAtZ
(double value) A builder method that invokes thesetPointsAtZ
method on the instance being constructed.Applies a function to thepointsAtZProperty
of the instance being constructed.specularExponent
(double value) A builder method that invokes thesetSpecularExponent
method on the instance being constructed.Applies a function to thespecularExponentProperty
of the instance being constructed.x
(double value) A builder method that invokes thesetX
method on the instance being constructed.Applies a function to thexProperty
of the instance being constructed.y
(double value) A builder method that invokes thesetY
method on the instance being constructed.Applies a function to theyProperty
of the instance being constructed.z
(double value) A builder method that invokes thesetZ
method on the instance being constructed.Applies a function to thezProperty
of 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
Builds and returns an instance of theSpot
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
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 thesetColor
method on the instance being constructed.- Returns:
- builder instance
-
pointsAtX
A builder method that invokes thesetPointsAtX
method on the instance being constructed.- Returns:
- builder instance
-
pointsAtY
A builder method that invokes thesetPointsAtY
method on the instance being constructed.- Returns:
- builder instance
-
pointsAtZ
A builder method that invokes thesetPointsAtZ
method on the instance being constructed.- Returns:
- builder instance
-
specularExponent
A builder method that invokes thesetSpecularExponent
method on the instance being constructed.- Returns:
- builder instance
-
x
A builder method that invokes thesetX
method on the instance being constructed.- Returns:
- builder instance
-
y
A builder method that invokes thesetY
method on the instance being constructed.- Returns:
- builder instance
-
z
A builder method that invokes thesetZ
method on the instance being constructed.- Returns:
- builder instance
-
colorPropertyApply
Applies a function to thecolorProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.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 thepointsAtXProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.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 thepointsAtYProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.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 thepointsAtZProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.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 thespecularExponentProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.specularExponentProperty().bind(anotherProperty)) // Use shorthand form .specularExponentPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
xPropertyApply
Applies a function to thexProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.xProperty().bind(anotherProperty)) // Use shorthand form .xPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
yPropertyApply
Applies a function to theyProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.yProperty().bind(anotherProperty)) // Use shorthand form .yPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
zPropertyApply
Applies a function to thezProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.zProperty().bind(anotherProperty)) // Use shorthand form .zPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-