Class AsciiArtBuilderImpl

    • Constructor Detail

      • AsciiArtBuilderImpl

        public AsciiArtBuilderImpl​()
    • Method Detail

      • getPixmapRatioMode

        public PixmapRatioMode getPixmapRatioMode​()
        Retrieves the Pixmap ratio mode from the Pixmap ratio mode property.
        Specified by:
        getPixmapRatioMode in interface AsciiArtBuilder
        Returns:
        The Pixmap ratio mode stored by the Pixmap ratio mode property.
      • setPixmapRatioMode

        public void setPixmapRatioMode​(PixmapRatioMode aPixmapRatioMode)
        Sets the Pixmap ratio mode for the Pixmap ratio mode property.
        Specified by:
        setPixmapRatioMode in interface AsciiArtBuilder
        Parameters:
        aPixmapRatioMode - The Pixmap ratio mode to be stored by the text strip mode property.
      • getRgbPixmap

        public org.refcodes.graphical.RgbPixmap getRgbPixmap​()
        Retrieves the Pixmap from the Pixmap property.
        Specified by:
        getRgbPixmap in interface AsciiArtBuilder
        Returns:
        The Pixmap stored by the Pixmap property.
      • withColumnWidth

        public AsciiArtBuilder withColumnWidth​(int aColumnWidth)
        Specified by:
        withColumnWidth in interface org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<AsciiArtBuilder>
      • setColumnWidth

        public void setColumnWidth​(int aColumnWidth)
        Specified by:
        setColumnWidth in interface org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator
      • getColumnWidth

        public int getColumnWidth​()
        Specified by:
        getColumnWidth in interface org.refcodes.mixin.ColumnWidthAccessor
      • getFont

        public Font getFont​()
        Retrieves the font from the font property.
        Specified by:
        getFont in interface FontAccessor
        Returns:
        The font stored by the font property.
      • setFont

        public void setFont​(Font aFont)
        Sets the font for the font property.
        Specified by:
        setFont in interface FontAccessor.FontMutator
        Parameters:
        aFont - The font to be stored by the font property.
      • getAsciiArtMode

        public AsciiArtMode getAsciiArtMode​()
        Retrieves the ASCII_HEADER_ASCII_BODY art mode from the ASCII_HEADER_ASCII_BODY art mode property.
        Specified by:
        getAsciiArtMode in interface AsciiArtBuilder
        Returns:
        The ASCII_HEADER_ASCII_BODY art mode stored by the ASCII_HEADER_ASCII_BODY art mode property.
      • setAsciiArtMode

        public void setAsciiArtMode​(AsciiArtMode aAsciiArtMode)
        Sets the ASCII_HEADER_ASCII_BODY art mode for the ASCII_HEADER_ASCII_BODY art mode property.
        Specified by:
        setAsciiArtMode in interface AsciiArtBuilder
        Parameters:
        aAsciiArtMode - The ASCII_HEADER_ASCII_BODY art mode to be stored by the text strip mode property.
      • getAsciiColors

        public char[] getAsciiColors​()
        Retrieves the ASCII_HEADER_ASCII_BODY colors from the ASCII_HEADER_ASCII_BODY colors property.
        Specified by:
        getAsciiColors in interface AsciiArtBuilder
        Returns:
        The ASCII_HEADER_ASCII_BODY colors stored by the ASCII_HEADER_ASCII_BODY colors property.
      • setAsciiColors

        public void setAsciiColors​(char... aAsciiColors)
        Sets the ASCII_HEADER_ASCII_BODY colors for the ASCII_HEADER_ASCII_BODY colors property.
        Specified by:
        setAsciiColors in interface AsciiArtBuilder
        Parameters:
        aAsciiColors - The ASCII_HEADER_ASCII_BODY colors to be stored by the ASCII_HEADER_ASCII_BODY colors property.
      • getAsciiColorPalette

        public org.refcodes.data.AsciiColorPalette getAsciiColorPalette​()
        Retrieves the ASCII_HEADER_ASCII_BODY color palette from the ASCII_HEADER_ASCII_BODY color palette property.
        Specified by:
        getAsciiColorPalette in interface AsciiArtBuilder
        Returns:
        The ASCII_HEADER_ASCII_BODY color palette stored by the ASCII_HEADER_ASCII_BODY color palette property.
      • setAsciiColorPalette

        public void setAsciiColorPalette​(org.refcodes.data.AsciiColorPalette aAsciiColorPalette)
        Sets the ASCII_HEADER_ASCII_BODY color palette for the ASCII_HEADER_ASCII_BODY color palette property.
        Specified by:
        setAsciiColorPalette in interface AsciiArtBuilder
        Parameters:
        aAsciiColorPalette - The ASCII_HEADER_ASCII_BODY color palette to be stored by the ASCII_HEADER_ASCII_BODY color palette property.
      • getFontType

        public FontType getFontType​()
        Retrieves the font type from the font type property.
        Specified by:
        getFontType in interface FontTypeAccessor
        Returns:
        The font type stored by the font type property.
      • setFontType

        public void setFontType​(FontType aFontName)
        Sets the font type for the font type property.
        Specified by:
        setFontType in interface FontTypeAccessor.FontTypeMutator
        Parameters:
        aFontName - The font type to be stored by the font type property.
      • getFontStyle

        public FontStyle getFontStyle​()
        Retrieves the font style from the font style property.
        Specified by:
        getFontStyle in interface FontStyleAccessor
        Returns:
        The font style stored by the font style property.
      • getFontSize

        public int getFontSize​()
        Retrieves the font style from the font style property.
        Specified by:
        getFontSize in interface FontSizeAccessor
        Returns:
        The font style stored by the font style property.
      • setFontSize

        public void setFontSize​(int aFontSize)
        Sets the font style for the font style property.
        Specified by:
        setFontSize in interface FontSizeAccessor.FontSizeMutator
        Parameters:
        aFontSize - The font style to be stored by the font style property.
      • getFontName

        public java.lang.String getFontName​()
        Retrieves the font name from the font name property.
        Specified by:
        getFontName in interface FontNameAccessor
        Returns:
        The font name stored by the font name property.
      • setFontName

        public void setFontName​(java.lang.String aFontName)
        Sets the font name for the font name property.
        Specified by:
        setFontName in interface FontNameAccessor.FontNameMutator
        Parameters:
        aFontName - The font name to be stored by the font name property.
      • setRgbPixmap

        public void setRgbPixmap​(org.refcodes.graphical.RgbPixmap aPixmap)
        Sets the Pixmap for the Pixmap property.
        Specified by:
        setRgbPixmap in interface AsciiArtBuilder
        Parameters:
        aPixmap - The Pixmap to be stored by the Pixmap property.
      • toStrings

        public java.lang.String[] toStrings​()
        The Strings being build by the builder upon the settings of the attributes.
        Specified by:
        toStrings in interface TextAccessor.TextProvider
        Returns:
        The according resulting String array
      • toAsciiArt

        protected static java.lang.String[] toAsciiArt​(java.lang.String[] aLines,
                                                       int aWidth,
                                                       java.lang.String aFontName,
                                                       int aFontStyle,
                                                       int aFontSize,
                                                       char[] aPalette,
                                                       AsciiArtMode aAsciiArtMode)
        To ascii art.
        Parameters:
        aLines - the lines
        aWidth - the width
        aFontName - the font name
        aFontStyle - the font style
        aFontSize - the font size
        aPalette - the palette
        aAsciiArtMode - the ascii art mode
        Returns:
        the string[]
      • toAsciiArt

        protected static java.lang.String[] toAsciiArt​(java.lang.String[] aLines,
                                                       int aWidth,
                                                       java.awt.Font aFont,
                                                       char[] aPalette,
                                                       AsciiArtMode aAsciiArtMode)
        To ascii art.
        Parameters:
        aLines - the lines
        aWidth - the width
        aFont - the font
        aPalette - the palette
        aAsciiArtMode - the ascii art mode
        Returns:
        the string[]
      • toAsciiArt

        protected static java.lang.String[] toAsciiArt​(java.lang.String aText,
                                                       int aWidth,
                                                       java.lang.String aFontName,
                                                       int aFontStyle,
                                                       int aFontSize,
                                                       char[] aPalette,
                                                       AsciiArtMode aAsciiArtMode)
        To ascii art.
        Parameters:
        aText - the text
        aWidth - the width
        aFontName - the font name
        aFontStyle - the font style
        aFontSize - the font size
        aPalette - the palette
        aAsciiArtMode - the ascii art mode
        Returns:
        the string[]
      • toAsciiArt

        protected static java.lang.String[] toAsciiArt​(java.lang.String aText,
                                                       int aWidth,
                                                       java.awt.Font aFont,
                                                       char[] aPalette,
                                                       AsciiArtMode aAsciiArtMode)
        To ascii art.
        Parameters:
        aText - the text
        aWidth - the width
        aFont - the font
        aPalette - the palette
        aAsciiArtMode - the ascii art mode
        Returns:
        the string[]
      • toAsciiArt

        protected static java.lang.String[] toAsciiArt​(org.refcodes.graphical.RgbPixmap aPixmap,
                                                       int aColumnWidth,
                                                       char[] aPalette,
                                                       AsciiArtMode aAsciiArtMode,
                                                       PixmapRatioMode aPixmapRatioMode)
        To ascii art.
        Parameters:
        aPixmap - the pixmap
        aColumnWidth - the column width
        aPalette - the palette
        aAsciiArtMode - the ascii art mode
        aPixmapRatioMode - the pixmap ratio mode
        Returns:
        the string[]
      • toAsciiArt

        protected static java.lang.String[] toAsciiArt​(org.refcodes.graphical.RgbPixmap aPixmap,
                                                       char[] aPalette)
        To ascii art.
        Parameters:
        aPixmap - the pixmap
        aPalette - the palette
        Returns:
        the string[]
      • toInverseAsciiArt

        protected static java.lang.String[] toInverseAsciiArt​(org.refcodes.graphical.RgbPixmap aPixmap,
                                                              char[] aPalette)
        To inverse ascii art.
        Parameters:
        aPixmap - the pixmap
        aPalette - the palette
        Returns:
        the string[]
      • toAsciiArt

        protected static java.lang.String[] toAsciiArt​(java.lang.String aText,
                                                       int aWidth,
                                                       java.lang.String aFontName,
                                                       int aFontStyle,
                                                       char[] aPalette)
        This method creates an array of String instances containing the given text as so called ASCII_HEADER_ASCII_BODY art rendered with the given Font name and Font Style to fit into the given width.
        Parameters:
        aText - The text to be rendered as ASCII_HEADER_ASCII_BODY art.
        aWidth - the width
        aFontName - The Font name to be used when rendering to ASCII_HEADER_ASCII_BODY art.
        aFontStyle - The Font style to be used when rendering to ASCII_HEADER_ASCII_BODY art.
        aPalette - The character palate to use when converting an RGB value to an ASCII_HEADER_ASCII_BODY character. The first character represents white, the last character represents black, the characters in between are gradients from white to black.
        Returns:
        An array of String instances, when printed out in the order as returned, visualize the provided text in the given Font as ASCII_HEADER_ASCII_BODY art.
      • toAsciiArt

        protected static java.lang.String[] toAsciiArt​(java.lang.String aText,
                                                       int aWidth,
                                                       java.awt.Font aFont,
                                                       char[] aPalette)
        This method creates an array of String instances containing the given text as so called ASCII_HEADER_ASCII_BODY art rendered with the given Font name and Font Style to fit into the given width.
        Parameters:
        aText - The text to be rendered as ASCII_HEADER_ASCII_BODY art.
        aWidth - the width
        aFont - the font
        aPalette - The character palate to use when converting an RGB value to an ASCII_HEADER_ASCII_BODY character. The first character represents white, the last character represents black, the characters in between are gradients from white to black.
        Returns:
        An array of String instances, when printed out in the order as returned, visualize the provided text in the given Font as ASCII_HEADER_ASCII_BODY art.
      • toInverseAsciiArt

        protected static java.lang.String[] toInverseAsciiArt​(java.lang.String aText,
                                                              int aWidth,
                                                              java.lang.String aFontName,
                                                              int aFontStyle,
                                                              char[] aPalette)
        Same as toAsciiArt(java.lang.String[],int,java.lang.String,int,int,char[],org.refcodes.textual.AsciiArtMode) with inverted colors (black = white, dark = bright, bright = dark, white = black).
        Parameters:
        aText - The text to be rendered as ASCII_HEADER_ASCII_BODY art.
        aWidth - the width
        aFontName - The Font name to be used when rendering to ASCII_HEADER_ASCII_BODY art.
        aFontStyle - The Font style to be used when rendering to ASCII_HEADER_ASCII_BODY art.
        aPalette - The character palate to use when converting an RGB value to an ASCII_HEADER_ASCII_BODY character. The first character represents white, the last character represents black, the characters in between are gradients from white to black.
        Returns:
        An array of String instances, when printed out in the order as returned, visualize the provided text in the given Font as ASCII_HEADER_ASCII_BODY art.
      • toInverseAsciiArt

        protected static java.lang.String[] toInverseAsciiArt​(java.lang.String aText,
                                                              int aWidth,
                                                              java.awt.Font aFont,
                                                              char[] aPalette)
        Same as toAsciiArt(java.lang.String[],int,java.lang.String,int,int,char[],org.refcodes.textual.AsciiArtMode) with inverted colors (black = white, dark = bright, bright = dark, white = black).
        Parameters:
        aText - The text to be rendered as ASCII_HEADER_ASCII_BODY art.
        aWidth - the width
        aFont - The Font to be used when rendering to ASCII_HEADER_ASCII_BODY art.
        aPalette - The character palate to use when converting an RGB value to an ASCII_HEADER_ASCII_BODY character. The first character represents white, the last character represents black, the characters in between are gradients from white to black.
        Returns:
        An array of String instances, when printed out in the order as returned, visualize the provided text in the given Font as ASCII_HEADER_ASCII_BODY art.
      • toAsciiArt

        protected static java.lang.String[] toAsciiArt​(java.lang.String aText,
                                                       int aWidth,
                                                       java.lang.String aFontName,
                                                       int aFontStyle)
        This method creates an array of String instances containing the given text as so called ASCII_HEADER_ASCII_BODY art rendered with the given Font name and Font Style to fit into the given width.
        Parameters:
        aText - The text to be rendered as ASCII_HEADER_ASCII_BODY art.
        aWidth - the width
        aFontName - The Font name to be used when rendering to ASCII_HEADER_ASCII_BODY art.
        aFontStyle - The Font style to be used when rendering to ASCII_HEADER_ASCII_BODY art.
        Returns:
        An array of String instances, when printed out in the order as returned, visualize the provided text in the given Font as ASCII_HEADER_ASCII_BODY art.
      • toInverseAsciiArt

        protected static java.lang.String[] toInverseAsciiArt​(java.lang.String aText,
                                                              int aWidth,
                                                              java.lang.String aFontName,
                                                              int aFontStyle)
        Same as toAsciiArt(java.lang.String[],int,java.lang.String,int,int,char[],org.refcodes.textual.AsciiArtMode) with inverted colors (black = white, dark = bright, bright = dark, white = black).
        Parameters:
        aText - The text to be rendered as ASCII_HEADER_ASCII_BODY art.
        aWidth - the width
        aFontName - The Font name to be used when rendering to ASCII_HEADER_ASCII_BODY art.
        aFontStyle - The Font style to be used when rendering to ASCII_HEADER_ASCII_BODY art.
        Returns:
        An array of String instances, when printed out in the order as returned, visualize the provided text in the given Font as ASCII_HEADER_ASCII_BODY art.
      • toAsciiArt

        protected static java.lang.String[] toAsciiArt​(java.lang.String aText,
                                                       java.awt.Font aFont)
        This method creates an array of String instances containing the given text rendered with the given Font as so called ASCII_HEADER_ASCII_BODY art.
        Parameters:
        aText - The text to be rendered as ASCII_HEADER_ASCII_BODY art.
        aFont - The Font to render the ASCII_HEADER_ASCII_BODY art.
        Returns:
        An array of String instances, when printed out in the order as returned, visualize the provided text in the given Font as ASCII_HEADER_ASCII_BODY art.
      • toInverseAsciiArt

        protected static java.lang.String[] toInverseAsciiArt​(java.lang.String aText,
                                                              java.awt.Font aFont)
        Same as toAsciiArt(java.lang.String[],int,java.lang.String,int,int,char[],org.refcodes.textual.AsciiArtMode) with inverted colors (black = white, dark = bright, bright = dark, white = black).
        Parameters:
        aText - The text to be rendered as ASCII_HEADER_ASCII_BODY art.
        aFont - The Font to render the ASCII_HEADER_ASCII_BODY art.
        Returns:
        An array of String instances, when printed out in the order as returned, visualize the provided text in the given Font as ASCII_HEADER_ASCII_BODY art.
      • toAsciiArt

        protected static java.lang.String[] toAsciiArt​(java.lang.String aText,
                                                       java.awt.Font aFont,
                                                       char[] aPalette)
        This method creates an array of String instances containing the given text rendered with the given Font as so called ASCII_HEADER_ASCII_BODY art.
        Parameters:
        aText - The text to be rendered as ASCII_HEADER_ASCII_BODY art.
        aFont - The Font to render the ASCII_HEADER_ASCII_BODY art.
        aPalette - The character palate to use when converting an RGB value to an ASCII_HEADER_ASCII_BODY character. The first character represents white, the last character represents black, the characters in between are gradients from white to black.
        Returns:
        An array of String instances, when printed out in the order as returned, visualize the provided text in the given Font as ASCII_HEADER_ASCII_BODY art.
      • toInverseAsciiArt

        protected static java.lang.String[] toInverseAsciiArt​(java.lang.String aText,
                                                              java.awt.Font aFont,
                                                              char[] aPalette)
        Same as toAsciiArt(java.lang.String[],int,java.lang.String,int,int,char[],org.refcodes.textual.AsciiArtMode) with inverted colors (black = white, dark = bright, bright = dark, white = black).
        Parameters:
        aText - The text to be rendered as ASCII_HEADER_ASCII_BODY art.
        aFont - The Font to render the ASCII_HEADER_ASCII_BODY art.
        aPalette - The character palate to use when converting an RGB value to an ASCII_HEADER_ASCII_BODY character. The first character represents white, the last character represents black, the characters in between are gradients from white to black.
        Returns:
        An array of String instances, when printed out in the order as returned, visualize the provided text in the given Font as ASCII_HEADER_ASCII_BODY art.
      • toAscii

        protected static char toAscii​(int aRgbValue,
                                      char[] aPalette)
        Converts an RGB value to an ASCII_HEADER_ASCII_BODY character from a palette if characters as provided.
        Parameters:
        aRgbValue - The RGB value to be converted to an ASCII_HEADER_ASCII_BODY character.
        aPalette - The character palate to use when converting an RGB value to an ASCII_HEADER_ASCII_BODY character. The first character represents white, the last character represents black, the characters in between are gradients from white to black.
        Returns:
        the char
      • toAscii

        protected static char toAscii​(int aRgbValue)
        Converts an RGB value to an ASCII_HEADER_ASCII_BODY character from a palette if characters as provided.
        Parameters:
        aRgbValue - The RGB value to be converted to an ASCII_HEADER_ASCII_BODY character.
        Returns:
        the char
      • getText

        public java.lang.String[] getText​()
        Retrieves the text from the text property.
        Specified by:
        getText in interface TextAccessor
        Returns:
        The text stored by the text property.
      • setText

        public void setText​(java.lang.String... aText)
        Sets the text for the text property.
        Specified by:
        setText in interface TextAccessor.TextMutator
        Parameters:
        aText - The text to be stored by the text property.
      • withText

        public B withText​(java.lang.String... aText)
        With text.
        Specified by:
        withText in interface Text<B extends Text<B>>
        Specified by:
        withText in interface TextAccessor.TextBuilder<B extends Text<B>>
        Parameters:
        aText - the text
        Returns:
        the b
      • withText

        public B withText​(java.util.Collection<java.lang.String> aText)
        With text.
        Specified by:
        withText in interface TextAccessor.TextBuilder<B extends Text<B>>
        Parameters:
        aText - the text
        Returns:
        the b
      • toString

        public java.lang.String toString​()
        The 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).
        Specified by:
        toString in interface TextAccessor.TextProvider
        Overrides:
        toString in class java.lang.Object
        Returns:
        The according resulting String