|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.gsfc.drl.rtstps.viewer.bulbs.Bulb
class Bulb
This class represents a bulb icon and a label that could be displayed in a bulb gadget. It loads bulb images.
I have cached the image icons in a static map so that I don't waste time and resources loading them multiple times. I defer creating an ImageIcon until someone actually demands it.
Bulb colors are passes as lowercase text string ("red","green", etc).
This class then loads the image file, which it expects to find in the
images directory. The file name must have the form:
colorTextString + "Bulb.gif"
This class is an AbstractBulbGadget utility. It exists primarily to provide a value object in a map.
Field Summary | |
---|---|
private javax.swing.ImageIcon |
icon
The image icon for this bulb color. |
private static java.util.Map<java.lang.String,javax.swing.ImageIcon> |
imageMap
This is a static map of bulb images, (String,ImageIcon). |
private java.lang.String |
label
The label that accompanies the icon. |
Constructor Summary | |
---|---|
Bulb(java.lang.String color,
java.lang.String label)
Create a bulb. |
Method Summary | |
---|---|
private boolean |
createImageIcon(java.lang.String color)
|
(package private) javax.swing.ImageIcon |
getIcon()
Get the icon. |
(package private) java.lang.String |
getLabel()
Get the label. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.util.Map<java.lang.String,javax.swing.ImageIcon> imageMap
private javax.swing.ImageIcon icon
private java.lang.String label
Constructor Detail |
---|
Bulb(java.lang.String color, java.lang.String label)
color
- A color such as "red", "yellow", "green", and "gray"label
- A label that is printed next to the bulbMethod Detail |
---|
final javax.swing.ImageIcon getIcon()
final java.lang.String getLabel()
private boolean createImageIcon(java.lang.String color)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |