From 2d552096087f757e4a3fcb4df97cf549b2ff8155 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 3 Aug 2018 15:15:02 +0100 Subject: [PATCH] =?utf8?q?JAL-3070=20MsaWSClient=20doens=E2=80=99t=20depend=20?= =?utf8?q?on=20Jws2Instance=20-=20now=20need=20to=20remove=20dependency=20on?= =?utf8?q?=20Jws2Client=20!?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/jalview/ws/jws2/MsaWSClient.java | 45 ++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/src/jalview/ws/jws2/MsaWSClient.java b/src/jalview/ws/jws2/MsaWSClient.java index a545d5d..7a3d9d3 100644 --- a/src/jalview/ws/jws2/MsaWSClient.java +++ b/src/jalview/ws/jws2/MsaWSClient.java @@ -27,7 +27,10 @@ import jalview.gui.Desktop; import jalview.gui.JvOptionPane; import jalview.gui.JvSwingUtils; import jalview.util.MessageManager; +import jalview.ws.WSMenuEntryProviderI; +import jalview.ws.api.JalviewServiceEndpointProviderI; import jalview.ws.api.MultipleSequenceAlignmentI; +import jalview.ws.api.ServiceWithParameters; import jalview.ws.gui.MsaWSThread; import jalview.ws.jws2.jabaws2.Jws2Instance; import jalview.ws.params.ArgumentI; @@ -44,12 +47,18 @@ import javax.swing.JMenuItem; import javax.swing.ToolTipManager; /** - * DOCUMENT ME! + * MsaWSClient * - * @author $author$ + * Instantiates web service menu items for multiple alignment services, and + * holds logic for constructing a web service thread. + * + * TODO remove dependency on Jws2Client methods for creating AACon service UI + * elements. + * + * @author Jim Procter et al * @version $Revision$ */ -public class MsaWSClient extends Jws2Client +public class MsaWSClient extends Jws2Client implements WSMenuEntryProviderI { /** * server is a proxy class implementing the core methods for submitting, @@ -58,7 +67,7 @@ public class MsaWSClient extends Jws2Client */ MultipleSequenceAlignmentI server; - public MsaWSClient(Jws2Instance sh, String altitle, + public MsaWSClient(ServiceWithParameters sh, String altitle, jalview.datamodel.AlignmentView msa, boolean submitGaps, boolean preserveOrder, AlignmentI seqdataset, AlignFrame _alignFrame) @@ -68,7 +77,8 @@ public class MsaWSClient extends Jws2Client // TODO Auto-generated constructor stub } - public MsaWSClient(Jws2Instance sh, WsParamSetI preset, String altitle, + public MsaWSClient(ServiceWithParameters sh, WsParamSetI preset, + String altitle, jalview.datamodel.AlignmentView msa, boolean submitGaps, boolean preserveOrder, AlignmentI seqdataset, AlignFrame _alignFrame) @@ -94,7 +104,7 @@ public class MsaWSClient extends Jws2Client * DOCUMENT ME! */ - public MsaWSClient(Jws2Instance sh, WsParamSetI preset, + public MsaWSClient(ServiceWithParameters sh, WsParamSetI preset, List arguments, boolean editParams, String altitle, jalview.datamodel.AlignmentView msa, boolean submitGaps, boolean preserveOrder, AlignmentI seqdataset, @@ -106,7 +116,9 @@ public class MsaWSClient extends Jws2Client return; } - if (!(sh.getEndpoint() instanceof MultipleSequenceAlignmentI)) + if (!(sh instanceof JalviewServiceEndpointProviderI + && ((JalviewServiceEndpointProviderI) sh) + .getEndpoint() instanceof MultipleSequenceAlignmentI)) { // redundant at mo - but may change JvOptionPane.showMessageDialog(Desktop.desktop, @@ -120,7 +132,8 @@ public class MsaWSClient extends Jws2Client return; } serviceHandle = sh; - server = (MultipleSequenceAlignmentI) sh.getEndpoint(); + server = (MultipleSequenceAlignmentI) ((JalviewServiceEndpointProviderI) sh) + .getEndpoint(); if ((wsInfo = setWebService(sh, false)) == null) { JvOptionPane.showMessageDialog(Desktop.desktop, MessageManager @@ -229,9 +242,20 @@ public class MsaWSClient extends Jws2Client // Alignment dependent analysis calculation WS gui return; } + serviceHandle = service; setWebService(service, true); // headless + attachWSMenuEntry(rmsawsmenu, alignFrame); + } + + @Override + public void attachWSMenuEntry(JMenu wsmenu, AlignFrame alignFrame) + { boolean finished = true, submitGaps = false; - JMenu msawsmenu = rmsawsmenu; + /** + * temp variables holding msa service submenu or root service menu + */ + JMenu msawsmenu = wsmenu; + JMenu rmsawsmenu = wsmenu; String svcname = WebServiceName; if (svcname.endsWith("WS")) { @@ -244,7 +268,8 @@ public class MsaWSClient extends Jws2Client rmsawsmenu.add(msawsmenu); calcName = ""; } - boolean hasparams = service.hasParameters(); + boolean hasparams = serviceHandle.hasParameters(); + ServiceWithParameters service = (ServiceWithParameters) serviceHandle; do { String action = "Align "; -- 1.7.10.2