fable.gui
Class ImageFactory

java.lang.Object
  extended by fable.gui.ImageFactory

public class ImageFactory
extends java.lang.Object

Makes images using Factory Design Pattern so that not too much memory is consumed by images.

Author:
Wonsik Kim

Nested Class Summary
static class ImageFactory.ImageSign
          This enum structure represents all images to be used in the application.
 
Method Summary
static Image getImage(Display display, ImageFactory.ImageSign imageSign)
          Returns image associated with the imageSign object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getImage

public static Image getImage(Display display,
                             ImageFactory.ImageSign imageSign)
Returns image associated with the imageSign object.

Parameters:
display - display associated with the image.
imageSign - ImageSign object associated with the image.
Returns:
image associated with the ImageSign object, or null if creating the image is failed.
Requires:
display != null, imageSign != null.
Effects:
create a new Image object if needed.
Modifies:
this.imageMap, this.registered