trex.GUI.ImageChooser
Class ImageFilter

java.lang.Object
  |
  +--javax.swing.filechooser.FileFilter
        |
        +--trex.GUI.ImageChooser.ImageFilter

public class ImageFilter
extends FileFilter

The ImageFilter checks whether a file is to be displayed in the file chooser. This info is derived from file's extension.

This class was mostly stolen from Sun's documentation: FileChooser Demo (whoops... does this hurt GPL?!)

Version:
$Revision: 1.7 $
Author:
Bastian Friedrich <bastian@bastian-friedrich.de>

Constructor Summary
ImageFilter()
           
 
Method Summary
 boolean accept(File f)
          Accept all directories and all gif, jpg, or png files.
 String getDescription()
          The description of this filter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageFilter

public ImageFilter()
Method Detail

accept

public boolean accept(File f)
Accept all directories and all gif, jpg, or png files.

Specified by:
accept in class FileFilter
Returns:
File's acceptance.

getDescription

public String getDescription()
The description of this filter

Specified by:
getDescription in class FileFilter
Returns:
The literal string "Images (png, gif, jpg)".