JIDE 3.5.15

com.jidesoft.icons
Class IconSetManager

java.lang.Object
  extended by com.jidesoft.icons.IconSetManager

public class IconSetManager
extends Object

IconSetManager contains all the JIDE icon sets in one class so that you can access all of them from one single place and switch to different icon set just by calling setActiveIconSetName(String).

In order to use IconSetManager, you need to define and register the JIDE icon set first. You can do something like this.

 public static IconSetManager ICON_SET_MANAGER = new IconSetManager();
 

static { ICON_SET_MANAGER.add("vista", new int[]{16, 24, 32, 48, 64, 96, 128, 256}, "/com/jidesoft/icons/vista"); ICON_SET_MANAGER.add("xp", new int[]{16, 24, 32, 48, 64}, "/com/jidesoft/icons/xp"); // add more if you have. Right now JIDE only provides one icon set but we will add more }

Later on if you want to use it, for example, to get a File-New icon, you just call
 ICON_SET_MANAGER.getImageIcon(IconSet.File.NEW, size);
 
The size is the size you want such as 16, 24, 32, 48, or 64 depending on what sizes are available.


Constructor Summary
IconSetManager()
           
 
Method Summary
 void add(String name, int[] sizes, String packageName)
           
 IconSet findIconSet(String iconSetName)
          finds the icon set if it is available.
 IconSet getActiveIconSet()
          gets the active icon set.
 String getActiveIconSetName()
          Gets the active icon set name.
 ImageIcon getImageIcon(String iconName)
          Gets the ImageIcon.
 ImageIcon getImageIcon(String iconName, int size)
          Gets the ImageIcon.
 ImageIcon getOverlayImageIcon(String iconName, int size, String overlayIconName, int location)
          Gets the ImageIcon.
 ImageIcon getOverlayImageIcon(String iconName, int size, String overlayIconName, int location, Insets insets)
          Gets the ImageIcon with an overlay icon on it.
 ImageIcon getOverlayImageIcon(String iconName, int size, String overlayIconName, int overlayIconSize, int location, Insets insets)
          Gets the ImageIcon with an overlay icon on it.
 void remove(String name)
           
 void setActiveIconSetName(String activeIconSetName)
          Sets the active icon set name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IconSetManager

public IconSetManager()
Method Detail

findIconSet

public IconSet findIconSet(String iconSetName)
finds the icon set if it is available.

Parameters:
iconSetName - the icon set name
Returns:
the icon set. Null if not found.

getActiveIconSetName

public String getActiveIconSetName()
Gets the active icon set name. The active icon set will be used when you call getImageIcon(String) method.

Returns:
the active icon set name.

getActiveIconSet

public IconSet getActiveIconSet()
gets the active icon set.

Returns:
the active icon set.

add

public void add(String name,
                int[] sizes,
                String packageName)

remove

public void remove(String name)

setActiveIconSetName

public void setActiveIconSetName(String activeIconSetName)
Sets the active icon set name. If the icon set is not found, IllegalArgumentException will be thrown.

Parameters:
activeIconSetName - the new active icon set name.
Throws:
IllegalArgumentException - if the icon set is not found by that name.

getImageIcon

public ImageIcon getImageIcon(String iconName)
Gets the ImageIcon.

Parameters:
iconName - the icon name as defined in IconSet.
Returns:
the ImageIcon.

getImageIcon

public ImageIcon getImageIcon(String iconName,
                              int size)
Gets the ImageIcon.

Parameters:
iconName - the icon name as defined in IconSet.
size - the icon size. If the size is not available, it will find the closest size that is larger than the requested size.
Returns:
the ImageIcon.

getOverlayImageIcon

public ImageIcon getOverlayImageIcon(String iconName,
                                     int size,
                                     String overlayIconName,
                                     int location)
Gets the ImageIcon.

Parameters:
iconName - the icon name as defined in IconSet.
size - the icon size. If the size is not available, it will find the closest size that is larger than the requested size.
overlayIconName - the overlay icon name as defined in IconSet.
location - the location as defined in SwingConstants - CENTER, NORTH, SOUTH, WEST, EAST, NORTH_EAST, NORTH_WEST, SOUTH_WEST and SOUTH_EAST.
Returns:
the ImageIcon.

getOverlayImageIcon

public ImageIcon getOverlayImageIcon(String iconName,
                                     int size,
                                     String overlayIconName,
                                     int location,
                                     Insets insets)
Gets the ImageIcon with an overlay icon on it.

Parameters:
iconName - the icon name as defined in IconSet.
size - the icon size. If the size is not available, it will find the closest size that is larger than the requested size.
overlayIconName - the overlay icon name as defined in IconSet. The icons in the Overlay category are half the size of the regular icons. So this method will take the middle portion of the overlay icon specified in the overlayIconName and use it as the overlay icon.
location - the location as defined in SwingConstants - CENTER, NORTH, SOUTH, WEST, EAST, NORTH_EAST, NORTH_WEST, SOUTH_WEST and SOUTH_EAST.
insets - the margin of the overlay icon to the border of the icon.
Returns:
the ImageIcon.

getOverlayImageIcon

public ImageIcon getOverlayImageIcon(String iconName,
                                     int size,
                                     String overlayIconName,
                                     int overlayIconSize,
                                     int location,
                                     Insets insets)
Gets the ImageIcon with an overlay icon on it.

Parameters:
iconName - the icon name as defined in IconSet.
size - the icon size. If the size is not available, it will find the closest size that is larger than the requested size.
overlayIconName - the overlay icon name as defined in IconSet. The overlay icon doesn't have to be in the overlay category. It can be any regular icon. Of course the size of the overlay icon should be smaller than the size of the regular icon.
overlayIconSize - the size of the overlay icon.
location - the location as defined in SwingConstants - CENTER, NORTH, SOUTH, WEST, EAST, NORTH_EAST, NORTH_WEST, SOUTH_WEST and SOUTH_EAST.
insets - the margin of the overlay icon to the border of the icon.
Returns:
the ImageIcon.

JIDE 3.5.15