Merge commit 'alpha/update_2_12_for_2_11_2_series_merge^2' into HEAD
[jalview.git] / src / jalview / io / FileFormat.java
index b7df731..6fe338c 100644 (file)
  */
 package jalview.io;
 
+import java.io.IOException;
+
 import jalview.datamodel.AlignmentI;
+import jalview.datamodel.DBRefSource;
 import jalview.datamodel.PDBEntry;
 import jalview.ext.jmol.JmolParser;
 import jalview.structure.StructureImportSettings;
 
-import java.io.IOException;
-
 public enum FileFormat implements FileFormatI
 {
   Fasta("Fasta", "fa, fasta, mfa, fastq", true, true)
@@ -243,6 +244,37 @@ public enum FileFormat implements FileFormatI
       return new PhylipFile();
     }
   },
+  GenBank("GenBank Flatfile", "gb, gbk", true, false)
+  {
+    @Override
+    public AlignmentFileReaderI getReader(FileParse source)
+            throws IOException
+    {
+      return new GenBankFile(source, "GenBank");
+    }
+
+    @Override
+    public AlignmentFileWriterI getWriter(AlignmentI al)
+    {
+      return null;
+    }
+  },
+  Embl("ENA Flatfile", "txt", true, false)
+  {
+    @Override
+    public AlignmentFileReaderI getReader(FileParse source)
+            throws IOException
+    {
+      // Always assume we import from EMBL for now
+      return new EmblFlatFile(source, DBRefSource.EMBL);
+    }
+
+    @Override
+    public AlignmentFileWriterI getWriter(AlignmentI al)
+    {
+      return null;
+    }
+  },
   Jnet("JnetFile", "", false, false)
   {
     @Override
@@ -437,8 +469,8 @@ public enum FileFormat implements FileFormatI
    * @param shortName
    * @param extensions
    *          comma-separated list of file extensions associated with the format
-   * @param isReadable
-   * @param isWritable
+   * @param isReadable - can be recognised by IdentifyFile and imported with the given reader
+   * @param isWritable - can be exported with the returned writer
    */
   private FileFormat(String shortName, String extensions,
           boolean isReadable, boolean isWritable)