From 43664b003de849eaed85cb18bd67c71c4b74bb52 Mon Sep 17 00:00:00 2001 From: tzvanaalten Date: Wed, 23 Aug 2017 15:39:03 +0100 Subject: [PATCH] JAL-2629 selected HMM is now a sequence, not a HMM --- src/jalview/gui/AlignFrame.java | 33 ++++++++++++++++++++------------- src/jalview/gui/PopupMenu.java | 7 +++---- src/jalview/io/FileLoader.java | 2 +- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 99124f8..abecd10 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -181,7 +181,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /* * The selected HMM for this align frame */ - HiddenMarkovModel selectedHMM = null; + SequenceI selectedHMMSequence; List alignPanels = new ArrayList<>(); @@ -1054,13 +1054,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } @Override - public void autoAlignSeqs_actionPerformed(boolean autoAlignSeqs) - { - autoAlignNewSequences = autoAlignSeqs; - alignPanel.repaint(); - } - - @Override public void hmmSearch_actionPerformed(ActionEvent e) { alignPanel.repaint(); @@ -5698,7 +5691,21 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, */ public HiddenMarkovModel getSelectedHMM() { - return selectedHMM; + if (selectedHMMSequence == null) + { + return null; + } + return selectedHMMSequence.getHMM(); + } + + /** + * Returns the selected hidden Markov model. + * + * @return + */ + public SequenceI getSelectedHMMSequence() + { + return selectedHMMSequence; } /** @@ -5706,13 +5713,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, * * @param selectedHMM */ - public void setSelectedHMM(HiddenMarkovModel selectedHMM) + public void setSelectedHMMSequence(SequenceI selectedHMM) { - this.selectedHMM = selectedHMM; + this.selectedHMMSequence = selectedHMM; hmmAlign.setText(MessageManager.getString("label.hmmalign") + " to " - + selectedHMM.getName() + "_HMM"); + + selectedHMM.getHMM().getName() + "_HMM"); hmmSearch.setText(MessageManager.getString("label.hmmsearch") + " with " - + selectedHMM.getName() + "_HMM"); + + selectedHMM.getHMM().getName() + "_HMM"); } @Override diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index 6ad1dd2..97ce501 100644 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -33,7 +33,6 @@ import jalview.datamodel.AlignmentI; import jalview.datamodel.Annotation; import jalview.datamodel.DBRefEntry; import jalview.datamodel.HiddenColumns; -import jalview.datamodel.HiddenMarkovModel; import jalview.datamodel.PDBEntry; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceFeature; @@ -1295,13 +1294,13 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener protected void selectHMM_actionPerformed(ActionEvent e) { - HiddenMarkovModel hmm = ap.av.getSequenceSelection()[0].getHMM(); - ap.alignFrame.setSelectedHMM(hmm); + SequenceI hmm = ap.av.getSequenceSelection()[0]; + ap.alignFrame.setSelectedHMMSequence(hmm); } protected void hmmAlign_actionPerformed(ActionEvent e) { - ap.alignFrame.setSelectedHMM(this.sequence.getHMM()); + ap.alignFrame.setSelectedHMMSequence(this.sequence); new Thread(new HMMAlignThread(ap.alignFrame, true)).start(); ap.repaint(); } diff --git a/src/jalview/io/FileLoader.java b/src/jalview/io/FileLoader.java index 977cc12..b07e125 100755 --- a/src/jalview/io/FileLoader.java +++ b/src/jalview/io/FileLoader.java @@ -455,7 +455,7 @@ public class FileLoader implements Runnable .getSelectedHMM() == null) { viewport.getAlignPanel().alignFrame - .setSelectedHMM(seq.getHMM()); + .setSelectedHMMSequence(seq); } } -- 1.7.10.2