|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nakedobjects.object.ImageIcon
A indexed cache for Image objects. Images are retrieved from as resources, from the jar or zip file, or directly off the disk. A default image is kept in memory in case the forementioned methods fail to find a specified image. The default image is unknown.gif and will normally be found in the toolkit file unless it has been specifically built without it (that is the toolkit is supplied with a default image inside the jar file).
| Field Summary | |
static int |
NORMAL
For an image that is normal sized (32 x 32 pixels) this constant should be passed to getImageIcon() the ImageIcon constructors. |
static int |
SMALL
For an image that is small (16 x 16 pixels) this constant should be passed to getImageIcon() the ImageIcon constructors. |
| Constructor Summary | |
ImageIcon(java.awt.Image image,
java.lang.String name,
int size,
java.lang.String status)
Constructor for building an ImageIcon. |
|
| Method Summary | |
static java.lang.String |
getDirectory()
|
java.awt.Image |
getImage()
Returns the java.awt.Image object that this object is holding. |
static ImageIcon |
getImageIcon(java.lang.String name,
int size,
java.lang.String status)
Gets an ImageIcon object with the specified details. |
java.lang.String |
getName()
The name of this image. |
static java.awt.Image |
loadImage(java.lang.String name)
Load a java.awt.Image object using the file name name. |
static java.awt.Image |
loadImage(java.lang.String name,
int size,
java.lang.String status)
Load a java.awt.Image object using the file name name. |
void |
setImage(java.awt.Image image)
Sets Image object that this object is holding. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int NORMAL
public static final int SMALL
| Constructor Detail |
public ImageIcon(java.awt.Image image,
java.lang.String name,
int size,
java.lang.String status)
getImageIcon() but can be
called directly if an Image icon needs to be created in an indirect manner. Ie, the image to be used is already
loaded - eg, after filtering - or the image to be used does not want to use the concatonated name, size and
status as it reference.
| Method Detail |
public static java.lang.String getDirectory()
public java.awt.Image getImage()
public static ImageIcon getImageIcon(java.lang.String name,
int size,
java.lang.String status)
name,
size and status being concatenated with ".gif" to form a file name.
Eg, where name is "customer", size is SMALL and status is "" the image sought will be customer16.gif; if
the name order, size is NORMAL and status is "fulfilled" then the reference would be order32fulfilled.gif.
public java.lang.String getName()
public static java.awt.Image loadImage(java.lang.String name)
name. This method attempts to
load the image from the jar/zip file this class was loaded from ie, your application, and then from
the file system as a file if can't be found as a resource.
If neither method works the default image is returned.
Class.getResource(String)
public static java.awt.Image loadImage(java.lang.String name,
int size,
java.lang.String status)
name. This method attempts to
load the image from the jar/zip file this class was loaded from ie, your application, and then from
the file system as a file if can't be found as a resource.
If neither method works the default image is returned.
Class.getResource(String)public void setImage(java.awt.Image image)
public java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||