net.java.joglutils.msg.test
Interface Fetcher<IDENT>

All Known Implementing Classes:
BasicFetcher

public interface Fetcher<IDENT>

Defines how elements in the ListModel associated with the ImageBrowser are converted into images that can be rendered on-screen.

The IDENT type is the client's identifier for a particular image which is used in operations like progress callbacks. For example, this might be the index into the ListModel of the image we're talking about.

Author:
Jasper Potts, Kenneth Russell, Richard Bair

Method Summary
 void addProgressListener(ProgressListener listener)
          Adds a progress listener to this Fetcher.
 void cancelDownload(Object imageDescriptor, IDENT clientIdentifier, int requestedImageSize)
          Cancels a previously-registered download request from this Fetcher -- one which resulted in null being returned from getImage().
 BufferedImage getImage(Object imageDescriptor, IDENT clientIdentifier, int requestedImageSize)
          Requests the particular image associated with the given element (of arbitrary type) from the ListModel of the ImageBrowser.
 void removeProgressListener(ProgressListener listener)
          Removes a progress listener from this Fetcher.
 

Method Detail

getImage

BufferedImage getImage(Object imageDescriptor,
                       IDENT clientIdentifier,
                       int requestedImageSize)
Requests the particular image associated with the given element (of arbitrary type) from the ListModel of the ImageBrowser. The requestedImageSize parameter indicates the desired maximum dimension (width or height) of the returned image. Passing a negative number for this parameter results in always fetching the full-size image. Fetchers that perform their work asynchronously will return null if the image is not available immediately. In this case, progress callbacks will be fired promptly to allow the caller to display an indication of download progress.


cancelDownload

void cancelDownload(Object imageDescriptor,
                    IDENT clientIdentifier,
                    int requestedImageSize)
Cancels a previously-registered download request from this Fetcher -- one which resulted in null being returned from getImage().


addProgressListener

void addProgressListener(ProgressListener listener)
Adds a progress listener to this Fetcher.


removeProgressListener

void removeProgressListener(ProgressListener listener)
Removes a progress listener from this Fetcher.