JAL-1260 v2 patch from David Roldán-Martínez
[jalview.git] / src / jalview / io / AppletFormatAdapter.java
old mode 100755 (executable)
new mode 100644 (file)
index d7da302..ead63c8
@@ -41,7 +41,7 @@ public class AppletFormatAdapter
    */
   public static final String[] READABLE_FORMATS = new String[]
   { "BLC", "CLUSTAL", "FASTA", "MSF", "PileUp", "PIR", "PFAM", "STH",
-      "PDB", "JnetFile", "RNAML" }; // , "SimpleBLAST" };
+      "PDB", "JnetFile", "RNAML", "GENBANK" };
 
   /**
    * List of valid format strings for use by callers of the formatSequences
@@ -71,8 +71,8 @@ public class AppletFormatAdapter
    * corresponding to READABLE_FNAMES
    */
   public static final String[] READABLE_EXTENSIONS = new String[]
-  { "fa, fasta, mfa, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa",
-      "jar,jvp", "sto,stk", "xml,rnaml" }; // ".blast"
+  { "fa,faa,fasta,mfa,fastq", "aln", "pfam", "msf", "pir", "blc", "amsa",
+      "jar,jvp", "sto,stk", "xml,rnaml", "gb" }; // ".blast"
 
   /**
    * List of readable formats by application in order corresponding to
@@ -80,7 +80,7 @@ public class AppletFormatAdapter
    */
   public static final String[] READABLE_FNAMES = new String[]
   { "Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "AMSA", "Jalview",
-      "Stockholm", "RNAML" };// ,
+      "Stockholm", "RNAML", "GenBank" };
 
   // "SimpleBLAST"
   // };
@@ -245,7 +245,10 @@ public class AppletFormatAdapter
       {
         afile = new RnamlFile(inFile, type);
       }
-
+      else if (format.equals("GENBANK"))
+      {
+        afile = new GenBankFile(inFile, type);
+      }
       Alignment al = new Alignment(afile.getSeqsAsArray());
 
       afile.addAnnotations(al);
@@ -360,6 +363,10 @@ public class AppletFormatAdapter
       {
         afile = new SimpleBlastFile(source);
       }
+      else if (format.equals("GENBANK"))
+      {
+        afile = new GenBankFile(source);
+      }
 
       Alignment al = new Alignment(afile.getSeqsAsArray());
 
@@ -467,7 +474,10 @@ public class AppletFormatAdapter
       {
         afile = new RnamlFile();
       }
-
+      else if (format.equalsIgnoreCase("GENBANK"))
+      {
+        afile = new GenBankFile();
+      }
       else
       {
         throw new Exception(