|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.graphstream.ui.swingViewer.util.ImageCache
public class ImageCache
A simple cache for images to avoid reloading them constantly and to allow sharing. TODO have a policy to release images if they have not been used for a given time.
Constructor Summary | |
---|---|
ImageCache()
New empty image cache. |
Method Summary | |
---|---|
static ImageCache |
defaultImageCache()
Default singleton image cache instance that can be shared. |
Image |
getDummyImage()
A dummy 16x16 image. |
Image |
getImage(String fileNameOrUrl)
Lookup an image based on its name, if found return it, else try to load it. |
Image |
getImage(String fileNameOrUrl,
boolean forceTryReload)
The same as getImage(String) but you can force the cache to try
to reload an image that where not found before. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImageCache()
Method Detail |
---|
public static ImageCache defaultImageCache()
public Image getImage(String fileNameOrUrl)
fileNameOrUrl
- A file name or an URL pointing at the image.
public Image getImage(String fileNameOrUrl, boolean forceTryReload)
getImage(String)
but you can force the cache to try
to reload an image that where not found before.
fileNameOrUrl
- A file name or an URL pointing at the image.forceTryReload
- If true, try to reload an image that where not found before.
public Image getDummyImage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |