package jalview.io;
import jalview.bin.Cache;
-import jalview.exceptions.NoFileSelectedException;
import jalview.gui.AlignmentPanel;
import jalview.gui.LineartOptions;
import jalview.gui.OOMWarning;
public class HtmlSvgOutput extends HTMLOutput
{
-
public HtmlSvgOutput(AlignmentPanel ap)
{
super(ap);
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
}
@Override
- public File getExportedFile()
- {
- return generatedFile;
- }
-
- @Override
public void run()
{
try
{
setProgressMessage(null);
setProgressMessage(MessageManager.formatMessage(
- "status.exporting_alignment_as_x_file", "HTML"));
+ "status.exporting_alignment_as_x_file", getDescription()));
String renderStyle = Cache.getDefault("HTML_RENDERING",
"Prompt each time");
*/
if (renderStyle.equalsIgnoreCase("Prompt each time") && !isHeadless())
{
- LineartOptions svgOption = new LineartOptions("HTML_RENDERING",
- "HTML", textOption);
+ LineartOptions svgOption = new LineartOptions("HTML", textOption);
svgOption.setResponseAction(new RunResponse(JOptionPane.NO_OPTION)
{
@Override
public void run()
{
setProgressMessage(MessageManager.formatMessage(
- "status.cancelled_image_export_operation", "HTML"));
+ "status.cancelled_image_export_operation",
+ getDescription()));
}
});
svgOption.setResponseAction(okAction);
{
e.printStackTrace();
setProgressMessage(MessageManager
- .formatMessage("info.error_creating_file", "HTML"));
+ .formatMessage("info.error_creating_file", getDescription()));
}
}
out.flush();
out.close();
setProgressMessage(MessageManager
- .formatMessage("status.export_complete", "HTML"));
+ .formatMessage("status.export_complete", getDescription()));
exportCompleted();
} catch (Exception e)
{
e.printStackTrace();
setProgressMessage(MessageManager
- .formatMessage("info.error_creating_file", "HTML"));
+ .formatMessage("info.error_creating_file", getDescription()));
}
}
+
+ @Override
+ protected String getDescription()
+ {
+ return "HTML";
+ }
}