Class CFFormatter


  • public final class CFFormatter
    extends java.lang.Object
    Formatter for the CFBin.

    This class is intentionally immutable. Create always new instance if you want to modify its properties.

    Author:
    Petr Hamernik
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static CFFormatter DEFAULT
      Default formatting - means no change to font, background and foreground colors.
    • Field Detail

      • DEFAULT

        public static final CFFormatter DEFAULT
        Default formatting - means no change to font, background and foreground colors.
    • Method Detail

      • create

        public static CFFormatter create​(java.awt.Color foreground,
                                         java.awt.Color background,
                                         java.awt.Font font)
        Create a new formatter.
        Parameters:
        foreground - foreground (text) color. Can be null.
        background - background color. Can be null
        font - font of the text. Can be null.
        Returns:
        newly created formatter
      • getForeground

        public java.awt.Color getForeground()
        Foreground color.
        Returns:
        foreground color or null (which means that default foreground is used)
      • getBackground

        public java.awt.Color getBackground()
        Background color.
        Returns:
        background color or null (which means that default background is used)
      • getFont

        public java.awt.Font getFont()
        Text font.
        Returns:
        text font or null (which means that default font is used)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object