|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.ImageIcon
buoy.xml.IconResource
public class IconResource
This is a subclass of ImageIcon which loads the image from the classpath by calling
ClassLoader.getResource(). The main value of this class is that, unlike standard
ImageIcons, it can be successfully serialized as XML by WidgetEncoder.
Because the image is specified by a relative path, it will be found when the XML is decoded,
regardless of where the application is stored on the computer.
| Constructor Summary | |
|---|---|
IconResource(java.lang.String resourceName)
Create an IconResource by loading an image file out of the classpath. |
|
IconResource(java.lang.String resourceName,
java.lang.ClassLoader classloader)
Create an IconResource by loading an image file out of the classpath. |
|
IconResource(java.lang.String resourceName,
java.lang.String description)
Create an IconResource by loading an image file out of the classpath. |
|
| Method Summary | |
|---|---|
java.lang.String |
getResourceName()
Get the icon's resource name. |
| Methods inherited from class javax.swing.ImageIcon |
|---|
getAccessibleContext, getDescription, getIconHeight, getIconWidth, getImage, getImageLoadStatus, getImageObserver, paintIcon, setDescription, setImage, setImageObserver, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IconResource(java.lang.String resourceName)
resourceName - the name of the resource to load (by passing it to ClassLoader.getResource())
public IconResource(java.lang.String resourceName,
java.lang.String description)
resourceName - the name of the resource to load (by passing it to Class.getResource())description - a brief description of the image
public IconResource(java.lang.String resourceName,
java.lang.ClassLoader classloader)
resourceName - the name of the resource to load (by passing it to ClassLoader.getResource())classloader - the ClassLoader with which to load the resource| Method Detail |
|---|
public java.lang.String getResourceName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||