From 279ba0fea22587564af5250cfd69e679fa5515bc Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 18 Mar 2005 16:09:12 +0000 Subject: [PATCH] align suffix updated --- src/jalview/io/JalviewFileView.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) 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"); } -- 1.7.10.2