Class GraphicsContextBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.GraphicsContextBuilder
The
GraphicsContextBuilder
class constructs instances of the GraphicsContext
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 GraphicsContext
constructor
and returns an instance of the GraphicsContextBuilder
.
You can use method chaining to call the builder methods for configuring the GraphicsContext
.
Finally, invoke the build
method to generate an instance of the GraphicsContext
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<GraphicsContext> func) Applies a function to the GraphicsContext instance being constructed.build()
Builds and returns an instance of theGraphicsContext
class.A builder method that invokes thesetEffect
method on the instance being constructed.A builder method that invokes thesetFill
method on the instance being constructed.A builder method that invokes thesetFillRule
method on the instance being constructed.A builder method that invokes thesetFont
method on the instance being constructed.fontSmoothingType
(FontSmoothingType fontsmoothing) A builder method that invokes thesetFontSmoothingType
method on the instance being constructed.globalAlpha
(double alpha) A builder method that invokes thesetGlobalAlpha
method on the instance being constructed.A builder method that invokes thesetGlobalBlendMode
method on the instance being constructed.imageSmoothing
(boolean imageSmoothing) A builder method that invokes thesetImageSmoothing
method on the instance being constructed.lineCap
(StrokeLineCap cap) A builder method that invokes thesetLineCap
method on the instance being constructed.lineDashes
(double... dashes) A builder method that invokes thesetLineDashes
method on the instance being constructed.lineDashOffset
(double dashOffset) A builder method that invokes thesetLineDashOffset
method on the instance being constructed.lineJoin
(StrokeLineJoin join) A builder method that invokes thesetLineJoin
method on the instance being constructed.lineWidth
(double lw) A builder method that invokes thesetLineWidth
method on the instance being constructed.miterLimit
(double ml) A builder method that invokes thesetMiterLimit
method on the instance being constructed.A builder method that invokes thesetStroke
method on the instance being constructed.textAlign
(TextAlignment align) A builder method that invokes thesetTextAlign
method on the instance being constructed.textBaseline
(VPos baseline) A builder method that invokes thesetTextBaseline
method on the instance being constructed.transform
(double mxx, double myx, double mxy, double myy, double mxt, double myt) A builder method that invokes thesetTransform
method on the instance being constructed.A builder method that invokes thesetTransform
method on the instance being constructed.
-
Method Details
-
build
Builds and returns an instance of theGraphicsContext
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
GraphicsContext
class
-
apply
Applies a function to the GraphicsContext instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
effect
A builder method that invokes thesetEffect
method on the instance being constructed.- Returns:
- builder instance
-
fill
A builder method that invokes thesetFill
method on the instance being constructed.- Returns:
- builder instance
-
fillRule
A builder method that invokes thesetFillRule
method on the instance being constructed.- Returns:
- builder instance
-
font
A builder method that invokes thesetFont
method on the instance being constructed.- Returns:
- builder instance
-
fontSmoothingType
A builder method that invokes thesetFontSmoothingType
method on the instance being constructed.- Returns:
- builder instance
-
globalAlpha
A builder method that invokes thesetGlobalAlpha
method on the instance being constructed.- Returns:
- builder instance
-
globalBlendMode
A builder method that invokes thesetGlobalBlendMode
method on the instance being constructed.- Returns:
- builder instance
-
imageSmoothing
A builder method that invokes thesetImageSmoothing
method on the instance being constructed.- Returns:
- builder instance
-
lineCap
A builder method that invokes thesetLineCap
method on the instance being constructed.- Returns:
- builder instance
-
lineDashOffset
A builder method that invokes thesetLineDashOffset
method on the instance being constructed.- Returns:
- builder instance
-
lineDashes
A builder method that invokes thesetLineDashes
method on the instance being constructed.- Returns:
- builder instance
-
lineJoin
A builder method that invokes thesetLineJoin
method on the instance being constructed.- Returns:
- builder instance
-
lineWidth
A builder method that invokes thesetLineWidth
method on the instance being constructed.- Returns:
- builder instance
-
miterLimit
A builder method that invokes thesetMiterLimit
method on the instance being constructed.- Returns:
- builder instance
-
stroke
A builder method that invokes thesetStroke
method on the instance being constructed.- Returns:
- builder instance
-
textAlign
A builder method that invokes thesetTextAlign
method on the instance being constructed.- Returns:
- builder instance
-
textBaseline
A builder method that invokes thesetTextBaseline
method on the instance being constructed.- Returns:
- builder instance
-
transform
public GraphicsContextBuilder transform(double mxx, double myx, double mxy, double myy, double mxt, double myt) A builder method that invokes thesetTransform
method on the instance being constructed.- Returns:
- builder instance
-
transform
A builder method that invokes thesetTransform
method on the instance being constructed.- Returns:
- builder instance
-