Class ImageCursorBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.ImageCursorBuilder
The
ImageCursorBuilder class constructs instances of the ImageCursor 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 ImageCursor constructor
and returns an instance of the ImageCursorBuilder.
You can use method chaining to call the builder methods for configuring the ImageCursor.
Finally, invoke the build method to generate an instance of the ImageCursor 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<ImageCursor> func) Applies a function to the ImageCursor instance being constructed.build()Builds and returns an instance of theImageCursorclass.static ImageCursorBuildercreate()Returns an instance of theImageCursorBuilder.static ImageCursorBuilderAccepts the constructor arguments ofImageCursor(Image)and returns an instance ofImageCursorBuilder.static ImageCursorBuilderAccepts the constructor arguments ofImageCursor(Image, double, double)and returns an instance ofImageCursorBuilder.Applies a function to thehotspotXPropertyof the instance being constructed.Applies a function to thehotspotYPropertyof the instance being constructed.Applies a function to theimagePropertyof the instance being constructed.
-
Method Details
-
create
Returns an instance of theImageCursorBuilder.- Returns:
- an instance of the
ImageCursorBuilder.
-
create
Accepts the constructor arguments ofImageCursor(Image)and returns an instance ofImageCursorBuilder.- Returns:
- an instance of the
ImageCursorBuilder.
-
create
Accepts the constructor arguments ofImageCursor(Image, double, double)and returns an instance ofImageCursorBuilder.- Returns:
- an instance of the
ImageCursorBuilder.
-
build
Builds and returns an instance of theImageCursorclass.Intermediate builder methods are not evaluated until the
buildmethod is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
ImageCursorclass
-
apply
Applies a function to the ImageCursor instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
hotspotXPropertyApply
Applies a function to thehotspotXPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.hotspotXProperty().bind(anotherProperty)) // Use shorthand form .hotspotXPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
hotspotYPropertyApply
Applies a function to thehotspotYPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.hotspotYProperty().bind(anotherProperty)) // Use shorthand form .hotspotYPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
imagePropertyApply
Applies a function to theimagePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.imageProperty().bind(anotherProperty)) // Use shorthand form .imagePropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-