JAL-1668 further clean-up of popup menu and NPE check while transfering ResNum featur...
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 30 Mar 2016 15:47:44 +0000 (16:47 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 30 Mar 2016 15:47:44 +0000 (16:47 +0100)
src/MCview/PDBChain.java
src/jalview/gui/PopupMenu.java

index 8089fdf..108ccf1 100755 (executable)
@@ -193,6 +193,10 @@ public class PDBChain
       status = PDBChain.IEASTATUS;
     }
     SequenceFeature[] features = sequence.getSequenceFeatures();
+    if (features == null)
+    {
+      return null;
+    }
     for (int i = 0; i < features.length; i++)
     {
       if (features[i].getFeatureGroup().equals(pdbid))
index 7491aa1..ab8c398 100644 (file)
@@ -2361,31 +2361,6 @@ public class PopupMenu extends JPopupMenu
             ap, true));
   }
 
-  public void pdbFromFile_actionPerformed()
-  {
-    jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser(
-            jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
-    chooser.setFileView(new jalview.io.JalviewFileView());
-    chooser.setDialogTitle(MessageManager.formatMessage(
-            "label.select_pdb_file_for",
-            new Object[] { sequence.getDisplayId(false) }));
-    chooser.setToolTipText(MessageManager.formatMessage(
-            "label.load_pdb_file_associate_with_sequence",
-            new Object[] { sequence.getDisplayId(false) }));
-
-    int value = chooser.showOpenDialog(null);
-
-    if (value == jalview.io.JalviewFileChooser.APPROVE_OPTION)
-    {
-      String choice = chooser.getSelectedFile().getPath();
-      jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice);
-      new AssociatePdbFileWithSeq().associatePdbWithSeq(choice,
-              jalview.io.AppletFormatAdapter.FILE, sequence, true,
-              Desktop.instance);
-    }
-
-  }
-
   public void enterPDB_actionPerformed()
   {
     String id = JOptionPane.showInternalInputDialog(Desktop.desktop,