From af7becd656cba3835394e2dc50c2ad8d189a6d46 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 30 Mar 2018 10:35:51 +0100 Subject: [PATCH] JAL-2629 select HMM selects sequence under cursor --- src/jalview/gui/PopupMenu.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index c988b59..e3becf6 100644 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -366,17 +366,15 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener selectHMM.setText(MessageManager.getString("label.select_hmm")); selectHMM.addActionListener(new ActionListener() { - @Override public void actionPerformed(ActionEvent e) { - selectHMM_actionPerformed(e); + selectHMM_actionPerformed(sequence); } }); add(selectHMM); } - if (alignPanel.av.getSelectionGroup() != null && alignPanel.av.getSelectionGroup().getSize() > 1) { @@ -1370,11 +1368,13 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener jMenu1.add(displayNonconserved); } - - protected void selectHMM_actionPerformed(ActionEvent e) + protected void selectHMM_actionPerformed(SequenceI seq) { - SequenceI hmm = ap.av.getSequenceSelection()[0]; - ap.alignFrame.setSelectedHMMSequence(hmm); + // TODO move this to Viewport + if (seq.isHMMConsensusSequence()) + { + ap.alignFrame.setSelectedHMMSequence(seq); + } } /** -- 1.7.10.2