From: amwaterhouse Date: Fri, 18 Mar 2005 16:09:12 +0000 (+0000) Subject: align suffix updated X-Git-Tag: Release_2_0~566 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=279ba0fea22587564af5250cfd69e679fa5515bc;p=jalview.git align suffix updated --- diff --git a/src/jalview/io/JalviewFileView.java b/src/jalview/io/JalviewFileView.java index aa9d6f2..cdf873a 100755 --- a/src/jalview/io/JalviewFileView.java +++ b/src/jalview/io/JalviewFileView.java @@ -3,9 +3,21 @@ package jalview.io; import javax.swing.filechooser.FileView; import javax.swing.*; import java.io.*; +import java.util.*; public class JalviewFileView extends FileView { + static Hashtable alignSuffix = new Hashtable(); + static{ + alignSuffix.put("fasta", "Fasta file"); + alignSuffix.put("fa", "Fasta file"); + alignSuffix.put("fastq", "Fasta file"); + alignSuffix.put("blc", "BLC file"); + alignSuffix.put("msf", "MSF file"); + alignSuffix.put("pfam", "PFAM file"); + alignSuffix.put("aln", "Clustal file"); + alignSuffix.put("pir", "PIR file"); + } public String getTypeDescription(File f) { String extension = getExtension(f); @@ -13,9 +25,9 @@ public class JalviewFileView extends FileView if (extension != null) { - if (extension.equals("fasta") || extension.equals("fa") || extension.equals("fastq")) + if (alignSuffix.containsKey(extension)) { - type = "Fasta file"; + type = alignSuffix.get(extension).toString(); } } return type; @@ -28,7 +40,7 @@ public class JalviewFileView extends FileView if (extension != null) { - if (extension.equals("fasta") || extension.equals("fa") || extension.equals("fastq")) + if (alignSuffix.containsKey(extension)) { icon = createImageIcon("/images/file.png"); }