- return;
- }
- CutAndPasteTransfer cap = new CutAndPasteTransfer();
- cap.setForInput(null);
- try
- {
- FileFormatI format = fileFormat;
- cap.setText(new FormatAdapter(alignPanel, exportData.getSettings())
- .formatSequences(format, exportData.getAlignment(),
- exportData.getOmitHidden(),
- exportData.getStartEndPostions(),
- viewport.getAlignment().getHiddenColumns()));
- Desktop.addInternalFrame(cap, MessageManager
- .formatMessage("label.alignment_output_command", new Object[]
- { e.getActionCommand() }), 600, 500);
- } catch (OutOfMemoryError oom)
- {
- new OOMWarning("Outputting alignment as " + e.getActionCommand(),
- oom);
- cap.dispose();
- }
-
- }
-
- public static AlignmentExportData getAlignmentForExport(
- FileFormatI format, AlignViewportI viewport,
- AlignExportSettingI exportSettings)
- {
- AlignmentI alignmentToExport = null;
- AlignExportSettingI settings = exportSettings;
- String[] omitHidden = null;
-
- HiddenSequences hiddenSeqs = viewport.getAlignment()
- .getHiddenSequences();
-
- alignmentToExport = viewport.getAlignment();
-
- boolean hasHiddenSeqs = hiddenSeqs.getSize() > 0;
- if (settings == null)
- {
- settings = new AlignExportSettings(hasHiddenSeqs,
- viewport.hasHiddenColumns(), format);
- }
- // settings.isExportAnnotations();
-
- if (viewport.hasHiddenColumns() && !settings.isExportHiddenColumns())
- {
- omitHidden = viewport.getViewAsString(false,
- settings.isExportHiddenSequences());
- }
+ @Override
+ public void run()
+ {
+ // todo defer this to inside formatSequences (or later)
+ AlignmentExportData exportData = viewport
+ .getAlignExportData(options);
+ CutAndPasteTransfer cap = new CutAndPasteTransfer();
+ cap.setForInput(null);
+ try
+ {
+ FileFormatI format = fileFormat;
+ cap.setText(new FormatAdapter(alignPanel, options)
+ .formatSequences(format, exportData.getAlignment(),
+ exportData.getOmitHidden(),
+ exportData.getStartEndPostions(),
+ viewport.getAlignment().getHiddenColumns()));
+ Desktop.addInternalFrame(cap, MessageManager.formatMessage(
+ "label.alignment_output_command", new Object[]
+ { fileFormat.getName() }), 600, 500);
+ } catch (OutOfMemoryError oom)
+ {
+ new OOMWarning("Outputting alignment as " + fileFormat.getName(),
+ oom);
+ cap.dispose();
+ }
+ }
+ };