Class TrianglePatternBuilder
- All Implemented Interfaces:
AutoCloseable
- Since:
- 2023.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the triangle pattern as configured.void
close()
fillColor
(android.graphics.Color color) Sets the fill color.protected void
finalize()
lineColor
(android.graphics.Color color) Sets the line color.lineWidth
(double lineWidth) Sets the line width.p0
(Coordinate coordinate) The 2D coordinate of the first point of the triangle.p1
(Coordinate coordinate) The 2D coordinate of the second point of the triangle.p2
(Coordinate coordinate) The 2D coordinate of the third point of the triangle.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.
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
build
Build the triangle pattern as configured.- Returns:
- the
ComplexStrokePattern
. - Throws:
IllegalStateException
- when the points have not been set.
-
p0
The 2D coordinate of the first point of the triangle.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.- Parameters:
coordinate
- a 2D coordinate.- Returns:
- this builder.
-
p1
The 2D coordinate of the second point of the triangle.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.- Parameters:
coordinate
- a 2D coordinate.- Returns:
- this builder.
-
p2
The 2D coordinate of the third point of the triangle.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.- Parameters:
coordinate
- a 2D coordinate.- Returns:
- this builder.
-
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.Defaults to false.
- Parameters:
relative
- whether the coordinates are relative or not.- Returns:
- this builder.
-
lineColor
Sets the line color.- Parameters:
color
- the line's color, defaults to black.- Returns:
- this builder.
-
fillColor
Sets the fill color.- Parameters:
color
- the fill color, by default there is no fill.- Returns:
- this builder.
-
lineWidth
Sets the line width.- Parameters:
lineWidth
- the line's width, defaults to1
.- Returns:
- this builder.
- Throws:
IllegalArgumentException
- lineWidth must be>0
.
-