X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=blobdiff_plain;f=src%2Fjalview%2Fio%2FBioJsHTMLOutput.java;h=5c19f94ac807046ce035a489a65d38308ee62093;hp=045fc7edd7369264582378d2b1b2aedd2cfde2d7;hb=f96e6a945e2df8a844f428c08cfc08210d937fc0;hpb=62f2ed464010270830afcfe954647a51dfb5114b diff --git a/src/jalview/io/BioJsHTMLOutput.java b/src/jalview/io/BioJsHTMLOutput.java index 045fc7e..5c19f94 100644 --- a/src/jalview/io/BioJsHTMLOutput.java +++ b/src/jalview/io/BioJsHTMLOutput.java @@ -20,7 +20,7 @@ */ package jalview.io; -import jalview.exceptions.NoFileSelectedException; +import jalview.bin.Cache; import jalview.gui.AlignmentPanel; import jalview.gui.OOMWarning; import jalview.json.binding.biojs.BioJSReleasePojo; @@ -41,7 +41,6 @@ import java.util.TreeMap; public class BioJsHTMLOutput extends HTMLOutput { - private static File currentBJSTemplateFile; private static TreeMap bioJsMSAVersions; @@ -49,43 +48,16 @@ public class BioJsHTMLOutput extends HTMLOutput public static final String DEFAULT_DIR = System.getProperty("user.home") + File.separatorChar + ".biojs_templates" + File.separatorChar; - public static final String BJS_TEMPLATES_LOCAL_DIRECTORY = jalview.bin.Cache + public static final String BJS_TEMPLATES_LOCAL_DIRECTORY = Cache .getDefault("biojs_template_directory", DEFAULT_DIR); - public static final String BJS_TEMPLATE_GIT_REPO = jalview.bin.Cache - .getDefault("biojs_template_git_repo", - "https://raw.githubusercontent.com/jalview/exporter-templates/master/biojs/package.json"); + public static final String BJS_TEMPLATE_GIT_REPO = Cache.getDefault( + "biojs_template_git_repo", + "https://raw.githubusercontent.com/jalview/exporter-templates/master/biojs/package.json"); public BioJsHTMLOutput(AlignmentPanel ap) { - super(ap); - } - - @Override - public void exportHTML(String outputFile) - { - exportStarted(); - try - { - if (outputFile == null) - { - outputFile = getOutputFile(); - } - generatedFile = new File(outputFile); - } catch (NoFileSelectedException e) - { - setProgressMessage(MessageManager.formatMessage( - "status.cancelled_image_export_operation", "BioJS MSA")); - return; - } catch (Exception e) - { - setProgressMessage(MessageManager - .formatMessage("info.error_creating_file", "BioJS MSA")); - e.printStackTrace(); - return; - } - new Thread(this, "ExportBioJsHTMLThread").start(); - + super(ap, "BioJS MSA"); } public static void refreshVersionInfo(String dirName) @@ -271,12 +243,6 @@ public class BioJsHTMLOutput extends HTMLOutput } @Override - public File getExportedFile() - { - return generatedFile; - } - - @Override public void run() { try @@ -293,7 +259,7 @@ public class BioJsHTMLOutput extends HTMLOutput out.flush(); out.close(); setProgressMessage(MessageManager - .formatMessage("status.export_complete", "BioJS")); + .formatMessage("status.export_complete", getDescription())); exportCompleted(); } catch (OutOfMemoryError err) @@ -304,7 +270,7 @@ public class BioJsHTMLOutput extends HTMLOutput } catch (Exception e) { setProgressMessage(MessageManager - .formatMessage("info.error_creating_file", "HTML")); + .formatMessage("info.error_creating_file", getDescription())); e.printStackTrace(); }