JAL-1780 JAL-653 Format/AppletFormat import and export pipeline regularised, uses...
[jalview.git] / src / jalview / io / FileParse.java
index 8f5144b..9228257 100755 (executable)
@@ -22,6 +22,7 @@ package jalview.io;
 
 import jalview.api.AlignExportSettingI;
 import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
 import jalview.util.MessageManager;
 
 import java.io.BufferedReader;
@@ -410,6 +411,19 @@ public class FileParse
     throw new IOException(MessageManager.formatMessage("exception.invalid_source_stream", new String[]{errormessage}));
   }
 
+  /**
+   * 
+   * @return true if this FileParse is configured for Export only
+   */
+  public boolean isExporting()
+  {
+    return !error && dataIn == null;
+  }
+
+  /**
+   * 
+   * @return true if the data source is valid
+   */
   public boolean isValid()
   {
     return !error;
@@ -535,4 +549,18 @@ public class FileParse
   {
     this.exportSettings = exportSettings;
   }
+
+  /**
+   * method overridden by complex file exporter/importers which support
+   * exporting visualisation and layout settings for a view
+   * 
+   * @param avpanel
+   */
+  public void configureForView(AlignmentViewPanel avpanel)
+  {
+    if (avpanel!=null) {
+      setViewport(avpanel.getAlignViewport());
+    }
+    // could also set export/import settings
+  }
 }