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
\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
\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