X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FMCview%2FPDBViewer.java;h=b3aae5130c3836b5158aa0f89a6060c6d3e5c6e6;hb=28787d9646cca5dd77190930f59b7ff32cf995b4;hp=35e2308baaafaa3fa8a769d8500e969ce3c452fe;hpb=1b85d0acd9a09b646ac2dd6f1ea6db5db6f3731d;p=jalview.git diff --git a/src/MCview/PDBViewer.java b/src/MCview/PDBViewer.java index 35e2308..b3aae51 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 @@ -21,6 +21,14 @@ import java.io.*; import java.awt.event.*; import javax.swing.*; +import javax.xml.parsers.ParserConfigurationException; + +import org.xml.sax.SAXException; + +import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; +import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; +import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; +import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; import jalview.datamodel.*; import jalview.gui.*; @@ -28,8 +36,6 @@ import jalview.io.*; import jalview.schemes.*; import jalview.ws.ebi.EBIFetchClient; -import java.awt.BorderLayout; - public class PDBViewer extends JInternalFrame implements Runnable { @@ -51,7 +57,7 @@ public class PDBViewer extends JInternalFrame implements Runnable String tmpPDBFile; public PDBViewer(PDBEntry pdbentry, SequenceI[] seq, String[] chains, - AlignmentPanel ap, String protocol) + AlignmentPanel ap, String protocol) throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses { this.pdbentry = pdbentry; @@ -360,8 +366,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 +497,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,12 +569,13 @@ public class PDBViewer extends JInternalFrame implements Runnable public void mapping_actionPerformed(ActionEvent e) { jalview.gui.CutAndPasteTransfer cap = new jalview.gui.CutAndPasteTransfer(); - try { + 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); + new OOMWarning("Opening sequence to structure mapping report", oom); cap.dispose(); } } @@ -659,8 +665,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"); @@ -685,6 +691,7 @@ public class PDBViewer extends JInternalFrame implements Runnable } } out.close(); + in.close(); } catch (Exception ex) { ex.printStackTrace();