From: Jim Procter Date: Thu, 26 Jul 2018 16:06:12 +0000 (+0100) Subject: JAL-3070 abstract class for services with adjustable parameters X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1da7e0f4efb175c55ded1b68e14bc4a9f955ec29;p=jalview.git JAL-3070 abstract class for services with adjustable parameters --- diff --git a/src/jalview/ws/api/ServiceWithParameters.java b/src/jalview/ws/api/ServiceWithParameters.java new file mode 100644 index 0000000..cf82708 --- /dev/null +++ b/src/jalview/ws/api/ServiceWithParameters.java @@ -0,0 +1,16 @@ +package jalview.ws.api; + +import jalview.ws.params.ParamManager; + +public abstract class ServiceWithParameters extends UIinfo +{ + + public ServiceWithParameters(String serviceType, String action, + String name, String description, String hosturl) + { + super(serviceType, action, name, description, hosturl); + } + + public abstract void initParamStore(ParamManager userParameterStore); + +} diff --git a/src/jalview/ws/jws2/jabaws2/Jws2Instance.java b/src/jalview/ws/jws2/jabaws2/Jws2Instance.java index 85ac238..3bff20b 100644 --- a/src/jalview/ws/jws2/jabaws2/Jws2Instance.java +++ b/src/jalview/ws/jws2/jabaws2/Jws2Instance.java @@ -23,11 +23,12 @@ package jalview.ws.jws2.jabaws2; import jalview.gui.AlignFrame; import jalview.gui.Desktop; import jalview.util.MessageManager; -import jalview.ws.api.UIinfo; +import jalview.ws.api.ServiceWithParameters; import jalview.ws.jws2.JabaParamStore; import jalview.ws.jws2.MsaWSClient; import jalview.ws.jws2.SequenceAnnotationWSClient; import jalview.ws.params.ParamDatastoreI; +import jalview.ws.params.ParamManager; import java.io.Closeable; @@ -39,7 +40,7 @@ import compbio.data.msa.SequenceAnnotation; import compbio.metadata.PresetManager; import compbio.metadata.RunnerConfig; -public class Jws2Instance extends UIinfo +public class Jws2Instance extends ServiceWithParameters { public JABAService service; @@ -149,6 +150,7 @@ public class Jws2Instance extends UIinfo super.finalize(); } + @Override public ParamDatastoreI getParamStore() { if (paramStore == null) @@ -222,4 +224,19 @@ public class Jws2Instance extends UIinfo { return aaui; } + + /** + * initialise a parameter store for this service + * + * @param userParameterStore + * - the user ParamManager (e.g. Desktop.getUserParameterStore() ) + */ + @Override + public void initParamStore(ParamManager userParameterStore) + { + if (paramStore == null) + { + paramStore = new JabaParamStore(this, userParameterStore); + } + } }