JAI ImageIO plugins for ImageJ - API

net.sf.ij.jaiio
Class JAIFileFilter

java.lang.Object
  extended byjavax.swing.filechooser.FileFilter
      extended bynet.sf.ij.jaiio.JAIFileFilter

public class JAIFileFilter
extends javax.swing.filechooser.FileFilter

File filter that detects image files supported by registered JAI codecs. File types are determined be magic number in the header rather then file extension.

Version:
$Revision: 1.4 $
Author:
Jarek Sacha

Field Summary
static int MIN_IMAGE_FILE_SIZE
          Files smaller then min size are ignored by the filter.
 
Constructor Summary
JAIFileFilter()
          Create file filter accepting all images supported by registered JAI codecs.
JAIFileFilter(java.lang.String codecName)
          Create file filter accepting images supported by given codec.
 
Method Summary
 boolean accept(java.io.File file)
          Whether the given file is accepted by this filter.
 java.lang.String getCodecName()
          Gets the CodecName attribute of the JAIFileFilter object.
 java.lang.String getDescription()
          Gets the Description attribute of the ExtensionFileFilter object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_IMAGE_FILE_SIZE

public static final int MIN_IMAGE_FILE_SIZE
Files smaller then min size are ignored by the filter.

See Also:
Constant Field Values
Constructor Detail

JAIFileFilter

public JAIFileFilter()
Create file filter accepting all images supported by registered JAI codecs.


JAIFileFilter

public JAIFileFilter(java.lang.String codecName)
Create file filter accepting images supported by given codec.

Parameters:
codecName - Codec name.
Method Detail

getDescription

public java.lang.String getDescription()
Gets the Description attribute of the ExtensionFileFilter object

Returns:
The Description value

getCodecName

public java.lang.String getCodecName()
Gets the CodecName attribute of the JAIFileFilter object. May return null if no codec is selected (all files).

Returns:
The CodecName value

accept

public boolean accept(java.io.File file)
Whether the given file is accepted by this filter.

Parameters:
file - File.
Returns:
true is it is a directory or a file that can be accessed by associated codec.

SourceForge.net Logo