public final class RectanglePatternBuilder extends Object implements AutoCloseable
ComplexStrokePatternFactory#rectangleBuilder()
Modifier and Type | Method and Description |
---|---|
ComplexStrokePattern |
build()
Build the rectangle pattern as configured.
|
void |
close() |
RectanglePatternBuilder |
fillColor(android.graphics.Color color)
Sets the fill color.
|
protected void |
finalize() |
RectanglePatternBuilder |
fixedLength(double fixedLength)
Set the length of the pattern in pixels.
|
RectanglePatternBuilder |
lineColor(android.graphics.Color color)
Sets the line color.
|
RectanglePatternBuilder |
lineWidth(double lineWidth)
Sets the line width.
|
RectanglePatternBuilder |
maxHeight(double maxHeight)
Sets the maximum height of the rectangle, in pixels, relative to the base line.
|
RectanglePatternBuilder |
minHeight(double minHeight)
Sets the minimum height of the rectangle, in pixels, relative to the base line.
|
RectanglePatternBuilder |
relativeLength(double relativeLength)
Set the length of the pattern relative to the length of the entire line, as a value between
0 and 1 . |
public void close()
close
in interface AutoCloseable
@NotNull public ComplexStrokePattern build()
ComplexStrokePattern
.@NotNull public RectanglePatternBuilder 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 RectanglePatternBuilder 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 RectanglePatternBuilder minHeight(double minHeight)
This is typically a negative value.
minHeight
- the minimum height, defaults to -5
.@NotNull public RectanglePatternBuilder maxHeight(double maxHeight)
This is typically a positive value.
maxHeight
- the maximum height, defaults to 5
.@NotNull public RectanglePatternBuilder lineWidth(double lineWidth) throws IllegalArgumentException
lineWidth
- the line's width, defaults to 1
.IllegalArgumentException
- lineWidth must be >0
.@NotNull public RectanglePatternBuilder lineColor(@NotNull android.graphics.Color color)
color
- the line's color, defaults to black.@NotNull public RectanglePatternBuilder fillColor(@NotNull android.graphics.Color color)
color
- the fill color, by default there is no fill.