public class VertAlignTextBuilderImpl extends Object implements VertAlignTextBuilder
org.refcodes.mixin.RowHeightAccessor.RowHeightBuilder<B extends org.refcodes.mixin.RowHeightAccessor.RowHeightBuilder<B>>, org.refcodes.mixin.RowHeightAccessor.RowHeightMutator, org.refcodes.mixin.RowHeightAccessor.RowHeightProperty
TextAccessor.TextBuilder<B extends TextAccessor.TextBuilder<B>>, TextAccessor.TextMutator, TextAccessor.TextProperty, TextAccessor.TextProvider
VertAlignTextModeAccessor.VertAlignTextModeBuilder<B extends VertAlignTextModeAccessor.VertAlignTextModeBuilder<B>>, VertAlignTextModeAccessor.VertAlignTextModeMutator, VertAlignTextModeAccessor.VertAlignTextModeProperty
Constructor and Description |
---|
VertAlignTextBuilderImpl() |
Modifier and Type | Method and Description |
---|---|
char |
getFillChar()
Retrieves the fill char from the fill char property.
|
int |
getRowHeight() |
String[] |
getText()
Retrieves the text from the text property.
|
VertAlignTextMode |
getVertAlignTextMode()
Retrieves the vertical align text mode from the vertical align text mode
property.
|
void |
setFillChar(char aFillChar)
Sets the fill char for the fill char property.
|
void |
setRowHeight(int aRowHeight) |
void |
setText(String... aText)
Sets the text for the text property.
|
void |
setVertAlignTextMode(VertAlignTextMode aVertAlignTextMode)
Sets the vertical align text mode for the vertical align text mode
property.
|
String |
toString()
The
String being build by the builder upon the settings of
the attributes. |
String |
toString(String... aText)
Race condition safe shortcut for using
Text.withText(String...) |
String[] |
toStrings()
The
String s being build by the builder upon the settings of
the attributes. |
String[] |
toStrings(String... aText)
Race condition safe shortcut for using
Text.withText(String...) |
protected static String[] |
toTextBlock(String[] aTextBlock,
int aHeight,
char aFillChar,
VertAlignTextMode aVertAlignTextMode)
Fills up or truncates a given text block to the provided height; filling
up or truncating depends on the
VertAlignTextMode specified, the
default is VertAlignTextMode.TOP . |
VertAlignTextBuilder |
withRowHeight(int aRowHeight) |
B |
withText(Collection<String> aText)
With text.
|
B |
withText(String... aText)
With text.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
withFillChar, withVertAlignTextMode
getText
setText, setText
withText
toString
public VertAlignTextBuilder withRowHeight(int aRowHeight)
withRowHeight
in interface org.refcodes.mixin.RowHeightAccessor.RowHeightBuilder<VertAlignTextBuilder>
public void setRowHeight(int aRowHeight)
setRowHeight
in interface org.refcodes.mixin.RowHeightAccessor.RowHeightMutator
public int getRowHeight()
getRowHeight
in interface org.refcodes.mixin.RowHeightAccessor
public void setVertAlignTextMode(VertAlignTextMode aVertAlignTextMode)
VertAlignTextModeAccessor.VertAlignTextModeMutator
setVertAlignTextMode
in interface VertAlignTextModeAccessor.VertAlignTextModeMutator
aVertAlignTextMode
- The vertical align text mode to be stored
by the font style property.public VertAlignTextMode getVertAlignTextMode()
VertAlignTextModeAccessor
getVertAlignTextMode
in interface VertAlignTextModeAccessor
public char getFillChar()
VertAlignTextBuilder
getFillChar
in interface VertAlignTextBuilder
public void setFillChar(char aFillChar)
VertAlignTextBuilder
setFillChar
in interface VertAlignTextBuilder
aFillChar
- The fill char to be stored by the align text mode
property.public String[] toStrings()
TextAccessor.TextProvider
String
s being build by the builder upon the settings of
the attributes.toStrings
in interface TextAccessor.TextProvider
String
arraypublic String[] toStrings(String... aText)
Text
Text.withText(String...)
followed by TextAccessor.TextProvider.toStrings()
.
Implementation requirements: This method must not(!) be implemented by
calling Text.withText(String...)
followed by TextAccessor.TextProvider.toStrings()
(do
not change the text property) as this would not be thread safe!toStrings
in interface Text<VertAlignTextBuilder>
aText
- The text to be processed.String
arrayprotected static String[] toTextBlock(String[] aTextBlock, int aHeight, char aFillChar, VertAlignTextMode aVertAlignTextMode)
VertAlignTextMode
specified, the
default is VertAlignTextMode.TOP
. When filling up a line, a
String
filled with space (" ") characters the length of the first
element in the array is used.aTextBlock
- The text block to be filled up / truncated.aHeight
- The height of the resulting text block.aFillChar
- the a fill charaVertAlignTextMode
- The mode on how to fill up the text block. The
mode can be VertAlignTextMode.BOTTOM
,
VertAlignTextMode.CENTER
or VertAlignTextMode.TOP
public String[] getText()
TextAccessor
getText
in interface TextAccessor
public void setText(String... aText)
TextAccessor.TextMutator
setText
in interface TextAccessor.TextMutator
aText
- The text to be stored by the text property.public B withText(String... aText)
public B withText(Collection<String> aText)
withText
in interface TextAccessor.TextBuilder<Text<B extends Text<B>>>
aText
- the a textpublic String toString()
TextAccessor.TextProvider
String
being build by the builder upon the settings of
the attributes. In case more then one line has been set as input and
the functionality of the builder is applied to each line in separate,
then this method returns all of them lines concatenated with a line
break between each of them (implementation depended).toString
in interface TextAccessor.TextProvider
toString
in class Object
String
public String toString(String... aText)
Text
Text.withText(String...)
followed by TextAccessor.TextProvider.toString()
.
Implementation requirements: This method must not(!) be implemented by
calling Text.withText(String...)
followed by TextAccessor.TextProvider.toString()
(do
not change the text property) as this would not be thread safe!Copyright © 2017. All rights reserved.