public final class TextPatternBuilder extends Object implements AutoCloseable
ComplexStrokePatternFactory#textBuilder()
Modifier and Type | Method and Description |
---|---|
ComplexStrokePattern |
build()
Build the text pattern as configured.
|
void |
close() |
protected void |
finalize() |
TextPatternBuilder |
offset(double offset)
Sets the offset of the text, relative to the base line, in pixels.
|
TextPatternBuilder |
rotateUp(boolean rotateUp)
Indicates if the text should be flipped when it is turned upside down.
|
TextPatternBuilder |
text(List<String> text)
Sets multiple lines of text, with each element being a separate line.
|
TextPatternBuilder |
text(String text)
Sets the text as a single line.
|
TextPatternBuilder |
textStyle(TextStyle textStyle)
Sets the style of the text.
|
public void close()
close
in interface AutoCloseable
@NotNull public ComplexStrokePattern build() throws IllegalStateException
ComplexStrokePattern
.IllegalStateException
- when the text has not been set.@NotNull public TextPatternBuilder text(@NotNull String text)
text
- the text to be displayed.@NotNull public TextPatternBuilder text(@NotNull List<String> text) throws IllegalArgumentException
text
- the text to be displayed. May not be empty.IllegalArgumentException
- text may not be empty.@NotNull public TextPatternBuilder textStyle(@NotNull TextStyle textStyle)
textStyle
- the style of the text.@NotNull public TextPatternBuilder rotateUp(boolean rotateUp)
Defaults to true.
rotateUp
- if the text should be flipped when it is turned upside down.@NotNull public TextPatternBuilder offset(double offset)
Defaults to 0
.
offset
- the offset of the text.