org.cybertory.MSS
Class RImageFileLibrary

java.lang.Object
  extended byorg.cybertory.MSS.RImageFileLibrary
All Implemented Interfaces:
RImageLibrary

public class RImageFileLibrary
extends java.lang.Object
implements RImageLibrary

A library of image files, either in a directory or as specified in a hash containing a map to the image file locations.


Constructor Summary
RImageFileLibrary(java.io.File directory)
          Initialize a library of all the files in the given directory.
RImageFileLibrary(java.io.File directory, java.lang.String patternStr)
          Initialize a library of the files matching the given pattern string in the given directory.
RImageFileLibrary(java.io.File directory, java.lang.String[] extensions)
          Initialize a library of the files having one of the given list of extensions in the given directory.
RImageFileLibrary(java.util.HashMap fileMap)
           
 
Method Summary
 java.awt.image.RenderedImage getImage(java.lang.String key)
          Retrieve an image from the library.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RImageFileLibrary

public RImageFileLibrary(java.util.HashMap fileMap)

RImageFileLibrary

public RImageFileLibrary(java.io.File directory)
Initialize a library of all the files in the given directory. The keys are the unqualified file names.

Parameters:
directory - the directory containing image files for the library

RImageFileLibrary

public RImageFileLibrary(java.io.File directory,
                         java.lang.String patternStr)
Initialize a library of the files matching the given pattern string in the given directory. The keys are the unqualified file names.

Parameters:
directory - the directory containing image files for the library
patternStr - the filename pattern that library members must match

RImageFileLibrary

public RImageFileLibrary(java.io.File directory,
                         java.lang.String[] extensions)
Initialize a library of the files having one of the given list of extensions in the given directory. The keys are the unqualified file names.

Parameters:
directory - the directory containing image files for the library
extensions - the filename extensions files must match
Method Detail

getImage

public java.awt.image.RenderedImage getImage(java.lang.String key)
Retrieve an image from the library.

Specified by:
getImage in interface RImageLibrary
Parameters:
key - the identifying key of the image file
Returns:
the RenderedImage object for the given key.