ewe.fx
Class ImageCache

java.lang.Object
  extended byewe.data.DataObject
      extended byewe.util.Vector
          extended byewe.data.PropertyList
              extended byewe.fx.ImageCache
All Implemented Interfaces:
Comparable, Copyable, DataUnit, HasProperties, Textable

public class ImageCache
extends PropertyList

An ImageCache is used to fetch and keep images so that Images do not have to be re-decoded each time they are accessed.


Nested Class Summary
 
Nested classes inherited from class ewe.data.PropertyList
PropertyList.NullPropertyList
 
Field Summary
static ImageCache cache
          This is a global ImageCache that you can use.
 
Fields inherited from class ewe.data.PropertyList
nullPropertyList
 
Constructor Summary
ImageCache()
           
 
Method Summary
 void free()
          Free all images and clear the cache.
 IImage get(String imageName, Object maskOrColor)
          Get an Image with an optional mask image or transparent color.
 IImage getImage(String imageName)
          Get an Image.
 
Methods inherited from class ewe.data.PropertyList
_getSetField, add, add, add, add, defaultTo, defaultTo, fromHashtable, fromStrings, get, get, getBoolean, getBoolean, getDouble, getDouble, getField, getInt, getInt, getNames, getProperties, getProperties, getProperties, getPropertyValues, getSetProperties, getString, getString, getStrings, getText, getValue, getValue, getValue, getValue, make, readConfigFile, remove, set, set, set, setBoolean, setField, setInt, setStrings, setText, toHashtable, toPropertyList
 
Methods inherited from class ewe.util.Vector
add, add, add, addAll, addAll, addAll, addCopiesFrom, addElement, clear, compare, contains, copyCopiesFrom, copyFrom, copyInto, copyInto, del, elementAt, elements, find, find, get, getCount, getFullCopy, insert, insertElementAt, isEmpty, iterator, iterator, pop, push, remove, removeAllElements, removeElementAt, set, setElementAt, setSize, size, sort, sort, toArray, toArray, toObjectArray, toString, zero
 
Methods inherited from class ewe.data.DataObject
appendAllFields, compareTo, copied, equals, getCopy, getDeclaredField, getDeclaredFieldValue, getDeclaredFieldValue, getFieldList, getFieldList, getMyFieldList, getNew
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode
 

Field Detail

cache

public static ImageCache cache
This is a global ImageCache that you can use. The system also uses it.

Constructor Detail

ImageCache

public ImageCache()
Method Detail

get

public IImage get(String imageName,
                  Object maskOrColor)
           throws IllegalArgumentException
Get an Image with an optional mask image or transparent color.

Parameters:
imageName - The full resource name of the image.
maskOrColor - Either a resource name of a mask image or a Color object.
Returns:
The decoded Image - either newly decoded or retrieved from the Cache.
Throws:
IllegalArgumentException - If the named image does not exist or is not formatted correctly.

getImage

public IImage getImage(String imageName)
                throws IllegalArgumentException
Get an Image.

Parameters:
imageName - The full resource name of the image.
Returns:
The decoded Image - either newly decoded or retrieved from the Cache.
Throws:
IllegalArgumentException - If the named image does not exist or is not formatted correctly.

free

public void free()
Free all images and clear the cache.