From f0efe3029537bbbbe788e16eb85cb0af9c0fb81e Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 23 Jul 2018 11:28:58 +0100 Subject: [PATCH] JAL-3070 pushed down JABAWS specific args for WsJobParameters to Jws2Client --- src/jalview/gui/WsJobParameters.java | 273 +------------------------------- src/jalview/ws/jws2/Jws2Client.java | 5 +- test/jalview/ws/gui/Jws2ParamView.java | 4 +- 3 files changed, 12 insertions(+), 270 deletions(-) diff --git a/src/jalview/gui/WsJobParameters.java b/src/jalview/gui/WsJobParameters.java index 70e39b4..f2c4e96 100644 --- a/src/jalview/gui/WsJobParameters.java +++ b/src/jalview/gui/WsJobParameters.java @@ -23,9 +23,6 @@ package jalview.gui; import jalview.gui.OptsAndParamsPage.OptionBox; import jalview.gui.OptsAndParamsPage.ParamBox; import jalview.util.MessageManager; -import jalview.ws.jws2.JabaParamStore; -import jalview.ws.jws2.JabaPreset; -import jalview.ws.jws2.Jws2Discoverer; import jalview.ws.jws2.jabaws2.Jws2Instance; import jalview.ws.params.ArgumentI; import jalview.ws.params.OptionI; @@ -48,17 +45,13 @@ import java.awt.event.HierarchyBoundsListener; import java.awt.event.HierarchyEvent; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; -import java.awt.event.WindowEvent; -import java.awt.event.WindowListener; import java.util.Hashtable; -import java.util.Iterator; import java.util.List; import java.util.Vector; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JDialog; -import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; @@ -67,11 +60,6 @@ import javax.swing.border.TitledBorder; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; -import compbio.metadata.Argument; -import compbio.metadata.Option; -import compbio.metadata.Parameter; -import compbio.metadata.Preset; -import compbio.metadata.PresetManager; import net.miginfocom.swing.MigLayout; /** @@ -183,7 +171,7 @@ public class WsJobParameters extends JPanel implements ItemListener, * @param jobArgset */ public WsJobParameters(ParamDatastoreI paramStorei, Jws2Instance service, - WsParamSetI preset, List jobArgset) + WsParamSetI preset, List jobArgset) { super(); @@ -506,19 +494,11 @@ public class WsJobParameters extends JPanel implements ItemListener, } } - void initForService(WsParamSetI jabap, List jabajobArgset) + void initForService(WsParamSetI paramSet, List jobArgset) { - WsParamSetI p = null; - List jobArgset = null; settingDialog = true; - { // instantiate the abstract proxy for Jaba objects - jobArgset = jabajobArgset == null ? null - : JabaParamStore.getJwsArgsfromJaba(jabajobArgset); - p = jabap; // (jabap != null) ? paramStore.getPreset(jabap.getName()) : - // null; - } - init(p, jobArgset); + init(paramSet, jobArgset); } @@ -927,243 +907,6 @@ public class WsJobParameters extends JPanel implements ItemListener, revalidate(); } - /** - * testing method - grab a service and parameter set and show the window - * - * @param args - */ - public static void main(String[] args) - { - jalview.ws.jws2.Jws2Discoverer disc = jalview.ws.jws2.Jws2Discoverer - .getDiscoverer(); - int p = 0; - if (args.length > 0) - { - Vector services = new Vector<>(); - services.addElement(args[p++]); - Jws2Discoverer.getDiscoverer().setServiceUrls(services); - } - try - { - disc.run(); - } catch (Exception e) - { - System.err.println("Aborting. Problem discovering services."); - e.printStackTrace(); - return; - } - Jws2Instance lastserv = null; - for (Jws2Instance service : disc.getServices()) - { - lastserv = service; - if (p >= args.length || service.getName().equalsIgnoreCase(args[p])) - { - if (lastserv != null) - { - List prl = null; - Preset pr = null; - if (++p < args.length) - { - PresetManager prman = lastserv.getPresets(); - if (prman != null) - { - pr = prman.getPresetByName(args[p]); - if (pr == null) - { - // just grab the last preset. - prl = prman.getPresets(); - } - } - } - else - { - PresetManager prman = lastserv.getPresets(); - if (prman != null) - { - prl = prman.getPresets(); - } - } - Iterator en = (prl == null) ? null : prl.iterator(); - while (en != null && en.hasNext()) - { - if (en != null) - { - if (!en.hasNext()) - { - en = prl.iterator(); - } - pr = en.next(); - } - { - System.out.println("Testing opts dupes for " - + lastserv.getUri() + " : " + lastserv.getActionText() - + ":" + pr.getName()); - List