Class Font

  • All Implemented Interfaces:
    java.lang.Comparable<AbstractStyle>

    public class Font
    extends AbstractStyle
    Class representing a Font entry. The Font entry is used to define text formatting
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Font.SchemeValue
      Enum for the font scheme
      static class  Font.VerticalAlignValue
      Enum for the vertical alignment of the text from base line
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULTFONT
      Default font family as constant
    • Constructor Summary

      Constructors 
      Constructor Description
      Font()
      Default constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Font copy()
      Method to copy the current object to a new one
      java.lang.String getCharset()
      Gets the charset of the Font (Default is empty)
      int getColorTheme()
      Gets the font color theme (Default is 1)
      java.lang.String getColorValue()
      Gets the Font color (default is empty)
      java.lang.String getFamily()
      Gets the font family (Default is 2)
      java.lang.String getName()
      Gets the font name (Default is Calibri)
      Font.SchemeValue getScheme()
      Gets the font scheme (Default is minor)
      int getSize()
      Gets the font size.
      Font.VerticalAlignValue getVerticalAlign()
      Gets the alignment of the font (Default is none)
      int hashCode()
      Override method to calculate the hash of this component
      boolean isBold()
      Gets the bold parameter of the font
      boolean isDefaultFont()
      Gets whether this object is the default font
      boolean isDoubleUnderline()
      Gets the double-underline parameter of the font
      boolean isItalic()
      Gets the italic parameter of the font
      boolean isStrike()
      Gets whether the font is struck through
      boolean isUnderline()
      Gets the underline parameter of the font
      void setBold​(boolean bold)
      Sets the bold parameter of the font
      void setCharset​(java.lang.String charset)
      Sets the charset of the Font (Default is empty)
      void setColorTheme​(int colorTheme)
      Sets the font color theme (Default is 1)
      void setColorValue​(java.lang.String colorValue)
      Sets the font color (default is empty)
      void setDoubleUnderline​(boolean doubleUnderline)
      Sets the double-underline parameter of the font
      void setFamily​(java.lang.String family)
      Sets the font family (Default is 2)
      void setItalic​(boolean italic)
      Sets the italic parameter of the font
      void setName​(java.lang.String name)
      Sets the font name (Default is Calibri)
      void setScheme​(Font.SchemeValue scheme)
      Sets the Font scheme (Default is minor)
      void setSize​(int size)
      Sets the Font size.
      void setStrike​(boolean strike)
      Sets whether the font is struck through
      void setUnderline​(boolean underline)
      Sets the underline parameter of the font
      void setVerticalAlign​(Font.VerticalAlignValue verticalAlign)
      Sets the Alignment of the font (Default is none)
      java.lang.String toString()
      Override toString method
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DEFAULTFONT

        public static final java.lang.String DEFAULTFONT
        Default font family as constant
        See Also:
        Constant Field Values
    • 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 java.lang.String getName()
        Gets the font name (Default is Calibri)
        Returns:
        Font name
      • setName

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

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

        public void setFamily​(java.lang.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 java.lang.String getColorValue()
        Gets the Font color (default is empty)
        Returns:
        Font color
      • setColorValue

        public void setColorValue​(java.lang.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 java.lang.String getCharset()
        Gets the charset of the Font (Default is empty)
        Returns:
        Charset of the Font
      • setCharset

        public void setCharset​(java.lang.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 java.lang.String toString()
        Override toString method
        Overrides:
        toString in class java.lang.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 java.lang.Object
        Returns:
        Calculated hash as string