- this.pIndicator = pIndicator;
- this.type = type;
- this.pSessionId = pSessionId;
- this.headless = headless;
- if (file == null)
- {
- // TODO: JAL-3048 export SVG/EPS/PNG- not required for Jalview-JS
-
- setProgressMessage(MessageManager.formatMessage(
- "status.waiting_for_user_to_select_output_file", type.name));
- JalviewFileChooser chooser;
- chooser = type.getChooser();
- chooser.setFileView(new jalview.io.JalviewFileView());
- chooser.setDialogTitle(title);
- chooser.setToolTipText(MessageManager.getString("action.save"));
- int value = chooser.showSaveDialog(parent);
-
- if (value == jalview.io.JalviewFileChooser.APPROVE_OPTION)
- {
- jalview.bin.Cache.setProperty("LAST_DIRECTORY",
- chooser.getSelectedFile().getParent());
- file = chooser.getSelectedFile();
- }
- else
- {
- setProgressMessage(MessageManager.formatMessage(
- "status.cancelled_image_export_operation", type.name));
- }
- }
- // TODO JAL-3048 refactor to method called by constructor or callback
- if (file != null)
- {
- try
- {
- out = new FileOutputStream(file);
- setProgressMessage(null);
- setProgressMessage(MessageManager.formatMessage(
- "status.exporting_alignment_as_x_file", type.getName()));
- if (type == TYPE.SVG)
- {
- setupSVG(width, height, fileTitle);
- }
- else if (type == TYPE.EPS)
- {
- setupEPS(width, height, fileTitle);
- }
- else if (type == TYPE.PNG)
- {
- setupPNG(width, height);
- }
-
- } catch (Exception ex)
- {
- System.out.println("Error creating " + type.getName() + " file.");