From 364f1cf36d12a069be963ec0166c9170e8b6f365 Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Wed, 30 Mar 2016 16:47:44 +0100 Subject: [PATCH] JAL-1668 further clean-up of popup menu and NPE check while transfering ResNum features in PDBChain --- src/MCview/PDBChain.java | 4 ++++ src/jalview/gui/PopupMenu.java | 25 ------------------------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/src/MCview/PDBChain.java b/src/MCview/PDBChain.java index 8089fdf..108ccf1 100755 --- a/src/MCview/PDBChain.java +++ b/src/MCview/PDBChain.java @@ -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)) diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index 7491aa1..ab8c398 100644 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -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, -- 1.7.10.2