X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FHtmlSvgOutput.java;h=a943a813e80cc726385960f68c73a77bd110ab39;hb=7047b076a62df177047ceb16c3611efe020bdd76;hp=1ec3a4e6483f68d9e9ab2af7d4eb0b0fb9b3e17f;hpb=6168111321deafec25337c6c59210f14f857041d;p=jalview.git diff --git a/src/jalview/io/HtmlSvgOutput.java b/src/jalview/io/HtmlSvgOutput.java index 1ec3a4e..a943a81 100644 --- a/src/jalview/io/HtmlSvgOutput.java +++ b/src/jalview/io/HtmlSvgOutput.java @@ -20,26 +20,28 @@ */ package jalview.io; -import jalview.exceptions.NoFileSelectedException; +import jalview.bin.Cache; import jalview.gui.AlignmentPanel; -import jalview.gui.HTMLOptions; +import jalview.gui.LineartOptions; import jalview.gui.OOMWarning; import jalview.math.AlignmentDimension; import jalview.util.MessageManager; +import jalview.util.dialogrunner.RunResponse; import java.awt.Graphics; import java.awt.print.PrinterException; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; +import java.util.concurrent.atomic.AtomicBoolean; + +import javax.swing.JOptionPane; import org.jfree.graphics2d.svg.SVGGraphics2D; import org.jfree.graphics2d.svg.SVGHints; public class HtmlSvgOutput extends HTMLOutput { - - public HtmlSvgOutput(AlignmentPanel ap) { super(ap); @@ -54,33 +56,24 @@ public class HtmlSvgOutput extends HTMLOutput if (outputFile == null) { outputFile = getOutputFile(); + if (outputFile == null) + { + setProgressMessage(MessageManager.formatMessage( + "status.cancelled_image_export_operation", "HTML")); + return; + } } generatedFile = new File(outputFile); - } catch (NoFileSelectedException e) - { - setProgressMessage(MessageManager.formatMessage( - "status.cancelled_image_export_operation", "HTML")); - return; } catch (Exception e) { - setProgressMessage(MessageManager.formatMessage( - "info.error_creating_file", "HTML")); + setProgressMessage(MessageManager + .formatMessage("info.error_creating_file", "HTML")); e.printStackTrace(); return; } new Thread(this).start(); } - - static JalviewFileChooser getHTMLChooser() - { - return new jalview.io.JalviewFileChooser( - jalview.bin.Cache.getProperty("LAST_DIRECTORY"), - new String[] { "html" }, - new String[] { "Hypertext Markup Language" }, - "Hypertext Markup Language"); - } - public int printUnwrapped(int pwidth, int pheight, int pi, Graphics idGraphics, Graphics alignmentGraphics) throws PrinterException @@ -95,17 +88,20 @@ public class HtmlSvgOutput extends HTMLOutput return ap.printWrappedAlignment(pwidth, pheight, pi, pg[0]); } - private String getHtml(String titleSvg, String alignmentSvg, + String getHtml(String titleSvg, String alignmentSvg, String jsonData, boolean wrapped) { StringBuilder htmlSvg = new StringBuilder(); htmlSvg.append("\n"); if (jsonData != null) { - htmlSvg.append(" "); - htmlSvg.append(""); - htmlSvg.append("