JAL-1605 added command line support for html export option
[jalview.git] / src / jalview / io / HtmlSvgOutput.java
index 4643858..4793ac4 100644 (file)
@@ -29,20 +29,26 @@ public class HtmlSvgOutput
 
   AnnotationPanel annotationPanel;
 
-  public HtmlSvgOutput(AlignmentPanel ap)
+  public HtmlSvgOutput(File file, AlignmentPanel ap)
   {
 
       this.av = ap.av;
       this.ap = ap;
       this.annotationPanel = ap.getAnnotationPanel();
-    generateHtmlSvgOutput();
+    generateHtmlSvgOutput(file);
   }
 
-  public void generateHtmlSvgOutput()
+  public void generateHtmlSvgOutput(File file)
   {
-    File file = null;
     try
     {
+      if (file == null /*
+                        * && !(System.getProperty("java.awt.headless") != null
+                        * && System
+                        * .getProperty("java.awt.headless").equals("true"))
+                        */)
+      {
+
       JalviewFileChooser chooser = getHTMLChooser();
       chooser.setFileView(new jalview.io.JalviewFileView());
       chooser.setDialogTitle(ap.alignFrame.getTitle());
@@ -55,6 +61,7 @@ public class HtmlSvgOutput
                 .getSelectedFile().getParent());
         file = chooser.getSelectedFile();
       }
+      }
 
       AlignmentDimension aDimension = ap.getAlignmentDimension();
       SVGGraphics2D g1 = new SVGGraphics2D(aDimension.getWidth(),