Package com.luciad.text
Class TextBlock.Builder
java.lang.Object
com.luciad.text.TextBlock.Builder
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
TextBlock
A factory class that creates a
TextBlock
containing multiple lines of text with multiple styles.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns the current text.void
close()
protected void
finalize()
newLine()
Add a new line to the current set of lines.newLine
(HorizontalAlignment alignment) Add a new line to the current set of lines.newLine
(HorizontalAlignment alignment, double verticalSpacing) Add a new line to the current set of lines.
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
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
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
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
Returns the current text.- Returns:
- the current text.
-