public final class ParallelLinePatternBuilder extends Object implements AutoCloseable
ComplexStrokePatternFactory#parallelLineBuilder()
Modifier and Type | Method and Description |
---|---|
ComplexStrokePattern |
build()
Build the parallel line pattern as configured.
|
void |
close() |
protected void |
finalize() |
ParallelLinePatternBuilder |
fixedLength(double fixedLength)
Set the length of the pattern in pixels.
|
ParallelLinePatternBuilder |
lineColor(android.graphics.Color color)
Sets the line color.
|
ParallelLinePatternBuilder |
lineWidth(double lineWidth)
Sets the line width.
|
ParallelLinePatternBuilder |
offset(double offset)
Sets the offset of the line, relative to the base line, in pixels.
|
ParallelLinePatternBuilder |
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 ParallelLinePatternBuilder 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 ParallelLinePatternBuilder 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 ParallelLinePatternBuilder offset(double offset)
offset
- the offset in pixels. Defaults to 0
.@NotNull public ParallelLinePatternBuilder lineWidth(double lineWidth) throws IllegalArgumentException
lineWidth
- the line's width, defaults to 1
.IllegalArgumentException
- lineWidth must be >0
.@NotNull public ParallelLinePatternBuilder lineColor(@NotNull android.graphics.Color color)
color
- the line's color, defaults to black.