com.valhalla.jbother
Class ConversationFormatter

java.lang.Object
  extended by com.valhalla.jbother.ConversationFormatter

public class ConversationFormatter
extends java.lang.Object

Replaces different emote symbols with images

Version:
1.0
Author:
Adam Olsen

Field Summary
protected  java.util.ResourceBundle resources
           
 
Method Summary
 java.lang.String checkHyperlink(java.lang.String text, javax.swing.text.StyledDocument doc, javax.swing.text.SimpleAttributeSet sas)
           
 void displayEmoticonChooser(javax.swing.JFrame window, java.awt.Component component, javax.swing.text.JTextComponent area)
          Shows a small window displaying all available emoticons.
static ConversationFormatter getInstance()
           
 void replaceIcons(java.lang.String text, javax.swing.text.StyledDocument doc, javax.swing.text.SimpleAttributeSet sas, javax.swing.JTextPane pane, boolean emotes)
          Replaces the different symbols with the images defined in the emote data file
 void switchTheme(java.lang.String theme)
          Switches the emoticon theme
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resources

protected java.util.ResourceBundle resources
Method Detail

getInstance

public static ConversationFormatter getInstance()
Returns:
the ConversationFormatter singleton

switchTheme

public void switchTheme(java.lang.String theme)
Switches the emoticon theme

Parameters:
theme - the theme to switch to

replaceIcons

public void replaceIcons(java.lang.String text,
                         javax.swing.text.StyledDocument doc,
                         javax.swing.text.SimpleAttributeSet sas,
                         javax.swing.JTextPane pane,
                         boolean emotes)
Replaces the different symbols with the images defined in the emote data file

Parameters:
text - the text to modify

checkHyperlink

public java.lang.String checkHyperlink(java.lang.String text,
                                       javax.swing.text.StyledDocument doc,
                                       javax.swing.text.SimpleAttributeSet sas)

displayEmoticonChooser

public void displayEmoticonChooser(javax.swing.JFrame window,
                                   java.awt.Component component,
                                   javax.swing.text.JTextComponent area)
Shows a small window displaying all available emoticons.

Parameters:
window - the parent window
component - the Component to display this frame over
area - the text area that the emoticons will be placed on when the user clicks an image