|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.icons.IconSetManager
public class IconSetManager
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)
.
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 |
---|
public IconSetManager()
Method Detail |
---|
public IconSet findIconSet(String iconSetName)
iconSetName
- the icon set name
public String getActiveIconSetName()
getImageIcon(String)
method.
public IconSet getActiveIconSet()
public void add(String name, int[] sizes, String packageName)
public void remove(String name)
public void setActiveIconSetName(String activeIconSetName)
activeIconSetName
- the new active icon set name.
IllegalArgumentException
- if the icon set is not found by that name.public ImageIcon getImageIcon(String iconName)
iconName
- the icon name as defined in IconSet.
public ImageIcon getImageIcon(String iconName, int size)
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.
public ImageIcon getOverlayImageIcon(String iconName, int size, String overlayIconName, int location)
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.
public ImageIcon getOverlayImageIcon(String iconName, int size, String overlayIconName, int location, Insets insets)
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.
public ImageIcon getOverlayImageIcon(String iconName, int size, String overlayIconName, int overlayIconSize, int location, Insets insets)
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.
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |