public final class ArcPatternBuilder extends Object implements AutoCloseable
ComplexStrokePatternFactory#arcBuilder()
Modifier and Type | Method and Description |
---|---|
ArcPatternBuilder |
angle(double angle)
Specifies that only a part of the ellipse should be used, creating an arc.
|
ComplexStrokePattern |
build()
Build the arc pattern as configured.
|
void |
close() |
ArcPatternBuilder |
fillColor(android.graphics.Color color)
Sets the fill color.
|
protected void |
finalize() |
ArcPatternBuilder |
fixedLength(double fixedLength)
Set the length of the pattern in pixels.
|
ArcPatternBuilder |
lineColor(android.graphics.Color color)
Sets the line color.
|
ArcPatternBuilder |
lineWidth(double lineWidth)
Sets the line width.
|
ArcPatternBuilder |
minorRadius(double radius)
The minor radius is the distance from the baseline to the top/bottom of the arc.
|
ArcPatternBuilder |
offset(double offset)
Sets the offset of the arc, relative to the base line, in pixels.
|
ArcPatternBuilder |
relativeLength(double relativeLength)
Set the length of the pattern relative to the length of the entire line, as a value between
0 and 1 . |
ArcPatternBuilder |
startAngle(Angle startAngle)
This determines at which point on the ellipse the arc begins.
|
public void close()
close
in interface AutoCloseable
@NotNull public ComplexStrokePattern build()
ComplexStrokePattern
.@NotNull public ArcPatternBuilder fixedLength(double fixedLength) throws IllegalArgumentException
The length cannot be both fixed and relative, if both methods are used, only the last one affects the result.
If no length is set, a 10 pixel fixed length will be used as default.
fixedLength
- the length in pixels.IllegalArgumentException
- fixedLength must be >=0
.@NotNull public ArcPatternBuilder relativeLength(double relativeLength) throws IllegalArgumentException
0
and 1
.
The length cannot be both fixed and relative, if both methods are used, only the last one affects the result.
If no length is set, a 10 pixel fixed length will be used as default.
relativeLength
- a value in [0,1]
.IllegalArgumentException
- relativeLength must be in range [0,1]
.@NotNull public ArcPatternBuilder startAngle(@NotNull Angle startAngle)
A startAngle of 0
is on the baseline and the arc goes counter clockwise.
startAngle
- The start angle of the arc, defaults to 0
degrees.@NotNull public ArcPatternBuilder angle(double angle) throws IllegalArgumentException
The part of the ellipse that will be drawn starts at startAngle
and ends at startAngle + angle
angle
- The angle of the arc, defaults to 360
degrees for a full ellipse.IllegalArgumentException
- angle must be >=0
.@NotNull public ArcPatternBuilder minorRadius(double radius) throws IllegalArgumentException
radius
- The minor radius of the arc, in pixels. Defaults to 10
.IllegalArgumentException
- radius must be >0
.@NotNull public ArcPatternBuilder offset(double offset)
Defaults to 0
.
offset
- The offset of the arc.@NotNull public ArcPatternBuilder lineWidth(double lineWidth) throws IllegalArgumentException
lineWidth
- the line's width, defaults to 1
.IllegalArgumentException
- lineWidth must be >0
.@NotNull public ArcPatternBuilder lineColor(@NotNull android.graphics.Color color)
color
- the line's color, defaults to black.@NotNull public ArcPatternBuilder fillColor(@NotNull android.graphics.Color color)
color
- the fill color, by default there is no fill.