+ protected AlignFrame alignFrame;
+
+ protected WsParamSetI preset;
+
+ protected List<Argument> paramset;
+
+ public Jws2Client(AlignFrame _alignFrame, WsParamSetI preset,
+ List<Argument> arguments)
+ {
+ alignFrame = _alignFrame;
+ this.preset = preset;
+ if (preset != null)
+ {
+ if (!((preset instanceof JabaPreset) || preset instanceof JabaWsParamSet))
+ {
+ /*
+ * { this.preset = ((JabaPreset) preset).p; } else if (preset instanceof
+ * JabaWsParamSet) { List<Argument> newargs = new ArrayList<Argument>();
+ * JabaWsParamSet pset = ((JabaWsParamSet) preset); for (Option opt :
+ * pset.getjabaArguments()) { newargs.add(opt); } if (arguments != null
+ * && arguments.size() > 0) { // merge arguments with preset's own
+ * arguments. for (Argument opt : arguments) { newargs.add(opt); } }
+ * paramset = newargs; } else {
+ */
+ throw new Error(
+ "Implementation error: Can only instantiate Jaba parameter sets.");
+ }
+ }
+ else
+ {
+ // just provided with a bunch of arguments
+ this.paramset = arguments;
+ }
+ }
+
+ boolean processParams(Jws2Instance sh, boolean editParams)
+ {
+ return processParams(sh, editParams, false);
+ }
+
+ protected boolean processParams(Jws2Instance sh, boolean editParams,
+ boolean adjustingExisting)
+ {
+
+ if (editParams)
+ {
+ if (sh.paramStore == null)
+ {
+ sh.paramStore = new JabaParamStore(sh,
+ Desktop.getUserParameterStore());
+ }
+ WsJobParameters jobParams = (preset == null && paramset != null && paramset
+ .size() > 0) ? new WsJobParameters(null, sh, null, paramset)
+ : new WsJobParameters(sh, preset);
+ if (adjustingExisting)
+ {
+ jobParams.setName(MessageManager.getString("label.adjusting_parameters_for_calculation"));
+ }
+ if (!jobParams.showRunDialog())
+ {
+ return false;
+ }
+ WsParamSetI prset = jobParams.getPreset();
+ if (prset == null)
+ {
+ paramset = jobParams.isServiceDefaults() ? null : JabaParamStore
+ .getJabafromJwsArgs(jobParams.getJobParams());
+ this.preset = null;
+ }
+ else
+ {
+ this.preset = prset; // ((JabaPreset) prset).p;
+ paramset = null; // no user supplied parameters.
+ }
+ }
+ return true;
+
+ }
+
+ public Jws2Client()
+ {
+ // anonymous constructor - used for headless method calls only
+ }
+