|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.PingOO.DLAI.lib.util.Manager
|
+--org.PingOO.DLAI.lib.util.IconManager
Manages the icon for the DLAI.
| Field Summary | |
private static java.util.Hashtable |
BIG_ICON_TABLE
Cache for big icons. |
private static java.lang.String |
DEFAULT_MODULE
Default module. |
private static java.lang.String[] |
ICON_EXTENSION
By default all icons are gif files. |
private static java.util.Hashtable |
SMALL_ICON_TABLE
Cache for small icons. |
| Fields inherited from class org.PingOO.DLAI.lib.util.Manager |
classLoader |
| Constructor Summary | |
private |
IconManager()
Hides the constructor from the outside. |
| Method Summary | |
static void |
clearCache()
Clears the cache used in this manager. |
static javax.swing.Icon |
compoundIcon(javax.swing.Icon bottomIcon,
javax.swing.Icon topIcon)
Creates a new Icon by composing the two icon passed within parameters. |
private static javax.swing.ImageIcon |
findIcon(java.lang.String baseDirectory,
java.lang.String module,
java.lang.String fileName,
java.lang.String extension)
Returns an icon from a file. |
static javax.swing.Icon |
getBigIcon(java.lang.String identifier)
Return a icon with the defautl size of a big icon. |
static javax.swing.Icon |
getBigIcon(java.lang.String module,
java.lang.String identifier)
Return a icon with the defautl size of a big icon. |
private static java.util.Hashtable |
getCache(java.lang.String module,
java.util.Hashtable parentTable)
Return the correct cache. |
static javax.swing.ImageIcon |
getDefaultIcon()
Constructs a (small) default icon. |
static javax.swing.ImageIcon |
getDefaultIcon(java.awt.Dimension dimension)
Constructs a default icon. |
static javax.swing.ImageIcon |
getEmptyIcon()
Constructs a (small) default icon. |
static javax.swing.ImageIcon |
getEmptyIcon(java.awt.Dimension dimension)
Constructs a default icon. |
static javax.swing.Icon |
getIcon(java.lang.String identifier)
Returns an icon from the default set. |
static javax.swing.Icon |
getIcon(java.lang.String module,
java.lang.String identifier)
Returns an icon from a different set. |
static java.awt.Image |
getImage(javax.swing.Icon icon)
Returns the image of the icon. |
static javax.swing.Icon |
getSmallIcon(java.lang.String identifier)
Return a icon with the defautl size of a small icon. |
static javax.swing.Icon |
getSmallIcon(java.lang.String module,
java.lang.String identifier)
Return a icon with the defautl size of a small icon. |
private static void |
initialize()
Initializes caches. |
protected static javax.swing.ImageIcon |
loadIcon(java.lang.String baseDirectory,
java.lang.String module,
java.lang.String fileName)
Tries to find an icon scanning various file extension. |
static javax.swing.Icon |
resizeIcon(javax.swing.Icon icon,
java.awt.Dimension dimension)
Returns an icon that have been resized to the correct dimension. |
static javax.swing.Icon |
toBig(javax.swing.Icon icon)
Returns an icon with the default big icon size. |
static javax.swing.Icon |
toSmall(javax.swing.Icon icon)
Returns an icon with the default small icon size. |
| Methods inherited from class org.PingOO.DLAI.lib.util.Manager |
findFile,
findFile,
findFile,
findFile |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private static final java.lang.String[] ICON_EXTENSION
private static java.util.Hashtable BIG_ICON_TABLE
private static java.util.Hashtable SMALL_ICON_TABLE
private static final java.lang.String DEFAULT_MODULE
| Constructor Detail |
private IconManager()
| Method Detail |
private static final void initialize()
private static final java.util.Hashtable getCache(java.lang.String module,
java.util.Hashtable parentTable)
module - The module to use.parentTable - The parent cache of the desired cache.public static void clearCache()
public static final javax.swing.Icon getSmallIcon(java.lang.String identifier)
identifier - The identifier need to get the icon from its file. You do not need to provide the .gif extension.
public static final javax.swing.Icon getSmallIcon(java.lang.String module,
java.lang.String identifier)
module - The appli's name.identifier - The identifier need to get the icon from its file. You do not need to provide the .gif extension.public static final javax.swing.Icon getBigIcon(java.lang.String identifier)
identifier - The identifier need to get the icon from its file. You do not need to provide the .gif extension.
public static final javax.swing.Icon getBigIcon(java.lang.String module,
java.lang.String identifier)
module - The appli's name.identifier - The identifier need to get the icon from its file. You do not need to provide the .gif extension.public static final javax.swing.Icon getIcon(java.lang.String identifier)
identifier - The identifier need to get the icon from its file. You do not need to provide the .gif extension.
public static final javax.swing.Icon getIcon(java.lang.String module,
java.lang.String identifier)
module - The appli's name.identifier - The identifier need to get the icon from its file. You do not need to provide the .gif extension.
protected static final javax.swing.ImageIcon loadIcon(java.lang.String baseDirectory,
java.lang.String module,
java.lang.String fileName)
baseDirectory - It could be either the big icon directory or the mini icon directory.module - The appli's name.fileName - The name of the icon's file.null if the file was not found.
private static javax.swing.ImageIcon findIcon(java.lang.String baseDirectory,
java.lang.String module,
java.lang.String fileName,
java.lang.String extension)
baseDirectory - it could be either the big icon directory or the mini icon directory.module - The appli's name.fileName - The name of the icon's file.extension - One of the existing extension for this file.null if the file was not found.
public static final javax.swing.Icon resizeIcon(javax.swing.Icon icon,
java.awt.Dimension dimension)
icon - The original icon that needs to be resized.dimension - the new dimension to apply.null if the icon is null.public static final javax.swing.Icon toBig(javax.swing.Icon icon)
icon - the original icon.public static final javax.swing.Icon toSmall(javax.swing.Icon icon)
icon - the original icon.public static final java.awt.Image getImage(javax.swing.Icon icon)
null if the icon has no image.public static final javax.swing.ImageIcon getEmptyIcon()
public static final javax.swing.ImageIcon getEmptyIcon(java.awt.Dimension dimension)
dimension - The dimension of this icon.public static final javax.swing.ImageIcon getDefaultIcon()
public static final javax.swing.ImageIcon getDefaultIcon(java.awt.Dimension dimension)
dimension - The dimension of this icon.
public static javax.swing.Icon compoundIcon(javax.swing.Icon bottomIcon,
javax.swing.Icon topIcon)
ImageManager.bottomIcon - The icon to be placed at the lower plane in the result icon.topIcon - The icon to be placed at the higher plane in the result icon
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||