|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.gjt.btools.image.StandardImage
Represents a standard image that may be requested multiple times. The same ImageIcon will be returned for every request; thus only one copy is ever loaded at a time.
The internal ImageIcon will not be created until it is first requested through image(). Each following request will return the same ImageIcon, thus saving time and memory. Calling finalImage() or discardImage() will cause the internal ImageIcon to be discarded; this will save memory but a subsequent call to getImage() will require a new ImageIcon to be created.
Constructor Summary | |
StandardImage(java.lang.String location)
Creates a new standard image representing the image at the specified location. |
|
StandardImage(java.lang.String location,
java.lang.Class loaderClass)
Creates a new standard image representing the image at the specified location. |
Method Summary | |
void |
discardImage()
Discards the internally stored ImageIcon representing this image. |
javax.swing.ImageIcon |
finalImage()
Returns and discards the ImageIcon containing this image. |
javax.swing.ImageIcon |
image()
Returns the ImageIcon containing this image. |
static javax.swing.ImageIcon |
makeImageIcon(java.lang.String location)
Creates a new image icon representing the image resource at the given location. |
static javax.swing.ImageIcon |
makeImageIcon(java.lang.String location,
java.lang.Class loaderClass)
Creates a new image icon representing the image resource at the given location. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StandardImage(java.lang.String location)
location
- the location of the image this object will
represent.public StandardImage(java.lang.String location, java.lang.Class loaderClass)
location
- the location of the image this object will
represent.loaderClass
- the class whose class loader will be used to locate
the image resource.Method Detail |
public javax.swing.ImageIcon image()
public javax.swing.ImageIcon finalImage()
public void discardImage()
public static javax.swing.ImageIcon makeImageIcon(java.lang.String location)
location
- the location of the image resource.
public static javax.swing.ImageIcon makeImageIcon(java.lang.String location, java.lang.Class loaderClass)
location
- the location of the image resource.loaderClass
- the class whose class loader will be used to locate
the image resource.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |