Class WavePatternBuilder

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

public final class WavePatternBuilder extends Object implements AutoCloseable
Creates a pattern with a wave 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 wave pattern as configured.
      Returns:
      the ComplexStrokePattern.
    • fixedLength

      @NotNull public WavePatternBuilder 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 WavePatternBuilder 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].
    • amplitude

      @NotNull public WavePatternBuilder amplitude(double amplitude) throws IllegalArgumentException
      The amplitude or height of the wave.
      Parameters:
      amplitude - The amplitude of the wave. This is a value in pixels, relative to the base line. Defaults to 10.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - amplitude must be >0.
    • startAngle

      @NotNull public WavePatternBuilder startAngle(@NotNull Angle startAngle)
      This determines at which point on the sine function the wave begins.

      0 is on the baseline, 90 is above the baseline at the max amplitude. A startAngle of 180 will result in a wave that starts on the baseline, but first goes to the right of the baseline instead of to the left.

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

      @NotNull public WavePatternBuilder angle(double angle) throws IllegalArgumentException
      The angle of the wave pattern in degrees.

      When values greater than 360 degrees are used the pattern keeps going, e.g. an angle of 720 will result in two complete waves.

      Parameters:
      angle - The angle of the wave, defaults to 360 degrees.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - angle must be >=0.
    • lineColor

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