Class VertAlignTextBuilderImpl

    • Constructor Detail

      • VertAlignTextBuilderImpl

        public VertAlignTextBuilderImpl()
    • Method Detail

      • setRowHeight

        public void setRowHeight​(int aRowHeight)
        Specified by:
        setRowHeight in interface org.refcodes.mixin.RowHeightAccessor.RowHeightMutator
      • getRowHeight

        public int getRowHeight()
        Specified by:
        getRowHeight in interface org.refcodes.mixin.RowHeightAccessor
      • getVertAlignTextMode

        public VertAlignTextMode getVertAlignTextMode()
        Retrieves the vertical align text mode from the vertical align text mode property.
        Specified by:
        getVertAlignTextMode in interface VertAlignTextModeAccessor
        Returns:
        The vertical align text mode stored by the vertical align text mode property.
      • getFillChar

        public char getFillChar()
        Retrieves the fill char from the fill char property.
        Specified by:
        getFillChar in interface VertAlignTextBuilder
        Returns:
        The fill char stored by the fill char property.
      • setFillChar

        public void setFillChar​(char aFillChar)
        Sets the fill char for the fill char property.
        Specified by:
        setFillChar in interface VertAlignTextBuilder
        Parameters:
        aFillChar - The fill char to be stored by the align text mode 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
      • toTextBlock

        protected static java.lang.String[] toTextBlock​(java.lang.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. When filling up a line, a String filled with space (" ") characters the length of the first element in the array is used.
        Parameters:
        aTextBlock - The text block to be filled up / truncated.
        aHeight - The height of the resulting text block.
        aFillChar - the fill char
        aVertAlignTextMode - The mode on how to fill up the text block. The mode can be VertAlignTextMode.BOTTOM, VertAlignTextMode.CENTER or VertAlignTextMode.TOP
        Returns:
        The text block filled up / truncated to the required height.
      • 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