Class TextBlock.Builder

java.lang.Object
com.luciad.text.TextBlock.Builder
All Implemented Interfaces:
AutoCloseable
Enclosing class:
TextBlock

public static final class TextBlock.Builder extends Object implements AutoCloseable
A factory class that creates a TextBlock containing multiple lines of text with multiple styles.
  • Method Details

    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • newLine

      @NotNull public TextBlock.LineBuilder newLine(@NotNull HorizontalAlignment alignment, double verticalSpacing)
      Add a new line to the current set of lines.

      Each line can have multiple strings with different styling options. See TextBlock.LineBuilder.

      Parameters:
      alignment - position of the text relative to the whole block of the text. By default the text is positioned at the left.
      verticalSpacing - extra space between this line and the next line in pixels.
      Returns:
      the new line on which you can add text.
    • newLine

      @NotNull public TextBlock.LineBuilder newLine(@NotNull HorizontalAlignment alignment)
      Add a new line to the current set of lines.

      Each line can have multiple strings with different styling options. See TextBlock.LineBuilder.

      Parameters:
      alignment - position of the text relative to the whole block of the text. By default the text is positioned at the left.
      Returns:
      the new line on which you can add text.
    • newLine

      @NotNull public TextBlock.LineBuilder newLine()
      Add a new line to the current set of lines.

      Each line can have multiple strings with different styling options. See TextBlock.LineBuilder.

      Returns:
      the new line on which you can add text.
    • build

      @NotNull public TextBlock build()
      Returns the current text.
      Returns:
      the current text.