com.huguesjohnson.fileFilter
Class ImageFileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by com.huguesjohnson.fileFilter.ImageFileFilter

public class ImageFileFilter
extends javax.swing.filechooser.FileFilter

ImageFileFilter filter to only accept images supported by ImageIO uses ImageReaderWriterSpi.getFileSuffixes() to get a list of supported extensions

Author:
Hugues Johnson

Constructor Summary
ImageFileFilter()
          Creates a new instance of ImageFileFilter
 
Method Summary
 boolean accept(java.io.File file)
          Tests if a file has an extension of a known type.
 java.lang.String getDescription()
          getDescription returns the description of files accepted by the filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageFileFilter

public ImageFileFilter()
Creates a new instance of ImageFileFilter

Method Detail

accept

public final boolean accept(java.io.File file)
Tests if a file has an extension of a known type.

Specified by:
accept in class javax.swing.filechooser.FileFilter
Parameters:
file - The file to check.
Returns:
True if the extension of a file matches a known type.

getDescription

public java.lang.String getDescription()
getDescription returns the description of files accepted by the filter.

Specified by:
getDescription in class javax.swing.filechooser.FileFilter
Returns:
description of files accepted by the current filter