Class TrianglePatternBuilder

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

public final class TrianglePatternBuilder extends Object implements AutoCloseable
Creates a pattern with a triangle shape.
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 triangle pattern as configured.
      Returns:
      the ComplexStrokePattern.
      Throws:
      IllegalStateException - when the points have not been set.
    • p0

      @NotNull public TrianglePatternBuilder p0(@NotNull Coordinate coordinate)
      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

      @NotNull public TrianglePatternBuilder p1(@NotNull Coordinate coordinate)
      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

      @NotNull public TrianglePatternBuilder p2(@NotNull Coordinate coordinate)
      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

      @NotNull public 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.

      Defaults to false.

      Parameters:
      relative - whether the coordinates are relative or not.
      Returns:
      this builder.
    • lineColor

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

      @NotNull public TrianglePatternBuilder fillColor(@NotNull android.graphics.Color color)
      Sets the fill color.
      Parameters:
      color - the fill color, by default there is no fill.
      Returns:
      this builder.
    • lineWidth

      @NotNull public TrianglePatternBuilder 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.