public class AsciiArtBuilderImpl extends Object implements AsciiArtBuilder
TextAccessor.TextBuilder<B extends TextAccessor.TextBuilder<B>>, TextAccessor.TextMutator, TextAccessor.TextProperty, TextAccessor.TextProvider
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
FontNameAccessor.FontNameBuilder<B extends FontNameAccessor.FontNameBuilder<B>>, FontNameAccessor.FontNameMutator, FontNameAccessor.FontNameProperty
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.
|
org.refcodes.data.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.
|
String |
getFontName()
Retrieves the font name from the font name 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(org.refcodes.data.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 |
setFontName(String aFontName)
Sets the font name for the font name 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,
int aColumnWidth,
char[] aPalette,
AsciiArtMode aAsciiArtMode,
PixmapRatioMode aPixmapRatioMode) |
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 TextAccessor.TextProvider.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 TextAccessor.TextProvider.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 |
withFontName(String aFontName)
Sets the font name for the font name 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
setAsciiColors, setImageFile, toString, toStrings, withAsciiArtMode, withAsciiColorPalette, withAsciiColors, withAsciiColors, withImageFile, withPixmapRatioMode, withRgbPixmap
getText
setText, setText
withText
toString
public PixmapRatioMode getPixmapRatioMode()
AsciiArtBuilder
Pixmap
ratio mode from the Pixmap
ratio
mode property.getPixmapRatioMode
in interface AsciiArtBuilder
Pixmap
ratio mode stored by the Pixmap
ratio
mode property.public void setPixmapRatioMode(PixmapRatioMode aPixmapRatioMode)
AsciiArtBuilder
Pixmap
ratio mode for the Pixmap
ratio mode
property.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
Pixmap
from the Pixmap
property.getRgbPixmap
in interface AsciiArtBuilder
Pixmap
stored by the Pixmap
property.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 ASCII colors
property.public org.refcodes.data.AsciiColorPalette getAsciiColorPalette()
AsciiArtBuilder
getAsciiColorPalette
in interface AsciiArtBuilder
public void setAsciiColorPalette(org.refcodes.data.AsciiColorPalette aAsciiColorPalette)
AsciiArtBuilder
setAsciiColorPalette
in interface AsciiArtBuilder
aAsciiColorPalette
- The ASCII color palette to be stored by the
ASCII color palette 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 String getFontName()
FontNameAccessor
getFontName
in interface FontNameAccessor
public void setFontName(String aFontName)
FontNameAccessor.FontNameMutator
setFontName
in interface FontNameAccessor.FontNameMutator
aFontName
- The font name to be stored by the font name
property.public AsciiArtBuilder withFontName(String aFontName)
FontNameAccessor.FontNameBuilder
withFontName
in interface FontNameAccessor.FontNameBuilder<AsciiArtBuilder>
aFontName
- The font name to be stored by the font name
property.public void setRgbPixmap(org.refcodes.graphical.RgbPixmap aPixmap)
AsciiArtBuilder
Pixmap
for the Pixmap
property.setRgbPixmap
in interface AsciiArtBuilder
aPixmap
- The Pixmap
to be stored by the Pixmap
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<AsciiArtBuilder>
aText
- The text to be processed.String
arraypublic String toString(org.refcodes.graphical.RgbPixmap aPixmap)
AsciiArtBuilder
AsciiArtBuilder.withRgbPixmap(RgbPixmap)
followed by TextAccessor.TextProvider.toString()
.
Implementation requirements: This method must not(!) be implemented by
calling AsciiArtBuilder.withRgbPixmap(RgbPixmap)
followed by TextAccessor.TextProvider.toString()
(do not change the Pixmap
property) as this would not be thread
safe!toString
in interface AsciiArtBuilder
aPixmap
- The Pixmap
to be converted to AsciiArt.String
public String[] toStrings(org.refcodes.graphical.RgbPixmap aPixmap)
AsciiArtBuilder
AsciiArtBuilder.withRgbPixmap(RgbPixmap)
followed by TextAccessor.TextProvider.toStrings()
.
Implementation requirements: This method must not(!) be implemented by
calling AsciiArtBuilder.withRgbPixmap(RgbPixmap)
followed by
TextAccessor.TextProvider.toStrings()
(do not change the Pixmap
property) as this
would not be thread safe!toStrings
in interface AsciiArtBuilder
aPixmap
- The Pixmap
to be converted to AsciiArt.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, int aColumnWidth, char[] aPalette, AsciiArtMode aAsciiArtMode, PixmapRatioMode aPixmapRatioMode)
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()
String
being build by the builder upon the settings of the
attributes. The string array is returned as a single String
with
the operating system's end of line marker (CR on on Windows and CR LF on
*nix operating systems) as determined by
SystemUtility.getLineBreak()
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.