Class BackgroundPositionBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.BackgroundPositionBuilder
The
BackgroundPositionBuilder class constructs instances of the BackgroundPosition 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 BackgroundPosition constructor
and returns an instance of the BackgroundPositionBuilder.
You can use method chaining to call the builder methods for configuring the BackgroundPosition.
Finally, invoke the build method to generate an instance of the BackgroundPosition 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<BackgroundPosition> func) Applies a function to the BackgroundPosition instance being constructed.build()Builds and returns an instance of theBackgroundPositionclass.static BackgroundPositionBuildercreate(Side horizontalSide, double horizontalPosition, boolean horizontalAsPercentage, Side verticalSide, double verticalPosition, boolean verticalAsPercentage) Accepts the constructor arguments ofBackgroundPosition(Side, double, boolean, Side, double, boolean)and returns an instance ofBackgroundPositionBuilder.
-
Method Details
-
create
public static BackgroundPositionBuilder create(Side horizontalSide, double horizontalPosition, boolean horizontalAsPercentage, Side verticalSide, double verticalPosition, boolean verticalAsPercentage) Accepts the constructor arguments ofBackgroundPosition(Side, double, boolean, Side, double, boolean)and returns an instance ofBackgroundPositionBuilder.- Returns:
- an instance of the
BackgroundPositionBuilder.
-
build
Builds and returns an instance of theBackgroundPositionclass.Intermediate builder methods are not evaluated until the
buildmethod is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
BackgroundPositionclass
-
apply
Applies a function to the BackgroundPosition instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-