Class Font

  • All Implemented Interfaces:
    Comparable<AbstractStyle>

    public class Font
    extends AbstractStyle
    Class representing a Font entry. The Font entry is used to define text formatting
    Author:
    Raphael Stoeckli
    • Constructor Detail

      • Font

        public Font()
        Default constructor
    • Method Detail

      • getSize

        public int getSize()
        Gets the font size. Valid range is from 8 to 75
        Returns:
        Font size
      • setSize

        public void setSize​(int size)
        Sets the Font size. Valid range is from 8 to 75
        Parameters:
        size - Font size
      • getName

        public String getName()
        Gets the font name (Default is Calibri)
        Returns:
        Font name
      • setName

        public void setName​(String name)
        Sets the font name (Default is Calibri)
        Parameters:
        name - Font name
      • getFamily

        public String getFamily()
        Gets the font family (Default is 2)
        Returns:
        Font family
      • setFamily

        public void setFamily​(String family)
        Sets the font family (Default is 2)
        Parameters:
        family - Font family
      • getColorTheme

        public int getColorTheme()
        Gets the font color theme (Default is 1)
        Returns:
        Font color theme
      • setColorTheme

        public void setColorTheme​(int colorTheme)
        Sets the font color theme (Default is 1)
        Parameters:
        colorTheme - Font color theme
      • getColorValue

        public String getColorValue()
        Gets the Font color (default is empty)
        Returns:
        Font color
      • setColorValue

        public void setColorValue​(String colorValue)
        Sets the font color (default is empty)
        Parameters:
        colorValue - Font color
      • getScheme

        public Font.SchemeValue getScheme()
        Gets the font scheme (Default is minor)
        Returns:
        Font scheme
      • setScheme

        public void setScheme​(Font.SchemeValue scheme)
        Sets the Font scheme (Default is minor)
        Parameters:
        scheme - Font scheme
      • getVerticalAlign

        public Font.VerticalAlignValue getVerticalAlign()
        Gets the alignment of the font (Default is none)
        Returns:
        Alignment of the font
      • setVerticalAlign

        public void setVerticalAlign​(Font.VerticalAlignValue verticalAlign)
        Sets the Alignment of the font (Default is none)
        Parameters:
        verticalAlign - Alignment of the font
      • isBold

        public boolean isBold()
        Gets the bold parameter of the font
        Returns:
        If true, the font is bold
      • setBold

        public void setBold​(boolean bold)
        Sets the bold parameter of the font
        Parameters:
        bold - If true, the font is bold
      • isItalic

        public boolean isItalic()
        Gets the italic parameter of the font
        Returns:
        If true, the font is italic
      • setItalic

        public void setItalic​(boolean italic)
        Sets the italic parameter of the font
        Parameters:
        italic - If true, the font is italic
      • isUnderline

        public boolean isUnderline()
        Gets the underline parameter of the font
        Returns:
        If true, the font as one underline
      • setUnderline

        public void setUnderline​(boolean underline)
        Sets the underline parameter of the font
        Parameters:
        underline - If true, the font as one underline
      • isDoubleUnderline

        public boolean isDoubleUnderline()
        Gets the double-underline parameter of the font
        Returns:
        If true, the font ha a double underline
      • setDoubleUnderline

        public void setDoubleUnderline​(boolean doubleUnderline)
        Sets the double-underline parameter of the font
        Parameters:
        doubleUnderline - If true, the font ha a double underline
      • isStrike

        public boolean isStrike()
        Gets whether the font is struck through
        Returns:
        If true, the font is declared as strike-through
      • setStrike

        public void setStrike​(boolean strike)
        Sets whether the font is struck through
        Parameters:
        strike - If true, the font is declared as strike-through
      • getCharset

        public String getCharset()
        Gets the charset of the Font (Default is empty)
        Returns:
        Charset of the Font
      • setCharset

        public void setCharset​(String charset)
        Sets the charset of the Font (Default is empty)
        Parameters:
        charset - Charset of the Font
      • isDefaultFont

        public boolean isDefaultFont()
        Gets whether this object is the default font
        Returns:
        In true the font is equals the default font
      • toString

        public String toString()
        Override toString method
        Overrides:
        toString in class Object
        Returns:
        String of a class instance
      • copy

        public Font copy()
        Method to copy the current object to a new one
        Specified by:
        copy in class AbstractStyle
        Returns:
        Copy of the current object without the internal ID
      • hashCode

        public int hashCode()
        Override method to calculate the hash of this component
        Overrides:
        hashCode in class Object
        Returns:
        Calculated hash as string