From: tzvanaalten Date: Wed, 23 Aug 2017 14:39:03 +0000 (+0100) Subject: JAL-2629 selected HMM is now a sequence, not a HMM X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=43664b003de849eaed85cb18bd67c71c4b74bb52;p=jalview.git JAL-2629 selected HMM is now a sequence, not a HMM --- 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); } }