From: gmungoc Date: Fri, 30 Mar 2018 09:35:51 +0000 (+0100) Subject: JAL-2629 select HMM selects sequence under cursor X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=af7becd656cba3835394e2dc50c2ad8d189a6d46;p=jalview.git JAL-2629 select HMM selects sequence under cursor --- 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); + } } /**