while(e.hasMoreElements())
{
MessageComponent comp = (MessageComponent) e.nextElement();
if(comp instanceof TextComponent)
{
TextComponent txt = (TextComponent) comp;
Color color = txt.getColor();
if(color != null)
{
ret.append("\033[#");
ret.append(Integer.toHexString(color.getRed()));
ret.append(Integer.toHexString(color.getGreen()));
ret.append(Integer.toHexString(color.getBlue()));
ret.append('m');
}
Font font = txt.getFont();
if(font != null)
{
ret.append("<font face=\"" + font.getFontName() + "\" ");
ret.append("size=\"" + font.getSize() + "\">");
}
ret.append(txt.getSequence());
}
else if(comp instanceof SmileyComponent)
{
SmileyComponent smiley = (SmileyComponent) comp;
ret.append(smiley.getText());