Class TextPatternBuilder

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

public final class TextPatternBuilder extends Object implements AutoCloseable
Creates a pattern containing text.
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 text pattern as configured.
      Returns:
      the ComplexStrokePattern.
      Throws:
      IllegalStateException - when the text has not been set.
    • text

      @NotNull public TextPatternBuilder text(@NotNull String text)
      Sets the text as a single line.
      Parameters:
      text - the text to be displayed.
      Returns:
      this builder.
    • text

      @NotNull public TextPatternBuilder text(@NotNull List<@NotNull String> text) throws IllegalArgumentException
      Sets multiple lines of text, with each element being a separate line.
      Parameters:
      text - the text to be displayed. May not be empty.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - text may not be empty.
    • textStyle

      @NotNull public TextPatternBuilder textStyle(@NotNull TextStyle textStyle)
      Sets the style of the text.
      Parameters:
      textStyle - the style of the text.
      Returns:
      this builder.
    • rotateUp

      @NotNull public TextPatternBuilder rotateUp(boolean rotateUp)
      Indicates if the text should be flipped when it is turned upside down.

      Defaults to true.

      Parameters:
      rotateUp - if the text should be flipped when it is turned upside down.
      Returns:
      this builder.
    • offset

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

      Defaults to 0.

      Parameters:
      offset - the offset of the text.
      Returns:
      this builder.