public final class LinePatternBuilder extends Object implements AutoCloseable
ComplexStrokePatternFactory#lineBuilder()
Modifier and Type | Method and Description |
---|---|
ComplexStrokePattern |
build()
Build the line pattern as configured.
|
void |
close() |
LinePatternBuilder |
fillColor(android.graphics.Color color)
Sets the fill color.
|
protected void |
finalize() |
LinePatternBuilder |
fixedLength(double fixedLength)
Set the length of the pattern in pixels.
|
LinePatternBuilder |
lineColor(android.graphics.Color color)
Sets the line color.
|
LinePatternBuilder |
lineWidth(double lineWidth)
Sets the line width.
|
LinePatternBuilder |
offset0(double offset0)
Sets the offset of the start point of the segment, relative to the base line, in pixels.
|
LinePatternBuilder |
offset1(double offset1)
Sets the offset of the end point of the segment, relative to the base line, in pixels.
|
LinePatternBuilder |
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 LinePatternBuilder 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 LinePatternBuilder 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 LinePatternBuilder offset0(double offset0)
offset0
- the offset in pixels. Defaults to 0
.@NotNull public LinePatternBuilder offset1(double offset1)
offset1
- the offset in pixels. Defaults to 0
.@NotNull public LinePatternBuilder lineWidth(double lineWidth) throws IllegalArgumentException
lineWidth
- the line's width, defaults to 1
.IllegalArgumentException
- lineWidth must be >0
.@NotNull public LinePatternBuilder lineColor(@NotNull android.graphics.Color color)
color
- the line's color, defaults to black.@NotNull public LinePatternBuilder fillColor(@NotNull android.graphics.Color color)
color
- the fill color, by default there is no fill.