JAL-2629 hmmalign can now be run from the sequence pop-up menu
authorTZVanaalten <TZVanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Sun, 13 Aug 2017 11:00:40 +0000 (12:00 +0100)
committerTZVanaalten <TZVanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Sun, 13 Aug 2017 11:00:40 +0000 (12:00 +0100)
src/jalview/gui/PopupMenu.java

index e75798c..fd652b2 100644 (file)
@@ -40,6 +40,7 @@ import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
 import jalview.gui.ColourMenuHelper.ColourChangeListener;
+import jalview.hmmer.HMMAlignThread;
 import jalview.hmmer.HMMBuildThread;
 import jalview.io.FileFormatI;
 import jalview.io.FileFormats;
@@ -371,6 +372,19 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
           }
         });
         add(selectHMM);
+
+        JMenuItem hmmAlign = new JCheckBoxMenuItem();
+        hmmAlign.setText(MessageManager.getString("label.hmmalign"));
+        hmmAlign.addActionListener(new ActionListener()
+        {
+
+          @Override
+          public void actionPerformed(ActionEvent e)
+          {
+            hmmAlign_actionPerformed(e);
+          }
+        });
+        add(hmmAlign);
       }
 
       if (ap.av.getSelectionGroup() != null
@@ -1284,6 +1298,13 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
     ap.av.setSelectedHMM(hmm);
   }
 
+  protected void hmmAlign_actionPerformed(ActionEvent e)
+  {
+    ap.av.setSelectedHMM(this.sequence.getHMM());
+    new Thread(new HMMAlignThread(ap.alignFrame, true)).start();
+    ap.repaint();
+  }
+
   /**
    * Constructs the entries for the colour menu
    */