/*    */ package save;
/*    */ 
/*    */ import java.io.File;
/*    */ import javax.swing.filechooser.FileFilter;
/*    */ 
/*    */ public class Filter extends FileFilter
/*    */ {
/*  8 */   private String description = "Chronogram File"; private String extension = ".chr";
/*    */   
/*    */   public Filter(String ext, String descrip) {
/* 11 */     this.extension = ext;
/* 12 */     this.description = descrip;
/*    */   }
/*    */   
/*    */   public boolean accept(File file) {
/* 16 */     String temp = removeChar(this.extension, ' ');
/* 17 */     String[] exts = temp.split(",");
/* 18 */     boolean res = file.isDirectory();
/* 19 */     for (int i = 0; i < exts.length; i++) {
/* 20 */       res = (res) || (file.getName().endsWith(exts[i]));
/*    */     }
/* 22 */     return res;
/*    */   }
/*    */   
/*    */   public String getDescription() {
/* 26 */     return this.extension + " - " + this.description;
/*    */   }
/*    */   
/*    */   public String removeChar(String s, char c) {
/* 30 */     String res = "";
/* 31 */     for (int i = 0; i < s.length(); i++) {
/* 32 */       if (s.charAt(i) != c) res = res + s.charAt(i);
/*    */     }
/* 34 */     return res;
/*    */   }
/*    */ }


/* Location:              F:\JAVA\WORKSPACE\chronoEditor_v2.3.jar!\save\Filter.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */