Revision 10999 trunk/frameworks/_fwAndami/src/com/iver/andami/iconthemes/IconTheme.java
IconTheme.java | ||
---|---|---|
54 | 54 |
|
55 | 55 |
/** |
56 | 56 |
* <p>This class represents an icon theme, which is basically a mapping of |
57 |
* sybmolic icon names, and real icons (or icon paths). This is useful to
|
|
57 |
* symbolic icon names, and real icons (or icon paths). This is useful to
|
|
58 | 58 |
* change an application's icons in an easy way. An icon theme |
59 |
* is usually read from disk on startup, but can also be created or |
|
59 |
* is usually read from disk on start up, but can also be created or
|
|
60 | 60 |
* modified on a later time.</p> |
61 | 61 |
* |
62 | 62 |
* <p>Developers are encouraged to always use the |
... | ... | |
135 | 135 |
// ok, we got an imagePath, let's see if it's valid |
136 | 136 |
ImageIcon icon = new ImageIcon((URL)object); |
137 | 137 |
if (icon.getImage()!=null) |
138 |
// the icon was succesfully created from the imagePath |
|
138 |
// the icon was successfully created from the imagePath
|
|
139 | 139 |
return icon; |
140 | 140 |
else { |
141 | 141 |
// it seems the imagePath was not valid, register the fallbackImage then |
... | ... | |
305 | 305 |
* @param imageURL |
306 | 306 |
* @param fallbackURL |
307 | 307 |
* |
308 |
* @return If any image was succesfully loaded, return this image, |
|
308 |
* @return If any image was successfully loaded, return this image,
|
|
309 | 309 |
* otherwise return <code>null</code>. |
310 | 310 |
*/ |
311 | 311 |
private ImageIcon tryToGetFromURLs(String iconName, URL imageURL, URL fallbackURL) { |
312 | 312 |
// let's see if imageURL is valid |
313 | 313 |
ImageIcon icon = new ImageIcon(imageURL); |
314 | 314 |
if (icon.getImage()!=null) { |
315 |
// the icon was succesfully created from the imagePath |
|
315 |
// the icon was successfully created from the imagePath
|
|
316 | 316 |
return icon; |
317 | 317 |
} |
318 | 318 |
else { |
... | ... | |
335 | 335 |
* Return the URL which is currently associated with the |
336 | 336 |
* provided icon name, if this icon was registered as an |
337 | 337 |
* URL, or <code>null</code> if it is not present in the theme |
338 |
* or it was registred as an IconImage. |
|
338 |
* or it was registered as an IconImage.
|
|
339 | 339 |
* |
340 | 340 |
* @param iconName |
341 | 341 |
* @return The URL which is currently associated with the |
342 | 342 |
* provided icon name, if this icon was registered as an |
343 | 343 |
* URL, or <code>null</code> if it is not present in the theme |
344 |
* or it was registred as an IconImage. |
|
344 |
* or it was registered as an IconImage.
|
|
345 | 345 |
*/ |
346 | 346 |
public URL getURL(String iconName) { |
347 | 347 |
Object object = iconList.get(iconName); |
Also available in: Unified diff