Class BackgroundImageBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.BackgroundImageBuilder
The
BackgroundImageBuilder class constructs instances of the BackgroundImage 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 BackgroundImage constructor
and returns an instance of the BackgroundImageBuilder.
You can use method chaining to call the builder methods for configuring the BackgroundImage.
Finally, invoke the build method to generate an instance of the BackgroundImage 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<BackgroundImage> func) Applies a function to the BackgroundImage instance being constructed.build()Builds and returns an instance of theBackgroundImageclass.static BackgroundImageBuildercreate(Image image, BackgroundRepeat repeatX, BackgroundRepeat repeatY, BackgroundPosition position, BackgroundSize size) Accepts the constructor arguments ofBackgroundImage(Image, BackgroundRepeat, BackgroundRepeat, BackgroundPosition, BackgroundSize)and returns an instance ofBackgroundImageBuilder.
-
Method Details
-
create
public static BackgroundImageBuilder create(Image image, BackgroundRepeat repeatX, BackgroundRepeat repeatY, BackgroundPosition position, BackgroundSize size) Accepts the constructor arguments ofBackgroundImage(Image, BackgroundRepeat, BackgroundRepeat, BackgroundPosition, BackgroundSize)and returns an instance ofBackgroundImageBuilder.- Returns:
- an instance of the
BackgroundImageBuilder.
-
build
Builds and returns an instance of theBackgroundImageclass.Intermediate builder methods are not evaluated until the
buildmethod is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
BackgroundImageclass
-
apply
Applies a function to the BackgroundImage instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-