JHotDraw 6.0b1

org.jhotdraw.util
Class Iconkit

java.lang.Object
  extended by org.jhotdraw.util.Iconkit

public class Iconkit
extends java.lang.Object

The Iconkit class supports the sharing of images. It maintains a map of image names and their corresponding images. Iconkit also supports to load a collection of images in synchronized way. The resolution of a path name to an image is delegated to the DrawingEditor.


Design Patterns

 o Singleton
The Iconkit is a singleton.



Constructor Summary
Iconkit(java.awt.Component component)
          Constructs an Iconkit that uses the given editor to resolve image path names.
 
Method Summary
 java.awt.Image getImage(java.lang.String fileName)
          Deprecated. use loadImage instead
static Iconkit instance()
          Gets the single instance
 java.awt.Image loadImage(java.lang.String fileName)
          Loads an image with the given fileName and caches it.
 java.awt.Image loadImage(java.lang.String fileName, boolean waitForLoad)
          Loads an image file with the given name, caches it, and optionally waits for it to finish loading.
 java.awt.Image loadImageResource(java.lang.String fileName)
          Deprecated. use loadImageUncached instead
 java.awt.Image loadImageUncached(java.lang.String fileName)
          Just gets the file but doesn't store it in cache.
 java.awt.Image loadImageUncachedURL(java.net.URL url)
          Just gets the image pointed to by the URL and doesn't store it in cache.
 java.awt.Image loadImageURL(java.net.URL url)
          Loads an image URL with the given name and caches it
 java.awt.Image loadImageURL(java.net.URL url, boolean waitForLoad)
          Loads an image URL with the given name, caches it, and optionally waits for it to finish loading.
 void loadRegisteredImages(java.awt.Component component)
          Loads all registered images.
 java.awt.Image registerAndLoadImage(java.awt.Component component, java.lang.String fileName)
          Deprecated. use loadImage instead
 void registerImage(java.lang.String fileName)
          Registers the URL for the image resource
 void registerImageURL(java.net.URL url)
          Registers a URL that is then loaded together with the other registered images by loadRegisteredImages.
 java.awt.Image waitForLoadedImage(java.awt.Image image)
          Blocks while image loads and returns a completely loaded version of image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Iconkit

public Iconkit(java.awt.Component component)
Constructs an Iconkit that uses the given editor to resolve image path names.

Method Detail

instance

public static Iconkit instance()
Gets the single instance


loadImageUncachedURL

public java.awt.Image loadImageUncachedURL(java.net.URL url)
Just gets the image pointed to by the URL and doesn't store it in cache.


loadImageUncached

public java.awt.Image loadImageUncached(java.lang.String fileName)
Just gets the file but doesn't store it in cache.


loadImageURL

public java.awt.Image loadImageURL(java.net.URL url,
                                   boolean waitForLoad)
Loads an image URL with the given name, caches it, and optionally waits for it to finish loading.


loadImage

public java.awt.Image loadImage(java.lang.String fileName,
                                boolean waitForLoad)
Loads an image file with the given name, caches it, and optionally waits for it to finish loading.


loadImageURL

public java.awt.Image loadImageURL(java.net.URL url)
Loads an image URL with the given name and caches it


loadImage

public java.awt.Image loadImage(java.lang.String fileName)
Loads an image with the given fileName and caches it.


waitForLoadedImage

public java.awt.Image waitForLoadedImage(java.awt.Image image)
Blocks while image loads and returns a completely loaded version of image.


registerImageURL

public void registerImageURL(java.net.URL url)
Registers a URL that is then loaded together with the other registered images by loadRegisteredImages.

See Also:
loadRegisteredImages(java.awt.Component)

registerImage

public void registerImage(java.lang.String fileName)
Registers the URL for the image resource

See Also:
registerImageURL(java.net.URL)

loadRegisteredImages

public void loadRegisteredImages(java.awt.Component component)
Loads all registered images. If component is null, the component supplied in the constructor will be used.

See Also:
registerImage(java.lang.String), registerImageURL(java.net.URL)

getImage

public java.awt.Image getImage(java.lang.String fileName)
Deprecated. use loadImage instead

Gets the image with the given fileName. If the image can't be found it tries it again after registering the image and loading all the registered images.


registerAndLoadImage

public java.awt.Image registerAndLoadImage(java.awt.Component component,
                                           java.lang.String fileName)
Deprecated. use loadImage instead

Registers and loads an image. If component is null, the component supplied in the constructor will be used.


loadImageResource

public java.awt.Image loadImageResource(java.lang.String fileName)
Deprecated. use loadImageUncached instead

Loads an image but does not put in in the cache.


JHotDraw 6.0b1