com.objexcel.gui
Class IRCColorText

java.lang.Object
  |
  +--com.objexcel.gui.IRCColorText

public final class IRCColorText
extends java.lang.Object

IRCColorText parses IRC color


Field Summary
static java.awt.Color aquamarine
           
static char BOLD
          irc color character marking bold text
static char COLOR
          irc color character marking color text
static java.awt.Color darkolivegreen
           
static java.awt.Color lightcyan
           
static java.awt.Color lightyellow
           
static java.awt.Color lime
           
static java.awt.Color maroon
           
static char PLAIN
          irc color character marking plain text
static java.awt.Color purple
           
static char REVERSE
          irc color character marking reverse text
static java.awt.Color seagreen
           
static char UNDERLINE
          irc color character marking underlined text
 
Method Summary
 void addColorText(javax.swing.text.StyledDocument doc, java.lang.String s, javax.swing.text.Style given)
          append the irc colored text to the document based on the provided Style
 java.awt.Color getColor(int ircColor)
          return a Color for the equivalent IRC color number (a la MIRC).
static IRCColorText getInstance()
          save a few object allocations by getting the singleton
 java.lang.String getTextFromColorText(java.lang.String s)
          remove any coloration from the text and return the plain text.
 void setColorText(javax.swing.text.StyledDocument doc, java.lang.String s, javax.swing.text.Style given)
          pop colored text via the irc text into the styled doc.
 void setStrippedText(javax.swing.text.JTextComponent comp, java.lang.String s)
          remove any coloration from the text and put it into the component.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLAIN

public static final char PLAIN
irc color character marking plain text

BOLD

public static final char BOLD
irc color character marking bold text

COLOR

public static final char COLOR
irc color character marking color text

UNDERLINE

public static final char UNDERLINE
irc color character marking underlined text

REVERSE

public static final char REVERSE
irc color character marking reverse text

maroon

public static final java.awt.Color maroon

purple

public static final java.awt.Color purple

darkolivegreen

public static final java.awt.Color darkolivegreen

lime

public static final java.awt.Color lime

seagreen

public static final java.awt.Color seagreen

aquamarine

public static final java.awt.Color aquamarine

lightcyan

public static final java.awt.Color lightcyan

lightyellow

public static final java.awt.Color lightyellow
Method Detail

getInstance

public static IRCColorText getInstance()
save a few object allocations by getting the singleton

setColorText

public void setColorText(javax.swing.text.StyledDocument doc,
                         java.lang.String s,
                         javax.swing.text.Style given)
pop colored text via the irc text into the styled doc. replaces any current text. uses the supplied style as a default.

setStrippedText

public void setStrippedText(javax.swing.text.JTextComponent comp,
                            java.lang.String s)
remove any coloration from the text and put it into the component.

getTextFromColorText

public java.lang.String getTextFromColorText(java.lang.String s)
remove any coloration from the text and return the plain text.

addColorText

public void addColorText(javax.swing.text.StyledDocument doc,
                         java.lang.String s,
                         javax.swing.text.Style given)
append the irc colored text to the document based on the provided Style

getColor

public java.awt.Color getColor(int ircColor)
return a Color for the equivalent IRC color number (a la MIRC).