X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2FJPredClient.java;h=e14816cf26ba77f76b5af84ac3fc3f621336f91d;hb=08bde8d252a69d4d6a3b2497f759bd5d6f154a3f;hp=80ed9594ece12068eb5d67e5425190af656b4376;hpb=ab9e5bf849afd2f41102db0bf9893de1df0512f6;p=jalview.git diff --git a/src/jalview/ws/JPredClient.java b/src/jalview/ws/JPredClient.java index 80ed959..e14816c 100755 --- a/src/jalview/ws/JPredClient.java +++ b/src/jalview/ws/JPredClient.java @@ -18,6 +18,8 @@ */ package jalview.ws; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.util.*; import javax.swing.*; @@ -217,6 +219,13 @@ public class JPredClient startJPredClient(title, seq, null); } + public JPredClient() + { + + super(); + // add a class reference to the list + } + private void startJPredClient(String title, SequenceI[] msf, AlignFrame parentFrame) { @@ -328,4 +337,32 @@ public class JPredClient return server; } + + public void attachWSMenuEntry(JMenu wsmenu, final ServiceHandle sh, final AlignFrame af) + { + final JMenuItem method = new JMenuItem(sh.getName()); + method.setToolTipText(sh.getEndpointURL()); + method.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + AlignmentView msa = af.gatherSeqOrMsaForSecStrPrediction(); + if (msa.getSequences().length == 1) + { + // Single Sequence prediction + new jalview.ws.JPredClient(sh, af.getTitle(), false, msa, af, true); + } + else + { + if (msa.getSequences().length > 1) + { + // Sequence profile based prediction + new jalview.ws.JPredClient(sh, + af.getTitle(), true, msa, af, true); + } + } + } + }); + wsmenu.add(method); + } }