file format enum wip changes
[jalview.git] / src / jalview / io / FormatAdapter.java
index 4ec077f..eac1041 100755 (executable)
@@ -22,6 +22,7 @@ package jalview.io;
 
 import jalview.api.AlignExportSettingI;
 import jalview.api.AlignmentViewPanel;
+import jalview.bin.Cache;
 import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
@@ -30,6 +31,8 @@ import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
 
+import java.io.IOException;
+
 /**
  * Additional formatting methods used by the application in a number of places.
  * 
@@ -225,24 +228,24 @@ public class FormatAdapter extends AppletFormatAdapter
     return null;
   }
 
-  public boolean getCacheSuffixDefault(String format)
+  public boolean getCacheSuffixDefault(FileFormatI format)
   {
     if (isValidFormat(format))
     {
-      return jalview.bin.Cache.getDefault(format.toUpperCase()
+      return Cache.getDefault(format.toUpperCase()
               + "_JVSUFFIX", true);
     }
     return false;
   }
 
-  public String formatSequences(String format, AlignmentI alignment,
+  public String formatSequences(FileFormatI format, AlignmentI alignment,
           String[] omitHidden, int[] exportRange, ColumnSelection colSel)
   {
     return formatSequences(format, alignment, omitHidden, exportRange,
             getCacheSuffixDefault(format), colSel, null);
   }
 
-  public String formatSequences(String format, AlignmentI alignment,
+  public String formatSequences(FileFormatI format, AlignmentI alignment,
           String[] omitHidden, int[] exportRange, ColumnSelection colSel,
           SequenceGroup sgp)
   {
@@ -262,7 +265,7 @@ public class FormatAdapter extends AppletFormatAdapter
    *          defines hidden columns that are edited out of annotation
    * @return string representation of the alignment formatted as format
    */
-  public String formatSequences(String format, AlignmentI alignment,
+  public String formatSequences(FileFormatI format, AlignmentI alignment,
           String[] omitHidden, int[] exportRange, boolean suffix,
           ColumnSelection colSel)
   {
@@ -270,9 +273,9 @@ public class FormatAdapter extends AppletFormatAdapter
             suffix, colSel, null);
   }
 
-  public String formatSequences(String format, AlignmentI alignment,
+  public String formatSequences(FileFormatI format, AlignmentI alignment,
           String[] omitHidden, int[] exportRange, boolean suffix,
-          ColumnSelection colSel, jalview.datamodel.SequenceGroup selgp)
+          ColumnSelection colSel, SequenceGroup selgp)
   {
     if (omitHidden != null)
     {
@@ -305,15 +308,17 @@ public class FormatAdapter extends AppletFormatAdapter
     return this.formatSequences(format, alignment, suffix);
   }
 
-  public AlignmentI readFile(String inFile, String type, String format)
-          throws java.io.IOException
+  @Override
+  public AlignmentI readFile(String file, DataSourceType sourceType,
+          FileFormatI fileFormat) throws IOException
   {
-    AlignmentI al = super.readFile(inFile, type, format);
+    AlignmentI al = super.readFile(file, sourceType, fileFormat);
     return al;
   }
 
-  public AlignmentI readFromFile(FileParse source, String format)
-          throws java.io.IOException
+  @Override
+  public AlignmentI readFromFile(FileParse source, FileFormatI format)
+          throws IOException
   {
     AlignmentI al = super.readFromFile(source, format);
     return al;
@@ -350,7 +355,7 @@ public class FormatAdapter extends AppletFormatAdapter
    *          alignment panel originating the view
    * @return String containing flat file
    */
-  public String formatSequences(String format, AlignmentViewPanel ap,
+  public String formatSequences(FileFormatI format, AlignmentViewPanel ap,
           boolean selectedOnly)
   {
     return formatSequences(format, getCacheSuffixDefault(format), ap,