Class PickResultBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.PickResultBuilder
The
PickResultBuilder
class constructs instances of the PickResult
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 PickResult
constructor
and returns an instance of the PickResultBuilder
.
You can use method chaining to call the builder methods for configuring the PickResult
.
Finally, invoke the build
method to generate an instance of the PickResult
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<PickResult> func) Applies a function to the PickResult instance being constructed.build()
Builds and returns an instance of thePickResult
class.static PickResultBuilder
create
(EventTarget target, double sceneX, double sceneY) Accepts the constructor arguments ofPickResult(EventTarget, double, double)
and returns an instance ofPickResultBuilder
.static PickResultBuilder
Accepts the constructor arguments ofPickResult(Node, Point3D, double)
and returns an instance ofPickResultBuilder
.static PickResultBuilder
Accepts the constructor arguments ofPickResult(Node, Point3D, double, int, Point2D)
and returns an instance ofPickResultBuilder
.static PickResultBuilder
Accepts the constructor arguments ofPickResult(Node, Point3D, double, int, Point3D, Point2D)
and returns an instance ofPickResultBuilder
.
-
Method Details
-
create
Accepts the constructor arguments ofPickResult(EventTarget, double, double)
and returns an instance ofPickResultBuilder
.- Returns:
- an instance of the
PickResultBuilder
.
-
create
Accepts the constructor arguments ofPickResult(Node, Point3D, double)
and returns an instance ofPickResultBuilder
.- Returns:
- an instance of the
PickResultBuilder
.
-
create
public static PickResultBuilder create(Node node, Point3D point, double distance, int face, Point2D texCoord) Accepts the constructor arguments ofPickResult(Node, Point3D, double, int, Point2D)
and returns an instance ofPickResultBuilder
.- Returns:
- an instance of the
PickResultBuilder
.
-
create
public static PickResultBuilder create(Node node, Point3D point, double distance, int face, Point3D normal, Point2D texCoord) Accepts the constructor arguments ofPickResult(Node, Point3D, double, int, Point3D, Point2D)
and returns an instance ofPickResultBuilder
.- Returns:
- an instance of the
PickResultBuilder
.
-
build
Builds and returns an instance of thePickResult
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
PickResult
class
-
apply
Applies a function to the PickResult instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-