Class LightingBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.LightingBuilder
The
LightingBuilder class constructs instances of the Lighting 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 Lighting constructor
and returns an instance of the LightingBuilder.
You can use method chaining to call the builder methods for configuring the Lighting.
Finally, invoke the build method to generate an instance of the Lighting 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 TypeMethodDescriptionApplies a function to the Lighting instance being constructed.build()Builds and returns an instance of theLightingclass.A builder method that invokes thesetBumpInputmethod on the instance being constructed.Applies a function to thebumpInputPropertyof the instance being constructed.contentInput(Effect value) A builder method that invokes thesetContentInputmethod on the instance being constructed.Applies a function to thecontentInputPropertyof the instance being constructed.static LightingBuildercreate()Returns an instance of theLightingBuilder.static LightingBuilderAccepts the constructor arguments ofLighting(Light)and returns an instance ofLightingBuilder.diffuseConstant(double value) A builder method that invokes thesetDiffuseConstantmethod on the instance being constructed.Applies a function to thediffuseConstantPropertyof the instance being constructed.A builder method that invokes thesetLightmethod on the instance being constructed.Applies a function to thelightPropertyof the instance being constructed.specularConstant(double value) A builder method that invokes thesetSpecularConstantmethod on the instance being constructed.Applies a function to thespecularConstantPropertyof 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.surfaceScale(double value) A builder method that invokes thesetSurfaceScalemethod on the instance being constructed.Applies a function to thesurfaceScalePropertyof the instance being constructed.
-
Method Details
-
create
Returns an instance of theLightingBuilder.- Returns:
- an instance of the
LightingBuilder.
-
create
Accepts the constructor arguments ofLighting(Light)and returns an instance ofLightingBuilder.- Returns:
- an instance of the
LightingBuilder.
-
build
-
apply
Applies a function to the Lighting instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
bumpInput
A builder method that invokes thesetBumpInputmethod on the instance being constructed.- Returns:
- builder instance
-
contentInput
A builder method that invokes thesetContentInputmethod on the instance being constructed.- Returns:
- builder instance
-
diffuseConstant
A builder method that invokes thesetDiffuseConstantmethod on the instance being constructed.- Returns:
- builder instance
-
light
A builder method that invokes thesetLightmethod on the instance being constructed.- Returns:
- builder instance
-
specularConstant
A builder method that invokes thesetSpecularConstantmethod on the instance being constructed.- Returns:
- builder instance
-
specularExponent
A builder method that invokes thesetSpecularExponentmethod on the instance being constructed.- Returns:
- builder instance
-
surfaceScale
A builder method that invokes thesetSurfaceScalemethod on the instance being constructed.- Returns:
- builder instance
-
bumpInputPropertyApply
Applies a function to thebumpInputPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.bumpInputProperty().bind(anotherProperty)) // Use shorthand form .bumpInputPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
contentInputPropertyApply
Applies a function to thecontentInputPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.contentInputProperty().bind(anotherProperty)) // Use shorthand form .contentInputPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
diffuseConstantPropertyApply
Applies a function to thediffuseConstantPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.diffuseConstantProperty().bind(anotherProperty)) // Use shorthand form .diffuseConstantPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
lightPropertyApply
Applies a function to thelightPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.lightProperty().bind(anotherProperty)) // Use shorthand form .lightPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
specularConstantPropertyApply
Applies a function to thespecularConstantPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.specularConstantProperty().bind(anotherProperty)) // Use shorthand form .specularConstantPropertyApply(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
-
surfaceScalePropertyApply
Applies a function to thesurfaceScalePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.surfaceScaleProperty().bind(anotherProperty)) // Use shorthand form .surfaceScalePropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-