

package drawing;

import icsDyn.ExtUtils;
/*
 * PNGFileFilter
 * this class is a filter for the open and save file dialogs
 */
public class PNGFileFilter extends javax.swing.filechooser.FileFilter{
	/*
	 *  
	 * @see javax.swing.filechooser.FileFilter#accept(java.io.File)
	 */
	public boolean accept(java.io.File f) {
	    
	    if (f.isDirectory()) {
	      return true;
	    }
	    String extension = ExtUtils.getExtension(f);
	    if (extension != null) {
	      if (extension.equals(ExtUtils.png)) {
	        return true;
	      } else {
	        return false;
	      }
	    }
	    return false;
	  }
	 /*
	  *  
	  * @see javax.swing.filechooser.FileFilter#getDescription()
	  */
	  public String getDescription() {
	    return ("png files");
	  }
}
