use of org.jivesoftware.sparkimpl.plugin.emoticons.Emoticon in project Spark by igniterealtime.
the class ThemePanel method showSelectedEmoticon.
/**
* Displays the active emoticon pack.
*/
protected void showSelectedEmoticon() {
EmoticonManager emoticonManager = EmoticonManager.getInstance();
int i = emoticonManager.getActiveEmoticonSet().size();
if (i == 0) {
emoticonspanel = new EmoticonPanel(1);
JLabel label = new JLabel(SparkRes.getImageIcon(SparkRes.SMALL_DELETE));
emoticonspanel.add(label);
} else if (i < 25) {
emoticonspanel = new EmoticonPanel(i);
} else {
emoticonspanel = new EmoticonPanel(10);
}
for (Emoticon emoticon : emoticonManager.getActiveEmoticonSet()) {
ImageIcon ico = new ImageIcon(emoticonManager.getEmoticonURL(emoticon));
JLabel label = new JLabel(ico);
emoticonspanel.add(label);
}
int rows = Math.min(((EmoticonPanel) emoticonspanel).getNumRows() * 45, 300);
emoticonscrollpane.setPreferredSize(new Dimension(300, rows));
emoticonscrollpane.setViewportView(emoticonspanel);
this.revalidate();
}
use of org.jivesoftware.sparkimpl.plugin.emoticons.Emoticon in project Spark by igniterealtime.
the class ButtonFactory method createEmoticonButton.
public RolloverButton createEmoticonButton() {
final EmoticonManager emoticonManager = EmoticonManager.getInstance();
final String activeEmoticonSetName = emoticonManager.getActiveEmoticonSetName();
final Emoticon smileEmoticon = emoticonManager.getEmoticon(activeEmoticonSetName, ":)");
Emoticon firstEmoticon = (smileEmoticon == null) ? emoticonManager.getFirstEmotion(activeEmoticonSetName) : smileEmoticon;
URL emotionURL = emoticonManager.getEmoticonURL(firstEmoticon);
ImageIcon icon = new ImageIcon(emotionURL);
return new RolloverButton(icon);
}
Aggregations