public class IconHandler
extends java.lang.Object
| Constructor and Description |
|---|
IconHandler()
Create an icon handler
|
IconHandler(java.util.PropertyResourceBundle resources)
Create an icon handler with a property file
which holds the mapping of icon names to resources.
|
| Modifier and Type | Method and Description |
|---|---|
java.awt.Cursor |
buildCursorByName(java.lang.String name,
java.awt.Point hotspot,
int scale)
Builds a cursor from the named gif image
|
static IconHandler |
getDefaultIconHandler()
Gets the default icon handler
|
javax.swing.Icon |
getGrayIcon(javax.swing.Icon icon)
Gets a gray version of an icon.
|
javax.swing.Icon |
loadIconById(java.lang.String id)
This method loads an icon using an identifier.
|
javax.swing.Icon |
loadIconByName(java.lang.String name)
This method loads an icon from a named resource.
|
void |
setDebug(boolean debug)
Sets the debug flag
|
static void |
setDefaultIconHandler(IconHandler defaultIconHandler)
Sets the default icon handler
|
void |
setImageFolder(java.lang.String imageFolder) |
void |
setResources(java.util.PropertyResourceBundle resources)
Sets the resource bundle
|
public IconHandler()
public IconHandler(java.util.PropertyResourceBundle resources)
resources - Resource bundlepublic javax.swing.Icon loadIconById(java.lang.String id)
throws java.io.IOException
id - The icon indentifierjava.io.IOException - Thrown by the resource loading codepublic javax.swing.Icon loadIconByName(java.lang.String name)
throws java.io.IOException
name - The resource namejava.io.IOException - Thrown by the resource loading codepublic javax.swing.Icon getGrayIcon(javax.swing.Icon icon)
icon - The icon to gray outpublic java.awt.Cursor buildCursorByName(java.lang.String name,
java.awt.Point hotspot,
int scale)
throws java.io.IOException
name - The resource name for the imagehotspot - The cursor hotspotjava.io.IOException - thrown by the loadImageByName callpublic static void setDefaultIconHandler(IconHandler defaultIconHandler)
iconHandler - The new default icon handlerpublic static IconHandler getDefaultIconHandler()
public void setResources(java.util.PropertyResourceBundle resources)
resource - The resource bundlepublic void setDebug(boolean debug)
resource - The resource bundlepublic void setImageFolder(java.lang.String imageFolder)