com.artima.place.attribute
Class Icons.Cache

java.lang.Object
  |
  +--com.artima.place.attribute.Icons.Cache
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Enclosing class:
Icons

public static class Icons.Cache
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Contains cached icons and their Locale, the cache for a Icons object.

See Also:
Serialized Form

Constructor Summary
Icons.Cache(byte[] cachedColor16Icon, byte[] cachedColor32Icon, byte[] cachedMono16Icon, byte[] cachedMono32Icon, java.util.Locale cachedLocale)
          Constructs a new Icons.Cache with passed cached icons and their Locale.
 
Method Summary
 byte[] getIcon(int iconKind)
          Returns an icon contained in this Icons.Cache.
 java.util.Locale getLocale()
          Returns the Locale contained in this Icons.Cache, which represents the Locale of the icons returned by the getIcon method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Icons.Cache

public Icons.Cache(byte[] cachedColor16Icon,
                   byte[] cachedColor32Icon,
                   byte[] cachedMono16Icon,
                   byte[] cachedMono32Icon,
                   java.util.Locale cachedLocale)
Constructs a new Icons.Cache with passed cached icons and their Locale. The cached icons are cloned by this constructor, so that the original byte arrays passed to this constructor, which are mutable, are not referenced from this object.
Parameters:
cachedIcons - the String cached icons
cachedLocale - the Locale of the cached icons
Throws:
NullPointerException - if any of the passed cached icons or cachedLocale references are null
Method Detail

getIcon

public byte[] getIcon(int iconKind)
Returns an icon contained in this Icons.Cache. This method will never return null. The icon is returned as an array of bytes containing the icon image. (The image file is likely either a GIF or JPG file, but could be any image file format.) The valid parameter values are the same as for the getIcon method of java.beans.BeanInfo, which for convenience are also declared in class Icons: Icons.ICON_COLOR_16x16, Icons.ICON_COLOR_32x32, Icons.ICON_MONO_16x16, Icons.ICON_MONO_32x32.
Parameters:
iconKind - the kind of icon to be returned (one of Icons.ICON_COLOR_16x16, Icons.ICON_COLOR_32x32, Icons.ICON_MONO_16x16, or Icons.ICON_MONO_32x32).
Returns:
the bytes of an icon image file for this resource

getLocale

public java.util.Locale getLocale()
Returns the Locale contained in this Icons.Cache, which represents the Locale of the icons returned by the getIcon method. This method will never return null.
Returns:
a Locale for the icons returned by the getIcon method