public final class TrianglePatternBuilder extends Object implements AutoCloseable
ComplexStrokePatternFactory#triangleBuilder()
Modifier and Type | Method and Description |
---|---|
ComplexStrokePattern |
build()
Build the triangle pattern as configured.
|
void |
close() |
TrianglePatternBuilder |
fillColor(android.graphics.Color color)
Sets the fill color.
|
protected void |
finalize() |
TrianglePatternBuilder |
lineColor(android.graphics.Color color)
Sets the line color.
|
TrianglePatternBuilder |
lineWidth(double lineWidth)
Sets the line width.
|
TrianglePatternBuilder |
p0(Coordinate coordinate)
The 2D coordinate of the first point of the triangle.
|
TrianglePatternBuilder |
p1(Coordinate coordinate)
The 2D coordinate of the second point of the triangle.
|
TrianglePatternBuilder |
p2(Coordinate coordinate)
The 2D coordinate of the third point of the triangle.
|
TrianglePatternBuilder |
relative(boolean relative)
Sets whether the x coordinates of the points need to be interpreted as pixel values or as values in range
[0,1] relative to the line. |
public void close()
close
in interface AutoCloseable
@NotNull public ComplexStrokePattern build() throws IllegalStateException
ComplexStrokePattern
.IllegalStateException
- when the points have not been set.@NotNull public TrianglePatternBuilder p0(@NotNull Coordinate coordinate)
These coordinates are pixel values. If relative
is set to true the x-coordinate is a length relative to the line (a value in [0,1]
) but the y-coordinate remains a pixel value.
This parameter is mandatory. If it is not set, build
throws an exception.
coordinate
- a 2D coordinate.@NotNull public TrianglePatternBuilder p1(@NotNull Coordinate coordinate)
These coordinates are pixel values. If relative
is set to true the x-coordinate is a length relative to the line (a value in [0,1]
) but the y-coordinate remains a pixel value.
This parameter is mandatory. If it is not set, build
throws an exception.
coordinate
- a 2D coordinate.@NotNull public TrianglePatternBuilder p2(@NotNull Coordinate coordinate)
These coordinates are pixel values. If relative
is set to true the x-coordinate is a length relative to the line (a value in [0,1]
) but the y-coordinate remains a pixel value.
This parameter is mandatory. If it is not set, build
throws an exception.
coordinate
- a 2D coordinate.@NotNull public TrianglePatternBuilder relative(boolean relative)
[0,1]
relative to the line.
Defaults to false.
relative
- whether the coordinates are relative or not.@NotNull public TrianglePatternBuilder lineColor(@NotNull android.graphics.Color color)
color
- the line's color, defaults to black.@NotNull public TrianglePatternBuilder fillColor(@NotNull android.graphics.Color color)
color
- the fill color, by default there is no fill.@NotNull public TrianglePatternBuilder lineWidth(double lineWidth) throws IllegalArgumentException
lineWidth
- the line's width, defaults to 1
.IllegalArgumentException
- lineWidth must be >0
.