package jaist.css.covis.filefilter;

import java.io.File;

/**
 * ÈOÍCBookEditorÆÄÎêéy[WÒWpÌÁÊÌvOðN®µÈ¢Æ
 * y[WÌ}[NðÒWÅ«È©Á½D
 * BookEditorÅæt@CðÇÝñÅwiæÆ·éÆ«Égp³êÄ¢½D
 * 
 * »ÝÍC¼ÚPageBrowserÉæt@CðhbOhbv·é¾¯Åy[WæÌÝè
 * ªÅ«éÌÅCsvD
 * 
 * @author miuramo
 *
 */
@Deprecated
public class ImageFileFilter extends javax.swing.filechooser.FileFilter implements
		java.io.FilenameFilter {
	String suffix;

	public ImageFileFilter(String s) {
		suffix = s;
	}

	public boolean accept(File dir) {
		// if (dir.isDirectory()) return true;
		String name = dir.getName();
		if (name.endsWith(suffix) || name.endsWith(".png")
				|| name.endsWith(".jpg") || name.endsWith(".gif")
				|| dir.isDirectory()) {
			return true;
		} else {
			return false;
		}
	}

	public boolean accept(File dir, String name) {
		// if (dir.isDirectory()) return true;
		if (name.endsWith(suffix) || name.endsWith(".png")
				|| name.endsWith(".jpg") || name.endsWith(".gif")
				|| dir.isDirectory()) {
			return true;
		} else {
			return false;
		}
	}

	public String getDescription() {
		return "image file (*.png, *.jpg, *.gif)";
	}
}
