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 Link icon

    • finalize Link icon

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

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

      @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 Link icon

      @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 Link icon

      @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 Link icon

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