Class PolylinePatternBuilder
java.lang.Object
com.luciad.layers.styles.complexstrokes.builders.PolylinePatternBuilder
- All Implemented Interfaces:
AutoCloseable
Creates a pattern with a polyline shape.
The polyline's points must be set by calling the points method before calling build. All other methods are optional.
- Since:
- 2023.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the polyline pattern as configured.void
close()
protected void
finalize()
lineColor
(android.graphics.Color color) Sets the line color.lineWidth
(double lineWidth) Sets the line width.points
(List<@NotNull Coordinate> points) Sets the points of the polyline.relative
(boolean relative) Whether the x coordinates of the points need to be interpreted as pixel values or relative values.
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
build
Build the polyline pattern as configured.- Returns:
- the
ComplexStrokePattern
. - Throws:
IllegalStateException
- when the points have not been set.
-
points
@NotNull public PolylinePatternBuilder points(@NotNull List<@NotNull Coordinate> points) throws IllegalArgumentException Sets the points of the polyline.Depending on the option
relative
, the x coordinates are interpreted as pixel value, or as coordinates relative ([0, 1]
) to the length of the entire line. the Y coordinates are always pixel values.The coordinates are defined locally, so for example to define a line of length 10, the following coordinates can be used: (0,0), (10,0).
There must be at least 2 points.
- Parameters:
points
- the points that make up the polyline.- Returns:
- this builder.
- Throws:
IllegalArgumentException
- when the amount of points is lower than 2.
-
relative
Whether the x coordinates of the points need to be interpreted as pixel values or relative values.Defaults to false.
- Parameters:
relative
- whether the x coordinates need to be interpreted as relative values.- 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
.
-
lineColor
Sets the line color.- Parameters:
color
- the line's color, defaults to black.- Returns:
- this builder.
-