Class PhongMaterialBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.PhongMaterialBuilder
The
PhongMaterialBuilder
class constructs instances of the PhongMaterial
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 PhongMaterial
constructor
and returns an instance of the PhongMaterialBuilder
.
You can use method chaining to call the builder methods for configuring the PhongMaterial
.
Finally, invoke the build
method to generate an instance of the PhongMaterial
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<PhongMaterial> func) Applies a function to the PhongMaterial instance being constructed.build()
Builds and returns an instance of thePhongMaterial
class.A builder method that invokes thesetBumpMap
method on the instance being constructed.Applies a function to thebumpMapProperty
of the instance being constructed.static PhongMaterialBuilder
create()
Returns an instance of thePhongMaterialBuilder
.static PhongMaterialBuilder
Accepts the constructor arguments ofPhongMaterial(Color)
and returns an instance ofPhongMaterialBuilder
.static PhongMaterialBuilder
create
(Color diffuseColor, Image diffuseMap, Image specularMap, Image bumpMap, Image selfIlluminationMap) Accepts the constructor arguments ofPhongMaterial(Color, Image, Image, Image, Image)
and returns an instance ofPhongMaterialBuilder
.diffuseColor
(Color value) A builder method that invokes thesetDiffuseColor
method on the instance being constructed.Applies a function to thediffuseColorProperty
of the instance being constructed.diffuseMap
(Image value) A builder method that invokes thesetDiffuseMap
method on the instance being constructed.Applies a function to thediffuseMapProperty
of the instance being constructed.selfIlluminationMap
(Image value) A builder method that invokes thesetSelfIlluminationMap
method on the instance being constructed.Applies a function to theselfIlluminationMapProperty
of the instance being constructed.specularColor
(Color value) A builder method that invokes thesetSpecularColor
method on the instance being constructed.Applies a function to thespecularColorProperty
of the instance being constructed.specularMap
(Image value) A builder method that invokes thesetSpecularMap
method on the instance being constructed.Applies a function to thespecularMapProperty
of the instance being constructed.specularPower
(double value) A builder method that invokes thesetSpecularPower
method on the instance being constructed.Applies a function to thespecularPowerProperty
of the instance being constructed.
-
Method Details
-
create
Returns an instance of thePhongMaterialBuilder
.- Returns:
- an instance of the
PhongMaterialBuilder
.
-
create
Accepts the constructor arguments ofPhongMaterial(Color)
and returns an instance ofPhongMaterialBuilder
.- Returns:
- an instance of the
PhongMaterialBuilder
.
-
create
public static PhongMaterialBuilder create(Color diffuseColor, Image diffuseMap, Image specularMap, Image bumpMap, Image selfIlluminationMap) Accepts the constructor arguments ofPhongMaterial(Color, Image, Image, Image, Image)
and returns an instance ofPhongMaterialBuilder
.- Returns:
- an instance of the
PhongMaterialBuilder
.
-
build
Builds and returns an instance of thePhongMaterial
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
PhongMaterial
class
-
apply
Applies a function to the PhongMaterial instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
bumpMap
A builder method that invokes thesetBumpMap
method on the instance being constructed.- Returns:
- builder instance
-
diffuseColor
A builder method that invokes thesetDiffuseColor
method on the instance being constructed.- Returns:
- builder instance
-
diffuseMap
A builder method that invokes thesetDiffuseMap
method on the instance being constructed.- Returns:
- builder instance
-
selfIlluminationMap
A builder method that invokes thesetSelfIlluminationMap
method on the instance being constructed.- Returns:
- builder instance
-
specularColor
A builder method that invokes thesetSpecularColor
method on the instance being constructed.- Returns:
- builder instance
-
specularMap
A builder method that invokes thesetSpecularMap
method on the instance being constructed.- Returns:
- builder instance
-
specularPower
A builder method that invokes thesetSpecularPower
method on the instance being constructed.- Returns:
- builder instance
-
bumpMapPropertyApply
Applies a function to thebumpMapProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
diffuseColorPropertyApply
Applies a function to thediffuseColorProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
diffuseMapPropertyApply
Applies a function to thediffuseMapProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
selfIlluminationMapPropertyApply
Applies a function to theselfIlluminationMapProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
specularColorPropertyApply
Applies a function to thespecularColorProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
specularMapPropertyApply
Applies a function to thespecularMapProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
specularPowerPropertyApply
Applies a function to thespecularPowerProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-