view
Class ImageFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by view.ImageFilter

public class ImageFilter
extends FileFilter

A small class that filters files to display image files of types java 1.4 can read/write. Note that we extend the File filter in the swing toolkit.


Nested Class Summary
static class ImageFilter.Formats
          To print all known formats.
 
Field Summary
static List<String> READFORMATS
          The known extensions for reading.
private static List<String> READSUFFIX
          The known extensions for reading.
static List<String> WRITEFORMATS
          The known extensions for writing.
private  boolean writers
          If true, we filter for known image writers.
private static List<String> WRITESUFFIX
          The known extensions for writing.
 
Constructor Summary
ImageFilter()
          Constructs a new image filter for reading
ImageFilter(boolean iswrite)
          Constructs a new image filter.
 
Method Summary
 boolean accept(File f)
          Accepts directories and images with extensions returned by the ImageIO.getWriterFormatNames().
 String getDescription()
          Description.
static String getExtension(File f)
          Helper method to determine the extension of a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

READFORMATS

public static final List<String> READFORMATS
The known extensions for reading.


WRITEFORMATS

public static final List<String> WRITEFORMATS
The known extensions for writing.


READSUFFIX

private static final List<String> READSUFFIX
The known extensions for reading.


WRITESUFFIX

private static final List<String> WRITESUFFIX
The known extensions for writing.


writers

private boolean writers
If true, we filter for known image writers.

Constructor Detail

ImageFilter

public ImageFilter()
Constructs a new image filter for reading


ImageFilter

public ImageFilter(boolean iswrite)
Constructs a new image filter.

Method Detail

accept

public boolean accept(File f)
Accepts directories and images with extensions returned by the ImageIO.getWriterFormatNames().

Specified by:
accept in class FileFilter

getDescription

public String getDescription()
Description.

Specified by:
getDescription in class FileFilter

getExtension

public static String getExtension(File f)
Helper method to determine the extension of a file.