Class BorderStrokeBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.BorderStrokeBuilder
The
BorderStrokeBuilder
class constructs instances of the BorderStroke
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 BorderStroke
constructor
and returns an instance of the BorderStrokeBuilder
.
You can use method chaining to call the builder methods for configuring the BorderStroke
.
Finally, invoke the build
method to generate an instance of the BorderStroke
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<BorderStroke> func) Applies a function to the BorderStroke instance being constructed.build()
Builds and returns an instance of theBorderStroke
class.static BorderStrokeBuilder
create
(Paint stroke, BorderStrokeStyle style, CornerRadii radii, BorderWidths widths) Accepts the constructor arguments ofBorderStroke(Paint, BorderStrokeStyle, CornerRadii, BorderWidths)
and returns an instance ofBorderStrokeBuilder
.static BorderStrokeBuilder
create
(Paint stroke, BorderStrokeStyle style, CornerRadii radii, BorderWidths widths, Insets insets) Accepts the constructor arguments ofBorderStroke(Paint, BorderStrokeStyle, CornerRadii, BorderWidths, Insets)
and returns an instance ofBorderStrokeBuilder
.static BorderStrokeBuilder
create
(Paint topStroke, Paint rightStroke, Paint bottomStroke, Paint leftStroke, BorderStrokeStyle topStyle, BorderStrokeStyle rightStyle, BorderStrokeStyle bottomStyle, BorderStrokeStyle leftStyle, CornerRadii radii, BorderWidths widths, Insets insets) Accepts the constructor arguments ofBorderStroke(Paint, Paint, Paint, Paint, BorderStrokeStyle, BorderStrokeStyle, BorderStrokeStyle, BorderStrokeStyle, CornerRadii, BorderWidths, Insets)
and returns an instance ofBorderStrokeBuilder
.
-
Method Details
-
create
public static BorderStrokeBuilder create(Paint stroke, BorderStrokeStyle style, CornerRadii radii, BorderWidths widths) Accepts the constructor arguments ofBorderStroke(Paint, BorderStrokeStyle, CornerRadii, BorderWidths)
and returns an instance ofBorderStrokeBuilder
.- Returns:
- an instance of the
BorderStrokeBuilder
.
-
create
public static BorderStrokeBuilder create(Paint stroke, BorderStrokeStyle style, CornerRadii radii, BorderWidths widths, Insets insets) Accepts the constructor arguments ofBorderStroke(Paint, BorderStrokeStyle, CornerRadii, BorderWidths, Insets)
and returns an instance ofBorderStrokeBuilder
.- Returns:
- an instance of the
BorderStrokeBuilder
.
-
create
public static BorderStrokeBuilder create(Paint topStroke, Paint rightStroke, Paint bottomStroke, Paint leftStroke, BorderStrokeStyle topStyle, BorderStrokeStyle rightStyle, BorderStrokeStyle bottomStyle, BorderStrokeStyle leftStyle, CornerRadii radii, BorderWidths widths, Insets insets) Accepts the constructor arguments ofBorderStroke(Paint, Paint, Paint, Paint, BorderStrokeStyle, BorderStrokeStyle, BorderStrokeStyle, BorderStrokeStyle, CornerRadii, BorderWidths, Insets)
and returns an instance ofBorderStrokeBuilder
.- Returns:
- an instance of the
BorderStrokeBuilder
.
-
build
Builds and returns an instance of theBorderStroke
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
BorderStroke
class
-
apply
Applies a function to the BorderStroke instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-