align suffix updated
authoramwaterhouse <Andrew Waterhouse>
Fri, 18 Mar 2005 16:09:12 +0000 (16:09 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 18 Mar 2005 16:09:12 +0000 (16:09 +0000)
src/jalview/io/JalviewFileView.java

index aa9d6f2..cdf873a 100755 (executable)
@@ -3,9 +3,21 @@ package jalview.io;
 import javax.swing.filechooser.FileView;\r
 import javax.swing.*;\r
 import java.io.*;\r
+import java.util.*;\r
 \r
 public class JalviewFileView extends FileView\r
 {\r
+  static Hashtable alignSuffix = new Hashtable();\r
+  static{\r
+    alignSuffix.put("fasta", "Fasta file");\r
+    alignSuffix.put("fa", "Fasta file");\r
+    alignSuffix.put("fastq", "Fasta file");\r
+    alignSuffix.put("blc", "BLC file");\r
+    alignSuffix.put("msf", "MSF file");\r
+    alignSuffix.put("pfam", "PFAM file");\r
+    alignSuffix.put("aln", "Clustal file");\r
+    alignSuffix.put("pir", "PIR file");\r
+  }\r
   public String getTypeDescription(File f)\r
   {\r
     String extension = getExtension(f);\r
@@ -13,9 +25,9 @@ public class JalviewFileView extends FileView
 \r
     if (extension != null)\r
     {\r
-      if (extension.equals("fasta") || extension.equals("fa") || extension.equals("fastq"))\r
+      if (alignSuffix.containsKey(extension))\r
       {\r
-        type = "Fasta file";\r
+        type = alignSuffix.get(extension).toString();\r
       }\r
     }\r
     return type;\r
@@ -28,7 +40,7 @@ public class JalviewFileView extends FileView
 \r
     if (extension != null)\r
     {\r
-      if (extension.equals("fasta") || extension.equals("fa") || extension.equals("fastq"))\r
+      if (alignSuffix.containsKey(extension))\r
       {\r
         icon = createImageIcon("/images/file.png");\r
       }\r