Class CornerRadiiBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.CornerRadiiBuilder
The
CornerRadiiBuilder class constructs instances of the CornerRadii 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 CornerRadii constructor
and returns an instance of the CornerRadiiBuilder.
You can use method chaining to call the builder methods for configuring the CornerRadii.
Finally, invoke the build method to generate an instance of the CornerRadii 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<CornerRadii> func) Applies a function to the CornerRadii instance being constructed.build()Builds and returns an instance of theCornerRadiiclass.static CornerRadiiBuildercreate(double radius) Accepts the constructor arguments ofCornerRadii(double)and returns an instance ofCornerRadiiBuilder.static CornerRadiiBuildercreate(double radius, boolean asPercent) Accepts the constructor arguments ofCornerRadii(double, boolean)and returns an instance ofCornerRadiiBuilder.static CornerRadiiBuildercreate(double topLeft, double topRight, double bottomRight, double bottomLeft, boolean asPercent) Accepts the constructor arguments ofCornerRadii(double, double, double, double, boolean)and returns an instance ofCornerRadiiBuilder.static CornerRadiiBuildercreate(double topLeftHorizontalRadius, double topLeftVerticalRadius, double topRightVerticalRadius, double topRightHorizontalRadius, double bottomRightHorizontalRadius, double bottomRightVerticalRadius, double bottomLeftVerticalRadius, double bottomLeftHorizontalRadius, boolean topLeftHorizontalRadiusAsPercent, boolean topLeftVerticalRadiusAsPercent, boolean topRightVerticalRadiusAsPercent, boolean topRightHorizontalRadiusAsPercent, boolean bottomRightHorizontalRadiusAsPercent, boolean bottomRightVerticalRadiusAsPercent, boolean bottomLeftVerticalRadiusAsPercent, boolean bottomLeftHorizontalRadiusAsPercent) Accepts the constructor arguments ofCornerRadii(double, double, double, double, double, double, double, double, boolean, boolean, boolean, boolean, boolean, boolean, boolean, boolean)and returns an instance ofCornerRadiiBuilder.
-
Method Details
-
create
Accepts the constructor arguments ofCornerRadii(double)and returns an instance ofCornerRadiiBuilder.- Returns:
- an instance of the
CornerRadiiBuilder.
-
create
Accepts the constructor arguments ofCornerRadii(double, boolean)and returns an instance ofCornerRadiiBuilder.- Returns:
- an instance of the
CornerRadiiBuilder.
-
create
public static CornerRadiiBuilder create(double topLeft, double topRight, double bottomRight, double bottomLeft, boolean asPercent) Accepts the constructor arguments ofCornerRadii(double, double, double, double, boolean)and returns an instance ofCornerRadiiBuilder.- Returns:
- an instance of the
CornerRadiiBuilder.
-
create
public static CornerRadiiBuilder create(double topLeftHorizontalRadius, double topLeftVerticalRadius, double topRightVerticalRadius, double topRightHorizontalRadius, double bottomRightHorizontalRadius, double bottomRightVerticalRadius, double bottomLeftVerticalRadius, double bottomLeftHorizontalRadius, boolean topLeftHorizontalRadiusAsPercent, boolean topLeftVerticalRadiusAsPercent, boolean topRightVerticalRadiusAsPercent, boolean topRightHorizontalRadiusAsPercent, boolean bottomRightHorizontalRadiusAsPercent, boolean bottomRightVerticalRadiusAsPercent, boolean bottomLeftVerticalRadiusAsPercent, boolean bottomLeftHorizontalRadiusAsPercent) Accepts the constructor arguments ofCornerRadii(double, double, double, double, double, double, double, double, boolean, boolean, boolean, boolean, boolean, boolean, boolean, boolean)and returns an instance ofCornerRadiiBuilder.- Returns:
- an instance of the
CornerRadiiBuilder.
-
build
Builds and returns an instance of theCornerRadiiclass.Intermediate builder methods are not evaluated until the
buildmethod is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
CornerRadiiclass
-
apply
Applies a function to the CornerRadii instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-