Class PolylinePatternBuilder

java.lang.Object
com.luciad.layers.styles.complexstrokes.builders.PolylinePatternBuilder
All Implemented Interfaces:
AutoCloseable

public final class PolylinePatternBuilder extends Object implements 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 Details

    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • build

      @NotNull public ComplexStrokePattern build() throws IllegalStateException
      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

      @NotNull public PolylinePatternBuilder relative(boolean 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

      @NotNull public PolylinePatternBuilder lineWidth(double lineWidth) throws IllegalArgumentException
      Sets the line width.
      Parameters:
      lineWidth - the line's width, defaults to 1.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - lineWidth must be >0.
    • lineColor

      @NotNull public PolylinePatternBuilder lineColor(@NotNull android.graphics.Color color)
      Sets the line color.
      Parameters:
      color - the line's color, defaults to black.
      Returns:
      this builder.