edu.northwestern.at.utils.swing.icons
Class Emoticons

java.lang.Object
  extended by edu.northwestern.at.utils.swing.icons.Emoticons

public class Emoticons
extends java.lang.Object

Emoticons.

Emoticons are small icons. The ".gif" files reside in the "resources/emoticons" subdirectory of the package directory.

This static class manages and encapsulates access to the emoticons.


Field Summary
static java.lang.String[][] smileyFaces
           
static java.lang.String smileyFacesEndChars
          End characters in smiley face strings.
 
Method Summary
static javax.swing.ImageIcon get(int index)
          Gets an icon by index.
static javax.swing.ImageIcon get(java.lang.String name)
          Gets an emoticon by name.
static int indexOf(javax.swing.ImageIcon icon)
          Gets the index of an emoticon.
static javax.swing.JPopupMenu popup(java.awt.event.ActionListener listener, boolean shortcuts)
          Creates and returns a popup menu for all the emoticons.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

smileyFaces

public static java.lang.String[][] smileyFaces

smileyFacesEndChars

public static java.lang.String smileyFacesEndChars
End characters in smiley face strings.

Update this to match "smileyFaces" above.

Method Detail

get

public static javax.swing.ImageIcon get(int index)
Gets an icon by index.

Parameters:
index - The index of the icon.
Returns:
The image icon.

get

public static javax.swing.ImageIcon get(java.lang.String name)
Gets an emoticon by name.

Parameters:
name - The emoticon name.
Returns:
The image icon for the emoticon.

popup

public static javax.swing.JPopupMenu popup(java.awt.event.ActionListener listener,
                                           boolean shortcuts)
Creates and returns a popup menu for all the emoticons.

Parameters:
listener - Shared action listener for all the menu items.
shortcuts - True to include keyboard shortcuts in menu item names.
Returns:
The popup menu.

indexOf

public static int indexOf(javax.swing.ImageIcon icon)
Gets the index of an emoticon.

Parameters:
icon - The image icon.
Returns:
The index.