|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mucommander.ui.icon.IconManager
public class IconManager
IconManager takes care of loading, caching, rescaling the icons contained inside the application's JAR file.
| Field Summary | |
|---|---|
static int |
ACTION_ICON_SET
Designates the action icon set |
static int |
COMMON_ICON_SET
Designates the table icon set |
static int |
FILE_ICON_SET
Designates the file icon set |
static int |
LANGUAGE_ICON_SET
Designates the language icon set |
static int |
PREFERENCES_ICON_SET
Designates the preferences icon set |
static int |
PROGRESS_ICON_SET
Designates the progress icon set |
static int |
STATUS_BAR_ICON_SET
Designates the toolbar icon set |
| Method Summary | |
|---|---|
static javax.swing.ImageIcon |
getCompositeIcon(javax.swing.Icon backgroundIcon,
javax.swing.Icon foregroundIcon)
Returns a 'composite' icon made by composing the two given icons: the backgroundIcon is painted
first, and the foregroundIcon is superposed, letting its non-transparent pixels reveal the
background icon. |
static javax.swing.ImageIcon |
getIcon(int iconSet,
java.lang.String iconName)
Convenience method, calls and returns the result of getIcon(iconSet, iconName, scaleFactor)
with a scale factor of 1.0f (no rescaling). |
static javax.swing.ImageIcon |
getIcon(int iconSet,
java.lang.String iconName,
float scaleFactor)
Returns an icon in the specified icon set and with the given name. |
static javax.swing.ImageIcon |
getIcon(java.lang.String iconPath)
Convenience method, calls and returns the result of getIcon(iconPath, scaleFactor)
with a scale factor of 1.0f (no rescaling). |
static javax.swing.ImageIcon |
getIcon(java.lang.String iconPath,
float scaleFactor)
Creates and returns an ImageIcon instance using the specified icon path and scale factor. |
static java.lang.String |
getIconSetFolder(int iconSet)
Returns the path to the folder that contains the image resource files of the given icon set. |
static javax.swing.ImageIcon |
getImageIcon(javax.swing.Icon icon)
Creates and returns an ImageIcon with the same content and dimensions. |
static javax.swing.ImageIcon |
getPaddedIcon(javax.swing.ImageIcon icon,
java.awt.Insets insets)
Returns an icon made of the specified icon and some transparent space around it. |
static javax.swing.ImageIcon |
getScaledIcon(javax.swing.ImageIcon icon,
float scaleFactor)
Returns a scaled version of the given ImageIcon instance, using the specified scale factor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int FILE_ICON_SET
public static final int ACTION_ICON_SET
public static final int STATUS_BAR_ICON_SET
public static final int COMMON_ICON_SET
public static final int PREFERENCES_ICON_SET
public static final int PROGRESS_ICON_SET
public static final int LANGUAGE_ICON_SET
| Method Detail |
|---|
public static javax.swing.ImageIcon getIcon(java.lang.String iconPath,
float scaleFactor)
iconPath - path of the icon resource inside the application's JAR filescaleFactor - the icon scale factor, 1.0f to have the icon in its original size (no rescaling)public static javax.swing.ImageIcon getIcon(java.lang.String iconPath)
getIcon(iconPath, scaleFactor)
with a scale factor of 1.0f (no rescaling).
public static javax.swing.ImageIcon getScaledIcon(javax.swing.ImageIcon icon,
float scaleFactor)
icon - the icon to scale.scaleFactor - the icon scale factor, 1.0f to have the icon in its original size (no rescaling)
public static javax.swing.ImageIcon getCompositeIcon(javax.swing.Icon backgroundIcon,
javax.swing.Icon foregroundIcon)
backgroundIcon is painted
first, and the foregroundIcon is superposed, letting its non-transparent pixels reveal the
background icon.
For this method to provide a meaningful result, the two icons should have the same dimensions and the
foreground should have some transparent pixels.
backgroundIcon - the icon that is painted firstforegroundIcon - the icon that is superposed above backgroundIcon, should use transparency
public static javax.swing.ImageIcon getIcon(int iconSet,
java.lang.String iconName,
float scaleFactor)
If the icon set has a cache, first looks for an existing instance in the cache, and if it couldn't be found, create an instance and store it in the cache for future access. Note that the cached icon is unscaled, i.e. the scaled icon is not cached.
iconSet - an icon set (see public constants for possible values)iconName - filename of the icon to retrievescaleFactor - the icon scale factor, 1.0f to have the icon in its original size (no rescaling)
null if the image wasn't found or couldn't be loaded
public static javax.swing.ImageIcon getIcon(int iconSet,
java.lang.String iconName)
getIcon(iconSet, iconName, scaleFactor)
with a scale factor of 1.0f (no rescaling).
public static javax.swing.ImageIcon getPaddedIcon(javax.swing.ImageIcon icon,
java.awt.Insets insets)
icon - the original icon, will be painted at the center of the new iconinsets - specifies the dimensions of the transparent space around the returned icon
public static javax.swing.ImageIcon getImageIcon(javax.swing.Icon icon)
If the given Icon is already an ImageIcon, the same instance is returned. If it is not, a new ImageIcon is created and returned.
public static java.lang.String getIconSetFolder(int iconSet)
iconSet - an icon set (see public constants for possible values)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard