X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FCutAndPasteTransfer.java;h=3f64ff1129e3a111267b6dde9b42a812abb15469;hb=4fc80882cbf9f5624e7235459de51aab4df2c642;hp=a5aa9eb6d2566f038b19d05380b1b7d8f3e6b9e4;hpb=d1707d4c26db76cfeb640f0dbeb3e3427fd40eb7;p=jalview.git diff --git a/src/jalview/gui/CutAndPasteTransfer.java b/src/jalview/gui/CutAndPasteTransfer.java index a5aa9eb..3f64ff1 100644 --- a/src/jalview/gui/CutAndPasteTransfer.java +++ b/src/jalview/gui/CutAndPasteTransfer.java @@ -135,13 +135,15 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer @Override public void save_actionPerformed(ActionEvent e) { + // TODO: JAL-3048 JalviewFileChooser - Save option + JalviewFileChooser chooser = new JalviewFileChooser( jalview.bin.Cache.getProperty("LAST_DIRECTORY")); chooser.setAcceptAllFileFilterUsed(false); chooser.setFileView(new JalviewFileView()); - chooser.setDialogTitle(MessageManager - .getString("label.save_text_to_file")); + chooser.setDialogTitle( + MessageManager.getString("label.save_text_to_file")); chooser.setToolTipText(MessageManager.getString("action.save")); int value = chooser.showSaveDialog(this); @@ -150,8 +152,8 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer { try { - PrintWriter out = new PrintWriter(new FileWriter( - chooser.getSelectedFile())); + PrintWriter out = new PrintWriter( + new FileWriter(chooser.getSelectedFile())); out.print(getText()); out.close(); @@ -196,8 +198,8 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer try { - textarea.append((String) contents - .getTransferData(DataFlavor.stringFlavor)); + textarea.append( + (String) contents.getTransferData(DataFlavor.stringFlavor)); } catch (Exception ex) { } @@ -228,8 +230,8 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer } if (format == null) { - System.err.println(MessageManager - .getString("label.couldnt_read_data")); + System.err + .println(MessageManager.getString("label.couldnt_read_data")); if (!Jalview.isHeadlessMode()) { JvOptionPane.showInternalMessageDialog(Desktop.desktop, @@ -253,16 +255,16 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer { JvOptionPane.showInternalMessageDialog(Desktop.desktop, MessageManager .formatMessage("label.couldnt_read_pasted_text", new String[] - { ex.toString() }), MessageManager - .getString("label.error_parsing_text"), + { ex.toString() }), + MessageManager.getString("label.error_parsing_text"), JvOptionPane.WARNING_MESSAGE); } if (al != null && al.hasValidSequence()) { - String title = MessageManager.formatMessage( - "label.input_cut_paste_params", - new String[] { format.getName() }); + String title = MessageManager + .formatMessage("label.input_cut_paste_params", new String[] + { format.getName() }); FeatureSettingsModelI proxyColourScheme = source .getFeatureColourScheme(); @@ -272,11 +274,8 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer */ if (viewport != null && viewport.getAlignment() != null) { - if (proxyColourScheme != null) - { - viewport.applyFeaturesStyle(proxyColourScheme); - } ((AlignViewport) viewport).addAlignment(al, title); + viewport.applyFeaturesStyle(proxyColourScheme); } else { @@ -298,6 +297,7 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); af.getViewport().setShowSequenceFeatures(showSeqFeatures); af.getViewport().setFeaturesDisplayed(fd); + af.setMenusForViewport(); ColourSchemeI cs = ColourSchemeMapper.getJalviewColourScheme( colourSchemeName, al); if (cs != null) @@ -321,13 +321,13 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer af.currentFileFormat = format; Desktop.addInternalFrame(af, title, AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); - af.statusBar.setText(MessageManager + af.setStatus(MessageManager .getString("label.successfully_pasted_alignment_file")); try { - af.setMaximum(jalview.bin.Cache.getDefault("SHOW_FULLSCREEN", - false)); + af.setMaximum( + jalview.bin.Cache.getDefault("SHOW_FULLSCREEN", false)); } catch (Exception ex) { } @@ -335,8 +335,8 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer } else { - System.err.println(MessageManager - .getString("label.couldnt_read_data")); + System.err + .println(MessageManager.getString("label.couldnt_read_data")); if (!Jalview.isHeadlessMode()) { JvOptionPane.showInternalMessageDialog(Desktop.desktop,