Class DisplacementMapBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.DisplacementMapBuilder
The
DisplacementMapBuilder
class constructs instances of the DisplacementMap
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 DisplacementMap
constructor
and returns an instance of the DisplacementMapBuilder
.
You can use method chaining to call the builder methods for configuring the DisplacementMap
.
Finally, invoke the build
method to generate an instance of the DisplacementMap
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<DisplacementMap> func) Applies a function to the DisplacementMap instance being constructed.build()
Builds and returns an instance of theDisplacementMap
class.static DisplacementMapBuilder
create()
Returns an instance of theDisplacementMapBuilder
.static DisplacementMapBuilder
Accepts the constructor arguments ofDisplacementMap(FloatMap)
and returns an instance ofDisplacementMapBuilder
.static DisplacementMapBuilder
Accepts the constructor arguments ofDisplacementMap(FloatMap, double, double, double, double)
and returns an instance ofDisplacementMapBuilder
.A builder method that invokes thesetInput
method on the instance being constructed.Applies a function to theinputProperty
of the instance being constructed.A builder method that invokes thesetMapData
method on the instance being constructed.Applies a function to themapDataProperty
of the instance being constructed.offsetX
(double value) A builder method that invokes thesetOffsetX
method on the instance being constructed.Applies a function to theoffsetXProperty
of the instance being constructed.offsetY
(double value) A builder method that invokes thesetOffsetY
method on the instance being constructed.Applies a function to theoffsetYProperty
of the instance being constructed.scaleX
(double value) A builder method that invokes thesetScaleX
method on the instance being constructed.Applies a function to thescaleXProperty
of the instance being constructed.scaleY
(double value) A builder method that invokes thesetScaleY
method on the instance being constructed.Applies a function to thescaleYProperty
of the instance being constructed.wrap
(boolean value) A builder method that invokes thesetWrap
method on the instance being constructed.Applies a function to thewrapProperty
of the instance being constructed.
-
Method Details
-
create
Returns an instance of theDisplacementMapBuilder
.- Returns:
- an instance of the
DisplacementMapBuilder
.
-
create
Accepts the constructor arguments ofDisplacementMap(FloatMap)
and returns an instance ofDisplacementMapBuilder
.- Returns:
- an instance of the
DisplacementMapBuilder
.
-
create
public static DisplacementMapBuilder create(FloatMap mapData, double offsetX, double offsetY, double scaleX, double scaleY) Accepts the constructor arguments ofDisplacementMap(FloatMap, double, double, double, double)
and returns an instance ofDisplacementMapBuilder
.- Returns:
- an instance of the
DisplacementMapBuilder
.
-
build
Builds and returns an instance of theDisplacementMap
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
DisplacementMap
class
-
apply
Applies a function to the DisplacementMap instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
input
A builder method that invokes thesetInput
method on the instance being constructed.- Returns:
- builder instance
-
mapData
A builder method that invokes thesetMapData
method on the instance being constructed.- Returns:
- builder instance
-
offsetX
A builder method that invokes thesetOffsetX
method on the instance being constructed.- Returns:
- builder instance
-
offsetY
A builder method that invokes thesetOffsetY
method on the instance being constructed.- Returns:
- builder instance
-
scaleX
A builder method that invokes thesetScaleX
method on the instance being constructed.- Returns:
- builder instance
-
scaleY
A builder method that invokes thesetScaleY
method on the instance being constructed.- Returns:
- builder instance
-
wrap
A builder method that invokes thesetWrap
method on the instance being constructed.- Returns:
- builder instance
-
inputPropertyApply
Applies a function to theinputProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.inputProperty().bind(anotherProperty)) // Use shorthand form .inputPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
mapDataPropertyApply
Applies a function to themapDataProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.mapDataProperty().bind(anotherProperty)) // Use shorthand form .mapDataPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
offsetXPropertyApply
Applies a function to theoffsetXProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.offsetXProperty().bind(anotherProperty)) // Use shorthand form .offsetXPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
offsetYPropertyApply
Applies a function to theoffsetYProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.offsetYProperty().bind(anotherProperty)) // Use shorthand form .offsetYPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
scaleXPropertyApply
Applies a function to thescaleXProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.scaleXProperty().bind(anotherProperty)) // Use shorthand form .scaleXPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
scaleYPropertyApply
Applies a function to thescaleYProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.scaleYProperty().bind(anotherProperty)) // Use shorthand form .scaleYPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
wrapPropertyApply
Applies a function to thewrapProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.wrapProperty().bind(anotherProperty)) // Use shorthand form .wrapPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-