Class ArrowPatternBuilder

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

public final class ArrowPatternBuilder extends Object implements AutoCloseable
Creates a pattern with an arrow 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()
      Build the arrow pattern as configured.
      Returns:
      the ComplexStrokePattern.
    • type

      @NotNull public ArrowPatternBuilder type(@NotNull ComplexStrokePatternArrowType type)
      Sets the arrow's type.

      Defaults to ArrowType.RegularFilled.

      Parameters:
      type - the arrow's type.
      Returns:
      this builder.
    • size

      @NotNull public ArrowPatternBuilder size(double size) throws IllegalArgumentException
      The size (~length) of the arrow, in pixels.

      Defaults to 5.

      Parameters:
      size - the size of the arrow.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - size must be >0.
    • height

      @NotNull public ArrowPatternBuilder height(double height) throws IllegalArgumentException
      The height of the arrow, in pixels.

      Must be strictly greater than 0. If it is not set, the arrow uses a default height, depending on the arrow type.

      Parameters:
      height - the height of the arrow.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - height must be >0.
    • offset

      @NotNull public ArrowPatternBuilder offset(double offset)
      The offset of the arrow, relative to the base line, in pixels.

      Defaults to 0.

      Parameters:
      offset - the offset of the arrow.
      Returns:
      this builder.
    • lineWidth

      @NotNull public ArrowPatternBuilder 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 ArrowPatternBuilder lineColor(@NotNull android.graphics.Color color)
      Sets the line color.
      Parameters:
      color - the arrow's line color, defaults to black.
      Returns:
      this builder.
    • fillColor

      @NotNull public ArrowPatternBuilder fillColor(@NotNull android.graphics.Color color)
      Sets the fill color.
      Parameters:
      color - the arrow's fill color, defaults to white.
      Returns:
      this builder.
    • forward

      @NotNull public ArrowPatternBuilder forward(boolean forward)
      If true, the arrow is oriented towards the end of the line.

      Defaults to true.

      Parameters:
      forward - whether the arrow is oriented towards the end of the line.
      Returns:
      this builder.