com.ngs.image.source
Class DefaultThumbnailSource

java.lang.Object
  extended by com.ngs.image.ImageSource
      extended by com.ngs.image.source.DefaultThumbnailSource
Direct Known Subclasses:
CompositeSource, ImageIOSource, JAIImageSource, PagelessSource

public abstract class DefaultThumbnailSource
extends ImageSource

Implements a default method of behavior for ImageSources to generate Thumbnails. By default, the thumbnail size is 100 x 200. This can be changed by the alternate constructor.

Author:
Bryan.Varner

Constructor Summary
protected DefaultThumbnailSource()
          Constructs a DefaultThumbnailSource that generates Thumbnails 100x200 pixels.
protected DefaultThumbnailSource(int thumbWidth, int thumbHeight)
          Constructs a DefaultThumbnailSource that generates Thumbnails with the specified dimensions
 
Method Summary
abstract  void dispose()
          Implements ImageSource
abstract  BufferedImage getImage(int index)
          Implements ImageSource
abstract  int getImageCount()
          Implements ImageSource
abstract  String getImageName()
          Implements ImageSource
 Image getThumbnail(int index)
          Returns a fast-scaled instance of getImage(index) the size of thumbWidth x thumbHeight.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultThumbnailSource

protected DefaultThumbnailSource()
Constructs a DefaultThumbnailSource that generates Thumbnails 100x200 pixels.


DefaultThumbnailSource

protected DefaultThumbnailSource(int thumbWidth,
                                 int thumbHeight)
Constructs a DefaultThumbnailSource that generates Thumbnails with the specified dimensions

Parameters:
thumbWidth - the width of generated thumbnails
thumbHeight - the height of generated thumbnails
Method Detail

getImage

public abstract BufferedImage getImage(int index)
Implements ImageSource

Specified by:
getImage in class ImageSource
Parameters:
index - The image to obtain from this ImageSource.
Returns:
a BufferedImage.

getThumbnail

public Image getThumbnail(int index)
Returns a fast-scaled instance of getImage(index) the size of thumbWidth x thumbHeight.

Specified by:
getThumbnail in class ImageSource
Parameters:
index - The index of the image to retrieve.
Returns:
a BufferedImage.

getImageCount

public abstract int getImageCount()
Implements ImageSource

Specified by:
getImageCount in class ImageSource
Returns:
THe number of images in this ImageSource. Normally this will be 1.

dispose

public abstract void dispose()
Implements ImageSource

Specified by:
dispose in class ImageSource

getImageName

public abstract String getImageName()
Implements ImageSource

Specified by:
getImageName in class ImageSource