From: tcofoegbu Date: Wed, 26 Oct 2016 10:31:53 +0000 (+0100) Subject: JAL-2284 basic support for exporting BioJS MSA viewer via CLI X-Git-Tag: Release_2_10_1^2~25^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Ffeatures%2FJAL-2284_export-biojsmsa-via-cli;p=jalview.git JAL-2284 basic support for exporting BioJS MSA viewer via CLI --- diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 763b10b..164ba27 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -654,6 +654,22 @@ public class Jalview System.out.println("Creating HTML image: " + file); continue; } + else if (format.equalsIgnoreCase("biojsmsa")) + { + BioJsHTMLOutput.updateBioJS(); + try + { + Thread.sleep(1500); + } catch (InterruptedException e) + { + e.printStackTrace(); + } + BioJsHTMLOutput bjs = new BioJsHTMLOutput(af.alignPanel, af); + bjs.exportJalviewAlignmentAsBioJsHtmlFile(file); + System.out.println("Creating BioJS MSA Viwer HTML file: " + + file); + continue; + } else if (format.equalsIgnoreCase("imgMap")) { af.createImageMap(new File(file), imageName); @@ -789,6 +805,7 @@ public class Jalview + "-png FILE\tCreate PNG image FILE from alignment.\n" + "-svg FILE\tCreate SVG image FILE from alignment.\n" + "-html FILE\tCreate HTML file from alignment.\n" + + "-biojsMSA FILE\tCreate BioJS MSA Viewer HTML file from alignment.\n" + "-imgMap FILE\tCreate HTML file FILE with image map of PNG image.\n" + "-eps FILE\tCreate EPS file FILE from alignment.\n" + "-questionnaire URL\tQueries the given URL for information about any Jalview user questionnaires.\n" diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 63620e5..80ee82d 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -1347,7 +1347,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, public void bioJSMenuItem_actionPerformed(ActionEvent e) { BioJsHTMLOutput bjs = new BioJsHTMLOutput(alignPanel, this); - bjs.exportJalviewAlignmentAsBioJsHtmlFile(); + bjs.exportJalviewAlignmentAsBioJsHtmlFile(null); } public void createImageMap(File file, String image) diff --git a/src/jalview/io/BioJsHTMLOutput.java b/src/jalview/io/BioJsHTMLOutput.java index f8fa1f5..817f75c 100644 --- a/src/jalview/io/BioJsHTMLOutput.java +++ b/src/jalview/io/BioJsHTMLOutput.java @@ -80,12 +80,15 @@ public class BioJsHTMLOutput } } - public void exportJalviewAlignmentAsBioJsHtmlFile() + public void exportJalviewAlignmentAsBioJsHtmlFile(String outputFile) { - String outputFile = null; + // String outputFile = null; try { - outputFile = getOutputFile(); + if (outputFile == null) + { + outputFile = getOutputFile(); + } AlignExportSettingI exportSettings = new AlignExportSettingI() { @Override @@ -159,8 +162,11 @@ public class BioJsHTMLOutput new OOMWarning("Creating Image for " + outputFile, err); } catch (Exception e) { + if (pIndicator != null && !headless) + { pIndicator.setProgressBar(MessageManager.formatMessage( "info.error_creating_file", "HTML"), pSessionId); + } e.printStackTrace(); } }