X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2FMCview%2FPDBViewer.java;h=8bfd7b51eb3147c355d1fd42e5a5b0844eae9166;hb=e280466ffa0b7103da4a8ebe85aacbad354fd278;hp=50a501d0ab213a132e37bd4141dbe39cc79a91c6;hpb=d423f22792e47dbc800ae220a58677f988971d06;p=jalview.git diff --git a/src/MCview/PDBViewer.java b/src/MCview/PDBViewer.java index 50a501d..8bfd7b5 100755 --- a/src/MCview/PDBViewer.java +++ b/src/MCview/PDBViewer.java @@ -1,13 +1,13 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5) - * Copyright (C) 2010 J Procter, AM Waterhouse, 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 file is part of Jalview. * * 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 @@ -28,8 +28,6 @@ import jalview.io.*; import jalview.schemes.*; import jalview.ws.ebi.EBIFetchClient; -import java.awt.BorderLayout; - public class PDBViewer extends JInternalFrame implements Runnable { @@ -360,8 +358,7 @@ 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, @@ -492,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) @@ -564,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) @@ -653,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"); @@ -679,6 +683,7 @@ public class PDBViewer extends JInternalFrame implements Runnable } } out.close(); + in.close(); } catch (Exception ex) { ex.printStackTrace();