public class IRCUtil extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
IRCUtil.IRCAttribute |
static class |
IRCUtil.IRCAttributeSet |
Modifier and Type | Field and Description |
---|---|
static char |
CHAR_BOLD |
static char |
CHAR_COLOR |
static char |
CHAR_ITALIC |
static char |
CHAR_RESET |
static char |
CHAR_UNDERLINE |
Constructor and Description |
---|
IRCUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
applyAttribute(IRCUtil.IRCAttributeSet set,
IRCUtil.IRCAttribute attr)
Apply the specified IRC attribute on specified IRC attributes set.
|
static javax.swing.text.SimpleAttributeSet |
createAttributeSet(javax.swing.text.SimpleAttributeSet defaultAttributes,
IRCUtil.IRCAttributeSet ircAttributes)
Return a new AttributeSet from the given default set and IRC attributes.
|
static IRCUtil.IRCAttribute |
getAttribute(java.lang.String ircString,
int index)
Return the IRC attribute corresponding to the control code at specified index.
|
static java.lang.String |
getBoldString(java.lang.String value)
Returns IRC bold version of specified string.
|
static java.awt.Color |
getIRCColor(int num)
Return the color corresponding to the specified IRC color code.
|
static java.lang.String |
getItalicString(java.lang.String value)
Returns IRC italic version of specified string.
|
static java.lang.String |
getUnderlineString(java.lang.String value)
Returns IRC underline version of specified string.
|
static void |
insertString(java.lang.String ircString,
javax.swing.text.Document doc,
javax.swing.text.SimpleAttributeSet defaultAttributes)
Insert the specified IRC string into specified Document.
|
public static final char CHAR_BOLD
public static final char CHAR_ITALIC
public static final char CHAR_UNDERLINE
public static final char CHAR_COLOR
public static final char CHAR_RESET
public IRCUtil()
public static void insertString(java.lang.String ircString, javax.swing.text.Document doc, javax.swing.text.SimpleAttributeSet defaultAttributes) throws javax.swing.text.BadLocationException
ircString
- IRC string containing IRC code.doc
- doc when we want to insert the IRC styled string.defaultAttributes
- default string attributes.javax.swing.text.BadLocationException
public static IRCUtil.IRCAttribute getAttribute(java.lang.String ircString, int index)
public static void applyAttribute(IRCUtil.IRCAttributeSet set, IRCUtil.IRCAttribute attr)
set
- IRC attributes set.attr
- IRC single attribute.public static javax.swing.text.SimpleAttributeSet createAttributeSet(javax.swing.text.SimpleAttributeSet defaultAttributes, IRCUtil.IRCAttributeSet ircAttributes)
defaultAttributes
- default Attribute Set we use as base attributes.ircAttributes
- IRC attributes used to modifying default attributes.public static java.awt.Color getIRCColor(int num)
public static java.lang.String getBoldString(java.lang.String value)
public static java.lang.String getItalicString(java.lang.String value)
public static java.lang.String getUnderlineString(java.lang.String value)