com.alee.utils.file
Interface FileThumbnailProvider

All Superinterfaces:
java.io.FileFilter, Filter<java.io.File>
All Known Implementing Classes:
AbstractThumbnailProvider

public interface FileThumbnailProvider
extends Filter<java.io.File>, java.io.FileFilter

Base interface for custom thumbnail providers.

Author:
Mikle Garin

Method Summary
 boolean accept(java.io.File file)
          Returns whether or not this provider can generate thumbnail for the specified file.
 javax.swing.ImageIcon provide(java.io.File file, java.awt.Dimension size, boolean preview)
          Returns custom file thumbnail icon.
 

Method Detail

accept

boolean accept(java.io.File file)
Returns whether or not this provider can generate thumbnail for the specified file.

Specified by:
accept in interface java.io.FileFilter
Specified by:
accept in interface Filter<java.io.File>
Parameters:
file - file to provide thumbnail for
Returns:
true if this provider can generate thumbnail for the specified file, false otherwise

provide

javax.swing.ImageIcon provide(java.io.File file,
                              java.awt.Dimension size,
                              boolean preview)
Returns custom file thumbnail icon. Preferred size represents area available for the icon, though you are free to provide an icon with different size. It will then be automatically rescaled down if too large or kept in the middle of the available area if it is too small.

Parameters:
file - file to provide thumbnail for
size - preferred thumbnail size
preview - whether thumbnail should be a small preview of file content or not
Returns:
custom file thumbnail