Class ArcPatternBuilder

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

public final class ArcPatternBuilder extends Object implements AutoCloseable
Creates a pattern with an arc, ellipse or circle 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 arc pattern as configured.
      Returns:
      the ComplexStrokePattern.
    • fixedLength

      @NotNull public ArcPatternBuilder fixedLength(double fixedLength) throws IllegalArgumentException
      Set the length of the pattern in pixels.

      The length cannot be both fixed and relative, if both methods are used, only the last one affects the result.

      If no length is set, a 10 pixel fixed length will be used as default.

      Parameters:
      fixedLength - the length in pixels.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - fixedLength must be >=0.
    • relativeLength

      @NotNull public ArcPatternBuilder relativeLength(double relativeLength) throws IllegalArgumentException
      Set the length of the pattern relative to the length of the entire line, as a value between 0 and 1.

      The length cannot be both fixed and relative, if both methods are used, only the last one affects the result.

      If no length is set, a 10 pixel fixed length will be used as default.

      Parameters:
      relativeLength - a value in [0,1].
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - relativeLength must be in range [0,1].
    • startAngle

      @NotNull public ArcPatternBuilder startAngle(@NotNull Angle startAngle)
      This determines at which point on the ellipse the arc begins.

      A startAngle of 0 is on the baseline and the arc goes counter clockwise.

      Parameters:
      startAngle - The start angle of the arc, defaults to 0 degrees.
      Returns:
      this builder.
    • angle

      @NotNull public ArcPatternBuilder angle(double angle) throws IllegalArgumentException
      Specifies that only a part of the ellipse should be used, creating an arc.

      The part of the ellipse that will be drawn starts at startAngle and ends at startAngle + angle

      Parameters:
      angle - The angle of the arc, defaults to 360 degrees for a full ellipse.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - angle must be >=0.
    • minorRadius

      @NotNull public ArcPatternBuilder minorRadius(double radius) throws IllegalArgumentException
      The minor radius is the distance from the baseline to the top/bottom of the arc.
      Parameters:
      radius - The minor radius of the arc, in pixels. Defaults to 10.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - radius must be >0.
    • offset

      @NotNull public ArcPatternBuilder offset(double offset)
      Sets the offset of the arc, relative to the base line, in pixels.

      Defaults to 0.

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

      @NotNull public ArcPatternBuilder 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 ArcPatternBuilder 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 ArcPatternBuilder fillColor(@NotNull android.graphics.Color color)
      Sets the fill color.
      Parameters:
      color - the fill color, by default there is no fill.
      Returns:
      this builder.