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 theGraphicsContextclass.A builder method that invokes thesetEffectmethod on the instance being constructed.A builder method that invokes thesetFillmethod on the instance being constructed.A builder method that invokes thesetFillRulemethod on the instance being constructed.A builder method that invokes thesetFontmethod on the instance being constructed.fontSmoothingType(FontSmoothingType fontsmoothing) A builder method that invokes thesetFontSmoothingTypemethod on the instance being constructed.globalAlpha(double alpha) A builder method that invokes thesetGlobalAlphamethod on the instance being constructed.A builder method that invokes thesetGlobalBlendModemethod on the instance being constructed.imageSmoothing(boolean imageSmoothing) A builder method that invokes thesetImageSmoothingmethod on the instance being constructed.lineCap(StrokeLineCap cap) A builder method that invokes thesetLineCapmethod on the instance being constructed.lineDashes(double... dashes) A builder method that invokes thesetLineDashesmethod on the instance being constructed.lineDashOffset(double dashOffset) A builder method that invokes thesetLineDashOffsetmethod on the instance being constructed.lineJoin(StrokeLineJoin join) A builder method that invokes thesetLineJoinmethod on the instance being constructed.lineWidth(double lw) A builder method that invokes thesetLineWidthmethod on the instance being constructed.miterLimit(double ml) A builder method that invokes thesetMiterLimitmethod on the instance being constructed.A builder method that invokes thesetStrokemethod on the instance being constructed.textAlign(TextAlignment align) A builder method that invokes thesetTextAlignmethod on the instance being constructed.textBaseline(VPos baseline) A builder method that invokes thesetTextBaselinemethod on the instance being constructed.transform(double mxx, double myx, double mxy, double myy, double mxt, double myt) A builder method that invokes thesetTransformmethod on the instance being constructed.A builder method that invokes thesetTransformmethod on the instance being constructed.
-
Method Details
-
build
Builds and returns an instance of theGraphicsContextclass.Intermediate builder methods are not evaluated until the
buildmethod is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
GraphicsContextclass
-
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 thesetEffectmethod on the instance being constructed.- Returns:
- builder instance
-
fill
A builder method that invokes thesetFillmethod on the instance being constructed.- Returns:
- builder instance
-
fillRule
A builder method that invokes thesetFillRulemethod on the instance being constructed.- Returns:
- builder instance
-
font
A builder method that invokes thesetFontmethod on the instance being constructed.- Returns:
- builder instance
-
fontSmoothingType
A builder method that invokes thesetFontSmoothingTypemethod on the instance being constructed.- Returns:
- builder instance
-
globalAlpha
A builder method that invokes thesetGlobalAlphamethod on the instance being constructed.- Returns:
- builder instance
-
globalBlendMode
A builder method that invokes thesetGlobalBlendModemethod on the instance being constructed.- Returns:
- builder instance
-
imageSmoothing
A builder method that invokes thesetImageSmoothingmethod on the instance being constructed.- Returns:
- builder instance
-
lineCap
A builder method that invokes thesetLineCapmethod on the instance being constructed.- Returns:
- builder instance
-
lineDashOffset
A builder method that invokes thesetLineDashOffsetmethod on the instance being constructed.- Returns:
- builder instance
-
lineDashes
A builder method that invokes thesetLineDashesmethod on the instance being constructed.- Returns:
- builder instance
-
lineJoin
A builder method that invokes thesetLineJoinmethod on the instance being constructed.- Returns:
- builder instance
-
lineWidth
A builder method that invokes thesetLineWidthmethod on the instance being constructed.- Returns:
- builder instance
-
miterLimit
A builder method that invokes thesetMiterLimitmethod on the instance being constructed.- Returns:
- builder instance
-
stroke
A builder method that invokes thesetStrokemethod on the instance being constructed.- Returns:
- builder instance
-
textAlign
A builder method that invokes thesetTextAlignmethod on the instance being constructed.- Returns:
- builder instance
-
textBaseline
A builder method that invokes thesetTextBaselinemethod 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 thesetTransformmethod on the instance being constructed.- Returns:
- builder instance
-
transform
A builder method that invokes thesetTransformmethod on the instance being constructed.- Returns:
- builder instance
-