public static final class TextBlock.Builder extends Object implements AutoCloseable
TextBlock
containing multiple lines of text with multiple styles.Modifier and Type | Method and Description |
---|---|
TextBlock |
build()
Returns the current text.
|
void |
close() |
protected void |
finalize() |
TextBlock.LineBuilder |
newLine()
Add a new line to the current set of lines.
|
TextBlock.LineBuilder |
newLine(HorizontalAlignment alignment)
Add a new line to the current set of lines.
|
TextBlock.LineBuilder |
newLine(HorizontalAlignment alignment,
double verticalSpacing)
Add a new line to the current set of lines.
|
public void close()
close
in interface AutoCloseable
@NotNull public TextBlock.LineBuilder newLine(@NotNull HorizontalAlignment alignment, double verticalSpacing)
Each line can have multiple strings with different styling options. See TextBlock.LineBuilder
.
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.@NotNull public TextBlock.LineBuilder newLine(@NotNull HorizontalAlignment alignment)
Each line can have multiple strings with different styling options. See TextBlock.LineBuilder
.
alignment
- position of the text relative to the whole block of the text. By default the text is positioned at the left.@NotNull public TextBlock.LineBuilder newLine()
Each line can have multiple strings with different styling options. See TextBlock.LineBuilder
.
@NotNull public TextBlock build()