JAL-2322 Refactored unified architecture for data + html exporting for SVG & BioJS...
[jalview.git] / src / jalview / bin / Jalview.java
index d0cabb2..bcb4e7b 100755 (executable)
@@ -51,6 +51,7 @@ import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 import java.net.MalformedURLException;
 import java.net.URI;
+import java.net.URISyntaxException;
 import java.net.URL;
 import java.security.AllPermission;
 import java.security.CodeSource;
@@ -651,23 +652,28 @@ public class Jalview
             File imageFile = new File(file);
             imageName = imageFile.getName();
             HtmlSvgOutput htmlSVG = new HtmlSvgOutput(af.alignPanel);
-            htmlSVG.generateHtmlSvgOutput(new File(file));
+            htmlSVG.exportHTML(file);
 
             System.out.println("Creating HTML image: " + file);
             continue;
           }
           else if (format.equalsIgnoreCase("biojsmsa"))
           {
-            BioJsHTMLOutput.updateBioJS();
+            if (file == null)
+            {
+              System.err.println("The output html file must not be null");
+              return;
+            }
             try
             {
-              Thread.sleep(1500);
-            } catch (InterruptedException e)
+              BioJsHTMLOutput
+                      .refreshVersionInfo(BioJsHTMLOutput.BJS_TEMPLATES_LOCAL_DIRECTORY);
+            } catch (URISyntaxException e)
             {
               e.printStackTrace();
             }
-            BioJsHTMLOutput bjs = new BioJsHTMLOutput(af.alignPanel, af);
-            bjs.exportJalviewAlignmentAsBioJsHtmlFile(file);
+            BioJsHTMLOutput bjs = new BioJsHTMLOutput(af.alignPanel);
+            bjs.exportHTML(file);
             System.out.println("Creating BioJS MSA Viwer HTML file: "
                     + file);
             continue;