fix merge conflicts for finess on JAL-1140 (introduced by 1a8f953dd71a9e319e910261927...
[jalview.git] / src / MCview / PDBViewer.java
index 3800d07..c8dbe66 100755 (executable)
@@ -1,13 +1,13 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
- * 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
 {
 
@@ -52,7 +50,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;
@@ -360,8 +357,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 +488,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 +560,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 +656,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 +682,7 @@ public class PDBViewer extends JInternalFrame implements Runnable
           }
         }
         out.close();
+        in.close();
       } catch (Exception ex)
       {
         ex.printStackTrace();