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 theDisplacementMapclass.static DisplacementMapBuildercreate()Returns an instance of theDisplacementMapBuilder.static DisplacementMapBuilderAccepts the constructor arguments ofDisplacementMap(FloatMap)and returns an instance ofDisplacementMapBuilder.static DisplacementMapBuilderAccepts the constructor arguments ofDisplacementMap(FloatMap, double, double, double, double)and returns an instance ofDisplacementMapBuilder.A builder method that invokes thesetInputmethod on the instance being constructed.Applies a function to theinputPropertyof the instance being constructed.A builder method that invokes thesetMapDatamethod on the instance being constructed.Applies a function to themapDataPropertyof the instance being constructed.offsetX(double value) A builder method that invokes thesetOffsetXmethod on the instance being constructed.Applies a function to theoffsetXPropertyof the instance being constructed.offsetY(double value) A builder method that invokes thesetOffsetYmethod on the instance being constructed.Applies a function to theoffsetYPropertyof the instance being constructed.scaleX(double value) A builder method that invokes thesetScaleXmethod on the instance being constructed.Applies a function to thescaleXPropertyof the instance being constructed.scaleY(double value) A builder method that invokes thesetScaleYmethod on the instance being constructed.Applies a function to thescaleYPropertyof the instance being constructed.wrap(boolean value) A builder method that invokes thesetWrapmethod on the instance being constructed.Applies a function to thewrapPropertyof 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 theDisplacementMapclass.Intermediate builder methods are not evaluated until the
buildmethod is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
DisplacementMapclass
-
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 thesetInputmethod on the instance being constructed.- Returns:
- builder instance
-
mapData
A builder method that invokes thesetMapDatamethod on the instance being constructed.- Returns:
- builder instance
-
offsetX
A builder method that invokes thesetOffsetXmethod on the instance being constructed.- Returns:
- builder instance
-
offsetY
A builder method that invokes thesetOffsetYmethod on the instance being constructed.- Returns:
- builder instance
-
scaleX
A builder method that invokes thesetScaleXmethod on the instance being constructed.- Returns:
- builder instance
-
scaleY
A builder method that invokes thesetScaleYmethod on the instance being constructed.- Returns:
- builder instance
-
wrap
A builder method that invokes thesetWrapmethod on the instance being constructed.- Returns:
- builder instance
-
inputPropertyApply
Applies a function to theinputPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.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 themapDataPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.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 theoffsetXPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.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 theoffsetYPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.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 thescaleXPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.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 thescaleYPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.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 thewrapPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.wrapProperty().bind(anotherProperty)) // Use shorthand form .wrapPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-