Merge branch 'JAL-1199-Stk_writing' into rnaml_test
[jalview.git] / src / jalview / io / AppletFormatAdapter.java
index 67d50ee..2fc6d12 100755 (executable)
@@ -38,7 +38,7 @@ public class AppletFormatAdapter
    */
   public static final String[] READABLE_FORMATS = new String[]
   { "BLC", "CLUSTAL", "FASTA", "MSF", "PileUp", "PIR", "PFAM", "STH",
-      "PDB", "JnetFile" }; // , "SimpleBLAST" };
+      "PDB", "JnetFile" , "RNAML"}; // , "SimpleBLAST" };
 
   /**
    * List of valid format strings for use by callers of the formatSequences
@@ -53,7 +53,7 @@ public class AppletFormatAdapter
    * that are writable by the application.
    */
   public static final String[] WRITABLE_EXTENSIONS = new String[]
-  { "fa, fasta, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "jar",
+  { "fa,faa,fasta,fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "jar",
       "sto,stk" };
 
   /**
@@ -69,8 +69,8 @@ public class AppletFormatAdapter
    * corresponding to READABLE_FNAMES
    */
   public static final String[] READABLE_EXTENSIONS = new String[]
-  { "fa, fasta, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "jar",
-      "sto,stk" }; // ,
+  { "fa,faa,fasta,fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "jar",
+      "sto,stk","xml,rnaml" }; // ,
 
   // ".blast"
   // };
@@ -81,7 +81,7 @@ public class AppletFormatAdapter
    */
   public static final String[] READABLE_FNAMES = new String[]
   { "Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "AMSA", "Jalview",
-      "Stockholm" };// ,
+      "Stockholm","RNAML" };// ,
 
   // "SimpleBLAST"
   // };
@@ -230,7 +230,9 @@ public class AppletFormatAdapter
       }
       else if (format.equals("PDB"))
       {
-        afile = new MCview.PDBfile(inFile, type);
+        afile = new MCview.PDBfile(inFile, type);        
+        // Uncomment to test Jmol data based PDB processing: JAL-1213
+        // afile = new jalview.ext.jmol.PDBFileWithJmol(inFile, type);
       }
       else if (format.equals("STH"))
       {
@@ -240,7 +242,11 @@ public class AppletFormatAdapter
       {
         afile = new SimpleBlastFile(inFile, type);
       }
-
+      else if (format.equals("RNAML"))
+      {
+        afile = new RnamlFile(inFile, type);
+      }
+      
       Alignment al = new Alignment(afile.getSeqsAsArray());
 
       afile.addAnnotations(al);
@@ -295,7 +301,7 @@ public class AppletFormatAdapter
    * 
    * @return DOCUMENT ME!
    */
-  public Alignment readFromFile(FileParse source, String format)
+  public AlignmentI readFromFile(FileParse source, String format)
           throws java.io.IOException
   {
     // TODO: generalise mapping between format string and io. class instances
@@ -347,6 +353,10 @@ public class AppletFormatAdapter
       {
         afile = new StockholmFile(source);
       }
+      else if (format.equals("RNAML"))
+      {
+        afile = new RnamlFile(source);
+      }
       else if (format.equals("SimpleBLAST"))
       {
         afile = new SimpleBlastFile(source);
@@ -454,6 +464,11 @@ public class AppletFormatAdapter
       {
         afile = new AMSAFile(alignment);
       }
+      else if (format.equalsIgnoreCase("RNAML"))
+      {
+        afile = new RnamlFile();
+      }
+      
       else
       {
         throw new Exception(