Merge branch 'merge/develop_JAL-1780_JAL-653_JAL-1892' into develop
[jalview.git] / src / jalview / io / FormatAdapter.java
index d241308..e795925 100755 (executable)
@@ -20,7 +20,8 @@
  */
 package jalview.io;
 
-import jalview.api.AlignViewportI;
+import jalview.api.AlignExportSettingI;
+import jalview.api.AlignmentViewPanel;
 import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
@@ -28,6 +29,7 @@ import jalview.datamodel.ColumnSelection;
 import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
+import jalview.gui.AlignmentPanel;
 
 /**
  * Additional formatting methods used by the application in a number of places.
@@ -37,9 +39,9 @@ import jalview.datamodel.SequenceI;
  */
 public class FormatAdapter extends AppletFormatAdapter
 {
-  public FormatAdapter(AlignViewportI viewport)
+  public FormatAdapter(AlignmentViewPanel viewpanel)
   {
-    super(viewport);
+    super(viewpanel);
     init();
   }
 
@@ -49,6 +51,12 @@ public class FormatAdapter extends AppletFormatAdapter
     init();
   }
 
+  public FormatAdapter(AlignmentPanel alignPanel,
+          AlignExportSettingI settings)
+  {
+    super(alignPanel, settings);
+  }
+
   private void init()
   {
     if (jalview.bin.Cache.getDefault("STRUCT_FROM_PDB", true))
@@ -304,17 +312,17 @@ public class FormatAdapter extends AppletFormatAdapter
     return this.formatSequences(format, alignment, suffix);
   }
 
-  public Alignment readFile(String inFile, String type, String format)
+  public AlignmentI readFile(String inFile, String type, String format)
           throws java.io.IOException
   {
-    Alignment al = super.readFile(inFile, type, format);
+    AlignmentI al = super.readFile(inFile, type, format);
     return al;
   }
 
   public AlignmentI readFromFile(FileParse source, String format)
           throws java.io.IOException
   {
-    Alignment al = (Alignment) super.readFromFile(source, format);
+    AlignmentI al = super.readFromFile(source, format);
     return al;
   }
 
@@ -341,14 +349,19 @@ public class FormatAdapter extends AppletFormatAdapter
   }
 
   /**
-   * Create a flat file representation of a given view or selected region of a view
+   * Create a flat file representation of a given view or selected region of a
+   * view
+   * 
    * @param format
-   * @param av
+   * @param ap
+   *          alignment panel originating the view
    * @return String containing flat file
    */
-  public String formatSequences(String format, AlignViewportI av, boolean selectedOnly)
+  public String formatSequences(String format, AlignmentViewPanel ap,
+          boolean selectedOnly)
   {
-    return formatSequences(format, getCacheSuffixDefault(format), av, selectedOnly);
+    return formatSequences(format, getCacheSuffixDefault(format), ap,
+            selectedOnly);
   }