X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2FMCview%2FPDBViewer.java;h=f5a9169a0a233a9ea60cca2f916526e21590fbeb;hb=80c223c45fde0899c9794e887801dd82fffd3452;hp=dda04a8fd5a1acf0e9cd1ae6e586a614fa916a4c;hpb=506d60f0e188723ddc91c26824b41ac7034df3fe;p=jalview.git diff --git a/src/MCview/PDBViewer.java b/src/MCview/PDBViewer.java index dda04a8..f5a9169 100755 --- a/src/MCview/PDBViewer.java +++ b/src/MCview/PDBViewer.java @@ -1,20 +1,19 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4) - * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8) + * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This file is part of Jalview. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU General Public License along with Jalview. If not, see . */ package MCview; @@ -27,10 +26,9 @@ import jalview.datamodel.*; import jalview.gui.*; import jalview.io.*; import jalview.schemes.*; +import jalview.util.MessageManager; import jalview.ws.ebi.EBIFetchClient; -import java.awt.BorderLayout; - public class PDBViewer extends JInternalFrame implements Runnable { @@ -53,7 +51,6 @@ public class PDBViewer extends JInternalFrame implements Runnable public PDBViewer(PDBEntry pdbentry, SequenceI[] seq, String[] chains, AlignmentPanel ap, String protocol) - { this.pdbentry = pdbentry; this.seq = seq; @@ -361,13 +358,12 @@ public class PDBViewer extends JInternalFrame implements Runnable if (evt.isControlDown() || SwingUtilities.isRightMouseButton(evt)) { - radioItem - .removeActionListener(radioItem.getActionListeners()[0]); + radioItem.removeActionListener(radioItem.getActionListeners()[0]); int option = JOptionPane.showInternalConfirmDialog( jalview.gui.Desktop.desktop, - "Remove from default list?", - "Remove user defined colour", + MessageManager.getString("label.remove_from_default_list"), + MessageManager.getString("label.remove_user_defined_colour"), JOptionPane.YES_NO_OPTION); if (option == JOptionPane.YES_OPTION) { @@ -460,7 +456,7 @@ public class PDBViewer extends JInternalFrame implements Runnable * DOCUMENT ME! * * @param e - * DOCUMENT ME! + * DOCUMENT ME! */ public void eps_actionPerformed(ActionEvent e) { @@ -471,7 +467,7 @@ public class PDBViewer extends JInternalFrame implements Runnable * DOCUMENT ME! * * @param e - * DOCUMENT ME! + * DOCUMENT ME! */ public void png_actionPerformed(ActionEvent e) { @@ -493,8 +489,8 @@ public class PDBViewer extends JInternalFrame implements Runnable else { im = new jalview.util.ImageMaker(this, jalview.util.ImageMaker.EPS, - "Make EPS file from view", width, height, null, this - .getTitle()); + "Make EPS file from view", width, height, null, + this.getTitle()); } if (im.getGraphics() != null) @@ -565,8 +561,15 @@ public class PDBViewer extends JInternalFrame implements Runnable public void mapping_actionPerformed(ActionEvent e) { jalview.gui.CutAndPasteTransfer cap = new jalview.gui.CutAndPasteTransfer(); - Desktop.addInternalFrame(cap, "PDB - Sequence Mapping", 550, 600); - cap.setText(pdbcanvas.mappingDetails.toString()); + try + { + cap.setText(pdbcanvas.mappingDetails.toString()); + Desktop.addInternalFrame(cap, "PDB - Sequence Mapping", 550, 600); + } catch (OutOfMemoryError oom) + { + new OOMWarning("Opening sequence to structure mapping report", oom); + cap.dispose(); + } } public void allchains_itemStateChanged(ItemEvent e) @@ -654,8 +657,8 @@ public class PDBViewer extends JInternalFrame implements Runnable public void savePDB_actionPerformed(ActionEvent e) { - JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache - .getProperty("LAST_DIRECTORY")); + JalviewFileChooser chooser = new JalviewFileChooser( + jalview.bin.Cache.getProperty("LAST_DIRECTORY")); chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle("Save PDB File"); @@ -680,6 +683,7 @@ public class PDBViewer extends JInternalFrame implements Runnable } } out.close(); + in.close(); } catch (Exception ex) { ex.printStackTrace();