public class AsciiArtBuilderImpl extends Object implements AsciiArtBuilder
TextAccessor.TextBuilder<B extends TextAccessor.TextBuilder<B>>, TextAccessor.TextMutator, TextAccessor.TextProperty
FontAccessor.FontBuilder<B extends FontAccessor.FontBuilder<B>>, FontAccessor.FontMutator, FontAccessor.FontProperty
FontTypeAccessor.FontTypeBuilder<B extends FontTypeAccessor.FontTypeBuilder<B>>, FontTypeAccessor.FontTypeMutator, FontTypeAccessor.FontTypeProperty
FontStyleAccessor.FontStyleBuilder<B extends FontStyleAccessor.FontStyleBuilder<B>>, FontStyleAccessor.FontStyleMutator, FontStyleAccessor.FontStyleProperty
FontSizeAccessor.FontSizeBuilder<B extends FontSizeAccessor.FontSizeBuilder<B>>, FontSizeAccessor.FontSizeMutator, FontSizeAccessor.FontSizeProperty
org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<B extends org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<B>>, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty
Constructor and Description |
---|
AsciiArtBuilderImpl() |
Modifier and Type | Method and Description |
---|---|
AsciiArtMode |
getAsciiArtMode()
Retrieves the ASCII art mode from the ASCII art mode property.
|
AsciiColorPalette |
getAsciiColorPalette()
Retrieves the ASCII color palette from the ASCII color palette property.
|
char[] |
getAsciiColors()
Retrieves the ASCII colors from the ASCII colors property.
|
int |
getColumnWidth() |
Font |
getFont()
Retrieves the font from the font property.
|
int |
getFontSize()
Retrieves the font style from the font style property.
|
FontStyle |
getFontStyle()
Retrieves the font style from the font style property.
|
FontType |
getFontType()
Retrieves the font type from the font type property.
|
PixmapRatioMode |
getPixmapRatioMode()
Retrieves the pixmap ratio mode from the pixmap ratio mode property.
|
org.refcodes.graphical.RgbPixmap |
getRgbPixmap()
Retrieves the pixmap from the pixmap property.
|
String[] |
getText()
Retrieves the text from the text property.
|
void |
setAsciiArtMode(AsciiArtMode aAsciiArtMode)
Sets the ASCII art mode for the ASCII art mode property.
|
void |
setAsciiColorPalette(AsciiColorPalette aAsciiColorPalette)
Sets the ASCII color palette for the ASCII color palette property.
|
void |
setAsciiColors(char... aAsciiColors)
Sets the ASCII colors for the ASCII colors property.
|
void |
setColumnWidth(int aColumnWidth) |
void |
setFont(Font aFont)
Sets the font for the font property.
|
void |
setFontSize(int aFontSize)
Sets the font style for the font style property.
|
void |
setFontStyle(FontStyle aFontStyle)
Sets the font style for the font style property.
|
void |
setFontType(FontType aFontName)
Sets the font type for the font type property.
|
void |
setPixmapRatioMode(PixmapRatioMode aPixmapRatioMode)
Sets the pixmap ratio mode for the pixmap ratio mode property.
|
void |
setRgbPixmap(org.refcodes.graphical.RgbPixmap aPixmap)
Sets the pixmap for the pixmap property.
|
void |
setText(String... aText)
Sets the text for the text property.
|
protected static char |
toAscii(int aRgbValue)
Converts an RGB value to an ASCII character from a palette if characters
as provided.
|
protected static char |
toAscii(int aRgbValue,
char[] aPalette)
Converts an RGB value to an ASCII character from a palette if characters
as provided.
|
protected static String[] |
toAsciiArt(org.refcodes.graphical.RgbPixmap aPixmap,
char[] aPalette) |
protected static String[] |
toAsciiArt(org.refcodes.graphical.RgbPixmap aPixmap,
char[] aPalette,
AsciiArtMode aAsciiArtMode) |
protected static String[] |
toAsciiArt(String[] aLines,
int aWidth,
Font aFont,
char[] aPalette,
AsciiArtMode aAsciiArtMode) |
protected static String[] |
toAsciiArt(String[] aLines,
int aWidth,
String aFontName,
int aFontStyle,
int aFontSize,
char[] aPalette,
AsciiArtMode aAsciiArtMode) |
protected static String[] |
toAsciiArt(String aText,
Font aFont)
|
protected static String[] |
toAsciiArt(String aText,
Font aFont,
char[] aPalette)
|
protected static String[] |
toAsciiArt(String aText,
int aWidth,
Font aFont,
char[] aPalette)
This method creates an array of
String instances containing the
given text as so called ASCII art rendered with the given Font
name and Font SOAPBinding.Style to fit into the given width. |
protected static String[] |
toAsciiArt(String aText,
int aWidth,
Font aFont,
char[] aPalette,
AsciiArtMode aAsciiArtMode) |
protected static String[] |
toAsciiArt(String aText,
int aWidth,
String aFontName,
int aFontStyle)
This method creates an array of
String instances containing the
given text as so called ASCII art rendered with the given Font
name and Font SOAPBinding.Style to fit into the given width. |
protected static String[] |
toAsciiArt(String aText,
int aWidth,
String aFontName,
int aFontStyle,
char[] aPalette)
This method creates an array of
String instances containing the
given text as so called ASCII art rendered with the given Font
name and Font SOAPBinding.Style to fit into the given width. |
protected static String[] |
toAsciiArt(String aText,
int aWidth,
String aFontName,
int aFontStyle,
int aFontSize,
char[] aPalette,
AsciiArtMode aAsciiArtMode) |
protected static String[] |
toInverseAsciiArt(org.refcodes.graphical.RgbPixmap aPixmap,
char[] aPalette) |
protected static String[] |
toInverseAsciiArt(String aText,
Font aFont)
Same as
toAsciiArt with inverted colors (black = white, dark =
bright, bright = dark, white = black). |
protected static String[] |
toInverseAsciiArt(String aText,
Font aFont,
char[] aPalette)
Same as
toAsciiArt with inverted colors (black = white, dark =
bright, bright = dark, white = black). |
protected static String[] |
toInverseAsciiArt(String aText,
int aWidth,
Font aFont,
char[] aPalette)
Same as
toAsciiArt with inverted colors (black = white, dark =
bright, bright = dark, white = black). |
protected static String[] |
toInverseAsciiArt(String aText,
int aWidth,
String aFontName,
int aFontStyle)
Same as
toAsciiArt with inverted colors (black = white, dark =
bright, bright = dark, white = black). |
protected static String[] |
toInverseAsciiArt(String aText,
int aWidth,
String aFontName,
int aFontStyle,
char[] aPalette)
Same as
toAsciiArt with inverted colors (black = white, dark =
bright, bright = dark, white = black). |
String |
toString()
The
String being build by the builder upon the settings of the
attributes. |
String |
toString(org.refcodes.graphical.RgbPixmap aPixmap)
Race condition safe shortcut for using
AsciiArtBuilder.withRgbPixmap(RgbPixmap)
followed by Text.toString() . |
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(org.refcodes.graphical.RgbPixmap aPixmap)
Race condition safe shortcut for using
AsciiArtBuilder.withRgbPixmap(RgbPixmap)
followed by Text.toStrings() . |
String[] |
toStrings(String... aText)
Race condition safe shortcut for using
Text.withText(String...) |
AsciiArtBuilder |
withColumnWidth(int aColumnWidth) |
AsciiArtBuilder |
withFont(Font aFont)
Sets the font for the font property.
|
AsciiArtBuilder |
withFontSize(int aFontSize)
Sets the font style for the font style property.
|
AsciiArtBuilder |
withFontStyle(FontStyle aFontStyle)
Sets the font style for the font style property.
|
AsciiArtBuilder |
withFontType(FontType aFontName)
Sets the font type for the font type property.
|
B |
withText(Collection<String> aText)
Sets the text for the text property.
|
B |
withText(String... aText)
Sets the text for the text property.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
withAsciiArtMode, withAsciiColorPalette, withAsciiColors, withPixmapRatioMode, withRgbPixmap
getText
setText, setText
withText
public PixmapRatioMode getPixmapRatioMode()
AsciiArtBuilder
getPixmapRatioMode
in interface AsciiArtBuilder
public void setPixmapRatioMode(PixmapRatioMode aPixmapRatioMode)
AsciiArtBuilder
setPixmapRatioMode
in interface AsciiArtBuilder
aPixmapRatioMode
- The pixmap ratio mode to be stored by the text
strip mode property.public org.refcodes.graphical.RgbPixmap getRgbPixmap()
AsciiArtBuilder
getRgbPixmap
in interface AsciiArtBuilder
public AsciiArtBuilder withColumnWidth(int aColumnWidth)
withColumnWidth
in interface org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<AsciiArtBuilder>
public void setColumnWidth(int aColumnWidth)
setColumnWidth
in interface org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator
public int getColumnWidth()
getColumnWidth
in interface org.refcodes.mixin.ColumnWidthAccessor
public Font getFont()
FontAccessor
getFont
in interface FontAccessor
public void setFont(Font aFont)
FontAccessor.FontMutator
setFont
in interface FontAccessor.FontMutator
aFont
- The font to be stored by the font property.public AsciiArtBuilder withFont(Font aFont)
FontAccessor.FontBuilder
withFont
in interface FontAccessor.FontBuilder<AsciiArtBuilder>
aFont
- The font to be stored by the font property.public AsciiArtMode getAsciiArtMode()
AsciiArtBuilder
getAsciiArtMode
in interface AsciiArtBuilder
public void setAsciiArtMode(AsciiArtMode aAsciiArtMode)
AsciiArtBuilder
setAsciiArtMode
in interface AsciiArtBuilder
aAsciiArtMode
- The ASCII art mode to be stored by the text strip
mode property.public char[] getAsciiColors()
AsciiArtBuilder
getAsciiColors
in interface AsciiArtBuilder
public void setAsciiColors(char... aAsciiColors)
AsciiArtBuilder
setAsciiColors
in interface AsciiArtBuilder
aAsciiColors
- The ASCII colors to be stored by the text align mode
property.public AsciiColorPalette getAsciiColorPalette()
AsciiArtBuilder
getAsciiColorPalette
in interface AsciiArtBuilder
public void setAsciiColorPalette(AsciiColorPalette aAsciiColorPalette)
AsciiArtBuilder
setAsciiColorPalette
in interface AsciiArtBuilder
aAsciiColorPalette
- The ASCII color palette to be stored by the
text align mode property.public FontType getFontType()
FontTypeAccessor
getFontType
in interface FontTypeAccessor
public void setFontType(FontType aFontName)
FontTypeAccessor.FontTypeMutator
setFontType
in interface FontTypeAccessor.FontTypeMutator
aFontName
- The font type to be stored by the font
type property.public AsciiArtBuilder withFontType(FontType aFontName)
FontTypeAccessor.FontTypeBuilder
withFontType
in interface FontTypeAccessor.FontTypeBuilder<AsciiArtBuilder>
aFontName
- The font type to be stored by the font
type property.public FontStyle getFontStyle()
FontStyleAccessor
getFontStyle
in interface FontStyleAccessor
public void setFontStyle(FontStyle aFontStyle)
FontStyleAccessor.FontStyleMutator
setFontStyle
in interface FontStyleAccessor.FontStyleMutator
aFontStyle
- The font style to be stored by the font
style property.public AsciiArtBuilder withFontStyle(FontStyle aFontStyle)
FontStyleAccessor.FontStyleBuilder
withFontStyle
in interface FontStyleAccessor.FontStyleBuilder<AsciiArtBuilder>
aFontStyle
- The font style to be stored by the font
style property.public int getFontSize()
FontSizeAccessor
getFontSize
in interface FontSizeAccessor
public void setFontSize(int aFontSize)
FontSizeAccessor.FontSizeMutator
setFontSize
in interface FontSizeAccessor.FontSizeMutator
aFontSize
- The font style to be stored by the font
style property.public AsciiArtBuilder withFontSize(int aFontSize)
FontSizeAccessor.FontSizeBuilder
withFontSize
in interface FontSizeAccessor.FontSizeBuilder<AsciiArtBuilder>
aFontSize
- The font style to be stored by the font
style property.public void setRgbPixmap(org.refcodes.graphical.RgbPixmap aPixmap)
AsciiArtBuilder
setRgbPixmap
in interface AsciiArtBuilder
aPixmap
- The pixmap to be stored by the text align mode property.public String[] toStrings()
Text
String
s being build by the builder upon the settings of the
attributes.toStrings
in interface Text<AsciiArtBuilder>
String
arraypublic String[] toStrings(String... aText)
Text
Text.withText(String...)
followed by Text.toStrings()
.
Implementation requirements: This method must not(!) be implemented by
calling Text.withText(String...)
followed by Text.toStrings()
(do
not change the text property) as this would not be thread safe!toStrings
in interface Text<AsciiArtBuilder>
aText
- The text to be processed.String
arraypublic String toString(org.refcodes.graphical.RgbPixmap aPixmap)
AsciiArtBuilder
AsciiArtBuilder.withRgbPixmap(RgbPixmap)
followed by Text.toString()
.
Implementation requirements: This method must not(!) be implemented by
calling AsciiArtBuilder.withRgbPixmap(RgbPixmap)
followed by Text.toString()
(do not change the pixmap property) as this would not be thread safe!toString
in interface AsciiArtBuilder
aPixmap
- The pixmap to be stored by the text align mode property.String
arraypublic String[] toStrings(org.refcodes.graphical.RgbPixmap aPixmap)
AsciiArtBuilder
AsciiArtBuilder.withRgbPixmap(RgbPixmap)
followed by Text.toStrings()
.
Implementation requirements: This method must not(!) be implemented by
calling AsciiArtBuilder.withRgbPixmap(RgbPixmap)
followed by
Text.toStrings()
(do not change the pixmap property) as this would
not be thread safe!toStrings
in interface AsciiArtBuilder
aPixmap
- The pixmap to be stored by the text align mode property.String
arrayprotected static String[] toAsciiArt(String[] aLines, int aWidth, String aFontName, int aFontStyle, int aFontSize, char[] aPalette, AsciiArtMode aAsciiArtMode)
protected static String[] toAsciiArt(String[] aLines, int aWidth, Font aFont, char[] aPalette, AsciiArtMode aAsciiArtMode)
protected static String[] toAsciiArt(String aText, int aWidth, String aFontName, int aFontStyle, int aFontSize, char[] aPalette, AsciiArtMode aAsciiArtMode)
protected static String[] toAsciiArt(String aText, int aWidth, Font aFont, char[] aPalette, AsciiArtMode aAsciiArtMode)
protected static String[] toAsciiArt(org.refcodes.graphical.RgbPixmap aPixmap, char[] aPalette, AsciiArtMode aAsciiArtMode)
protected static String[] toAsciiArt(org.refcodes.graphical.RgbPixmap aPixmap, char[] aPalette)
protected static String[] toInverseAsciiArt(org.refcodes.graphical.RgbPixmap aPixmap, char[] aPalette)
protected static String[] toAsciiArt(String aText, int aWidth, String aFontName, int aFontStyle, char[] aPalette)
String
instances containing the
given text as so called ASCII art rendered with the given Font
name and Font
SOAPBinding.Style
to fit into the given width.aText
- The text to be rendered as ASCII art.aFontName
- The Font
name to be used when rendering to ASCII
art.aFontStyle
- The Font
style to be used when rendering to
ASCII art.aPalette
- The character palate to use when converting an RGB value
to an ASCII character. The first character represents white, the
last character represents black, the characters in between are
gradients from white to black.String
instances, when printed out in the
order as returned, visualize the provided text in the given
Font
as ASCII art.protected static String[] toAsciiArt(String aText, int aWidth, Font aFont, char[] aPalette)
String
instances containing the
given text as so called ASCII art rendered with the given Font
name and Font
SOAPBinding.Style
to fit into the given width.aText
- The text to be rendered as ASCII art.aFontName
- The Font
name to be used when rendering to ASCII
art.aFontStyle
- The Font
style to be used when rendering to
ASCII art.aPalette
- The character palate to use when converting an RGB value
to an ASCII character. The first character represents white, the
last character represents black, the characters in between are
gradients from white to black.String
instances, when printed out in the
order as returned, visualize the provided text in the given
Font
as ASCII art.protected static String[] toInverseAsciiArt(String aText, int aWidth, String aFontName, int aFontStyle, char[] aPalette)
toAsciiArt
with inverted colors (black = white, dark =
bright, bright = dark, white = black).aText
- The text to be rendered as ASCII art.aFontName
- The Font
name to be used when rendering to ASCII
art.aFontStyle
- The Font
style to be used when rendering to
ASCII art.aPalette
- The character palate to use when converting an RGB value
to an ASCII character. The first character represents white, the
last character represents black, the characters in between are
gradients from white to black.String
instances, when printed out in the
order as returned, visualize the provided text in the given
Font
as ASCII art.protected static String[] toInverseAsciiArt(String aText, int aWidth, Font aFont, char[] aPalette)
toAsciiArt
with inverted colors (black = white, dark =
bright, bright = dark, white = black).aText
- The text to be rendered as ASCII art.aFont
- The Font
to be used when rendering to ASCII art.aPalette
- The character palate to use when converting an RGB value
to an ASCII character. The first character represents white, the
last character represents black, the characters in between are
gradients from white to black.String
instances, when printed out in the
order as returned, visualize the provided text in the given
Font
as ASCII art.protected static String[] toAsciiArt(String aText, int aWidth, String aFontName, int aFontStyle)
String
instances containing the
given text as so called ASCII art rendered with the given Font
name and Font
SOAPBinding.Style
to fit into the given width.aText
- The text to be rendered as ASCII art.aFontName
- The Font
name to be used when rendering to ASCII
art.aFontStyle
- The Font
style to be used when rendering to
ASCII art.String
instances, when printed out in the
order as returned, visualize the provided text in the given
Font
as ASCII art.protected static String[] toInverseAsciiArt(String aText, int aWidth, String aFontName, int aFontStyle)
toAsciiArt
with inverted colors (black = white, dark =
bright, bright = dark, white = black).aText
- The text to be rendered as ASCII art.aFontName
- The Font
name to be used when rendering to ASCII
art.aFontStyle
- The Font
style to be used when rendering to
ASCII art.String
instances, when printed out in the
order as returned, visualize the provided text in the given
Font
as ASCII art.protected static String[] toInverseAsciiArt(String aText, Font aFont)
toAsciiArt
with inverted colors (black = white, dark =
bright, bright = dark, white = black).protected static String[] toAsciiArt(String aText, Font aFont, char[] aPalette)
String
instances containing the
given text rendered with the given Font
as so called ASCII art.aText
- The text to be rendered as ASCII art.aFont
- The Font
to render the ASCII art.aPalette
- The character palate to use when converting an RGB value
to an ASCII character. The first character represents white, the
last character represents black, the characters in between are
gradients from white to black.String
instances, when printed out in the
order as returned, visualize the provided text in the given
Font
as ASCII art.protected static String[] toInverseAsciiArt(String aText, Font aFont, char[] aPalette)
toAsciiArt
with inverted colors (black = white, dark =
bright, bright = dark, white = black).aText
- The text to be rendered as ASCII art.aFont
- The Font
to render the ASCII art.aPalette
- The character palate to use when converting an RGB value
to an ASCII character. The first character represents white, the
last character represents black, the characters in between are
gradients from white to black.String
instances, when printed out in the
order as returned, visualize the provided text in the given
Font
as ASCII art.protected static char toAscii(int aRgbValue, char[] aPalette)
aRgbValue
- The RGB value to be converted to an ASCII character.aPalette
- The character palate to use when converting an RGB value
to an ASCII character. The first character represents white, the
last character represents black, the characters in between are
gradients from white to black.protected static char toAscii(int aRgbValue)
aRgbValue
- The RGB value to be converted to an ASCII character.aPalette
- The character palate to use when converting an RGB value
to an ASCII character. The first character represents white, the
last character represents black, the characters in between are
gradients from white to black.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)
TextAccessor.TextBuilder
public B withText(Collection<String> aText)
TextAccessor.TextBuilder
withText
in interface TextAccessor.TextBuilder<Text<B extends Text<B>>>
aText
- The text to be stored by the text property.public String toString()
public String toString(String... aText)
Text
Text.withText(String...)
followed by Text.toString()
.
Implementation requirements: This method must not(!) be implemented by
calling Text.withText(String...)
followed by Text.toString()
(do
not change the text property) as this would not be thread safe!Copyright © 2016. All rights reserved.