com.ngs.image
Class ImageSource

java.lang.Object
  extended by com.ngs.image.ImageSource
Direct Known Subclasses:
DefaultThumbnailSource

public abstract class ImageSource
extends Object

Defines the interface by which ImageModel obtains Images.

ImageSources may contain multiple images, retrievable by indexing from zero to the value of getImageCount(). Multi-page TIFF images, animated GIFs, etc. may be examples of ImageSources that would contain more than one image. There is also a method for getting a smaller image to display as a thumbnail. This feature is currently unused, but it's there.

Author:
Bryan Varner

Constructor Summary
ImageSource()
           
 
Method Summary
abstract  void dispose()
          Release any cached resources.
abstract  BufferedImage getImage(int index)
          Retrieve the image at the given index.
abstract  int getImageCount()
          Gets the number of Images in this ImageSource.
abstract  String getImageName()
          Gets the name of this Image
abstract  Image getThumbnail(int index)
          Retrieve a thumbnail of the image at the given index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageSource

public ImageSource()
Method Detail

getImage

public abstract BufferedImage getImage(int index)
Retrieve the image at the given index.

If there is no image at the specified index, implementations should return null.

Parameters:
index - The image to obtain from this ImageSource.
Returns:
a BufferedImage.

getThumbnail

public abstract Image getThumbnail(int index)
Retrieve a thumbnail of the image at the given index.

If there is no image at the specified index, or if we do not support thumbnails, implementations should return null

Parameters:
index - The image to obtain a thumbnail for from this ImageSource.
Returns:
a BufferedImage.

getImageCount

public abstract int getImageCount()
Gets the number of Images in this ImageSource.

Returns:
THe number of images in this ImageSource. Normally this will be 1.

getImageName

public abstract String getImageName()
Gets the name of this Image


dispose

public abstract void dispose()
Release any cached resources. This method signals that the ImageSource will not be used again.