String imageSource)
{
final long messageId = System.currentTimeMillis();
+ setStatus(
+ MessageManager.formatMessage(
+ "status.exporting_alignment_as_x_file", imageType),
+ messageId);
/*
* prompt user for output file if not provided
String type = imageType.getName();
try
{
- setStatus(
- MessageManager.formatMessage(
- "status.exporting_alignment_as_x_file", type),
- messageId);
+// setStatus(
+// MessageManager.formatMessage(
+// "status.exporting_alignment_as_x_file", type),
+// messageId);
ImageMaker im = new ImageMaker(imageType, width, height, chosenFile,
title, asLineart);
imageWriter.exportImage(im.getGraphics());
public BioJsHTMLOutput(AlignmentPanel ap)
{
- super(ap);
+ super(ap, "BioJS MSA");
}
public static void refreshVersionInfo(String dirName)
}
- @Override
- protected String getDescription()
- {
- return "BioJS MSA";
- }
-
}
{
protected AlignmentPanel ap;
+ /*
+ * key for progress or status messages
+ */
protected long pSessionId;
+ /*
+ * (optional) place to write progress messages to
+ */
protected IProgressIndicator pIndicator;
protected File generatedFile;
String _bioJson = null;
+ private String description;
+
/**
* Constructor given an alignment panel (which should not be null)
*
* @param ap
+ * @param desc
*/
- public HTMLOutput(AlignmentPanel ap)
+ public HTMLOutput(AlignmentPanel ap, String desc)
{
this.ap = ap;
this.pIndicator = ap.alignFrame;
+ this.description = desc;
+ this.pSessionId = System.currentTimeMillis();
}
/**
/**
* This method provides implementation of consistent behaviour which should
- * occur before a HTML file export. It MUST be called at the start of the
- * exportHTML() method implementation.
- */
- protected void exportStarted()
- {
- pSessionId = System.currentTimeMillis();
- }
-
- /**
- * This method provides implementation of consistent behaviour which should
* occur after a HTML file export. It MUST be called at the end of the
* exportHTML() method implementation.
*/
public void exportHTML(String outputFile)
{
- exportStarted();
+ setProgressMessage(MessageManager.formatMessage(
+ "status.exporting_alignment_as_x_file", getDescription()));
try
{
if (outputFile == null)
*
* @return
*/
- protected abstract String getDescription();
+ protected final String getDescription()
+ {
+ return description;
+ }
}
\ No newline at end of file
{
public HtmlSvgOutput(AlignmentPanel ap)
{
- super(ap);
- }
-
- @Override
- public void exportHTML(String outputFile)
- {
- exportStarted();
- try
- {
- if (outputFile == null)
- {
- outputFile = getOutputFile();
- if (outputFile == null)
- {
- setProgressMessage(MessageManager.formatMessage(
- "status.cancelled_image_export_operation", "HTML"));
- return;
- }
- }
- generatedFile = new File(outputFile);
- } catch (Exception e)
- {
- setProgressMessage(MessageManager
- .formatMessage("info.error_creating_file", "HTML"));
- e.printStackTrace();
- return;
- }
- new Thread(this).start();
+ super(ap, "HTML");
}
public int printUnwrapped(int pwidth, int pheight, int pi,
{
try
{
- setProgressMessage(null);
- setProgressMessage(MessageManager.formatMessage(
- "status.exporting_alignment_as_x_file", getDescription()));
-
String renderStyle = Cache.getDefault("HTML_RENDERING",
"Prompt each time");
AtomicBoolean textOption = new AtomicBoolean(
.formatMessage("info.error_creating_file", getDescription()));
}
}
-
- @Override
- protected String getDescription()
- {
- return "HTML";
- }
}