Package jexer.bits

Class CellAttributes

  • Direct Known Subclasses:
    Cell

    public class CellAttributes
    extends java.lang.Object
    The attributes used by a Cell: color, bold, blink, etc.
    • Constructor Summary

      Constructors 
      Constructor Description
      CellAttributes()
      Public constructor sets default values of the cell to white-on-black, no bold/blink/reverse/underline/protect.
      CellAttributes​(CellAttributes that)
      Public constructor makes a copy from another instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object rhs)
      Comparison check.
      Color getBackColor()
      Getter for backColor.
      int getBackColorRGB()
      Getter for backColor RGB.
      Color getForeColor()
      Getter for foreColor.
      int getForeColorRGB()
      Getter for foreColor RGB.
      int hashCode()
      Hashcode uses all fields in equals().
      boolean isBlink()
      Getter for blink.
      boolean isBold()
      Getter for bold.
      boolean isProtect()
      Getter for protect.
      boolean isReverse()
      Getter for reverse.
      boolean isRGB()
      See if this cell uses RGB or ANSI colors.
      boolean isUnderline()
      Getter for underline.
      void reset()
      Set to default: white foreground on black background, no bold/underline/blink/rever/protect.
      void setBackColor​(Color backColor)
      Setter for backColor.
      void setBackColorRGB​(int backColorRGB)
      Setter for backColor RGB.
      void setBlink​(boolean blink)
      Setter for blink.
      void setBold​(boolean bold)
      Setter for bold.
      void setForeColor​(Color foreColor)
      Setter for foreColor.
      void setForeColorRGB​(int foreColorRGB)
      Setter for foreColor RGB.
      void setProtect​(boolean protect)
      Setter for protect.
      void setReverse​(boolean reverse)
      Setter for reverse.
      void setTo​(java.lang.Object rhs)
      Set my field values to that's field.
      void setUnderline​(boolean underline)
      Setter for underline.
      java.lang.String toHtml()
      Convert these cell attributes into the style attributes of an HTML <font> tag.
      java.lang.String toString()
      Make human-readable description of this CellAttributes.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CellAttributes

        public CellAttributes()
        Public constructor sets default values of the cell to white-on-black, no bold/blink/reverse/underline/protect.
        See Also:
        reset()
      • CellAttributes

        public CellAttributes​(CellAttributes that)
        Public constructor makes a copy from another instance.
        Parameters:
        that - another CellAttributes instance
        See Also:
        reset()
    • Method Detail

      • isBold

        public final boolean isBold()
        Getter for bold.
        Returns:
        bold value
      • setBold

        public final void setBold​(boolean bold)
        Setter for bold.
        Parameters:
        bold - new bold value
      • isBlink

        public final boolean isBlink()
        Getter for blink.
        Returns:
        blink value
      • setBlink

        public final void setBlink​(boolean blink)
        Setter for blink.
        Parameters:
        blink - new blink value
      • isReverse

        public final boolean isReverse()
        Getter for reverse.
        Returns:
        reverse value
      • setReverse

        public final void setReverse​(boolean reverse)
        Setter for reverse.
        Parameters:
        reverse - new reverse value
      • isUnderline

        public final boolean isUnderline()
        Getter for underline.
        Returns:
        underline value
      • setUnderline

        public final void setUnderline​(boolean underline)
        Setter for underline.
        Parameters:
        underline - new underline value
      • isProtect

        public final boolean isProtect()
        Getter for protect.
        Returns:
        protect value
      • setProtect

        public final void setProtect​(boolean protect)
        Setter for protect.
        Parameters:
        protect - new protect value
      • getForeColor

        public final Color getForeColor()
        Getter for foreColor.
        Returns:
        foreColor value
      • setForeColor

        public final void setForeColor​(Color foreColor)
        Setter for foreColor.
        Parameters:
        foreColor - new foreColor value
      • getBackColor

        public final Color getBackColor()
        Getter for backColor.
        Returns:
        backColor value
      • setBackColor

        public final void setBackColor​(Color backColor)
        Setter for backColor.
        Parameters:
        backColor - new backColor value
      • getForeColorRGB

        public final int getForeColorRGB()
        Getter for foreColor RGB.
        Returns:
        foreColor value. Negative means unset.
      • setForeColorRGB

        public final void setForeColorRGB​(int foreColorRGB)
        Setter for foreColor RGB.
        Parameters:
        foreColorRGB - new foreColor RGB value
      • getBackColorRGB

        public final int getBackColorRGB()
        Getter for backColor RGB.
        Returns:
        backColor value. Negative means unset.
      • setBackColorRGB

        public final void setBackColorRGB​(int backColorRGB)
        Setter for backColor RGB.
        Parameters:
        backColorRGB - new backColor RGB value
      • isRGB

        public final boolean isRGB()
        See if this cell uses RGB or ANSI colors.
        Returns:
        true if this cell has a RGB color
      • reset

        public void reset()
        Set to default: white foreground on black background, no bold/underline/blink/rever/protect.
      • equals

        public boolean equals​(java.lang.Object rhs)
        Comparison check. All fields must match to return true.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        rhs - another CellAttributes instance
        Returns:
        true if all fields are equal
      • hashCode

        public int hashCode()
        Hashcode uses all fields in equals().
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash
      • setTo

        public void setTo​(java.lang.Object rhs)
        Set my field values to that's field.
        Parameters:
        rhs - another CellAttributes instance
      • toString

        public java.lang.String toString()
        Make human-readable description of this CellAttributes.
        Overrides:
        toString in class java.lang.Object
        Returns:
        displayable String
      • toHtml

        public java.lang.String toHtml()
        Convert these cell attributes into the style attributes of an HTML <font> tag.
        Returns:
        the HTML string