|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdsto.dfc.swt.icons.IconCache
public class IconCache
A system-wide cache of rendered SWT images for Icon instances. This class is not thread-safe: it is assumed that all accesses come from the SWT GUI thread. Icons used in the cache must implement equals () and hashCode ().
| Field Summary | |
|---|---|
protected HashMap |
cache
|
| Constructor Summary | |
|---|---|
IconCache()
|
|
| Method Summary | |
|---|---|
void |
clear()
Clear and dispose of all icons in the cache. |
org.eclipse.swt.graphics.Image |
get(Icon icon)
Retrieve the image for a cached icon. |
static IconCache |
getDefault()
Get the default instance. |
org.eclipse.swt.graphics.Image |
getOrPut(Icon icon)
Like get (), but put ()'s the icon if not in the cache. |
org.eclipse.swt.graphics.Image |
put(Icon icon)
Put icon into the cache. |
void |
remove(Icon icon)
Reverse of put (): decrements an icon's reference count in the cache. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected HashMap cache
| Constructor Detail |
|---|
public IconCache()
| Method Detail |
|---|
public static IconCache getDefault()
public void clear()
public org.eclipse.swt.graphics.Image put(Icon icon)
Icon.createImage(org.eclipse.swt.graphics.Device) and
placed in the cache. If the icon is already there, its reference
count is incremented.
icon - The icon to cache.
get(Icon),
remove(Icon)public org.eclipse.swt.graphics.Image get(Icon icon)
icon - The icon to query.
put(Icon),
getOrPut(Icon)public org.eclipse.swt.graphics.Image getOrPut(Icon icon)
get(Icon),
put(Icon)public void remove(Icon icon)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||