import jalview.ws.AWsJob;
import jalview.ws.WSClientI;
import jalview.ws.JobStateSummary;
+import jalview.ws.jws2.dm.JabaWsParamSet;
+import jalview.ws.params.WsParamSetI;
/**
* <p>
{
long lastChunk = 0;
- Preset preset = null;
+ WsParamSetI preset = null;
List<Argument> arguments = null;
return alignmentProgram;
}
+ public boolean hasArguments()
+ {
+ return (arguments != null && arguments.size() > 0)
+ || (preset != null && preset instanceof JabaWsParamSet);
+ }
+
+ public List<Argument> getJabaArguments()
+ {
+ List<Argument> newargs = new ArrayList<Argument>();
+ if (preset != null && preset instanceof JabaWsParamSet)
+ {
+ newargs.addAll(((JabaWsParamSet) preset).getjabaArguments());
+ }
+ if (arguments != null && arguments.size() > 0)
+ {
+ newargs.addAll(arguments);
+ }
+ return newargs;
+ }
+
+ /**
+ * add a progess header to status string containing presets/args used
+ */
+ public void addInitialStatus()
+ {
+ if (preset != null)
+ {
+ jobProgress.append("Using "
+ + (preset instanceof JabaPreset ? "Server" : "User")
+ + "Preset: " + preset.getName());
+ if (preset instanceof JabaWsParamSet)
+ {
+ for (Argument opt : ((JabaWsParamSet) preset).getjabaArguments())
+ {
+ jobProgress.append(opt.getName() + " " + opt.getDefaultValue()
+ + "\n");
+ }
+ }
+ }
+ if (arguments != null && arguments.size() > 0)
+ {
+ jobProgress.append("With custom parameters : \n");
+ // merge arguments with preset's own arguments.
+ for (Argument opt : arguments)
+ {
+ jobProgress.append(opt.getName() + " " + opt.getDefaultValue()
+ + "\n");
+ }
+ }
+ jobProgress.append("\nJob Output:\n");
+ }
+
+ public boolean isPresetJob()
+ {
+ return preset != null && preset instanceof JabaPreset;
+ }
+
+ public Preset getServerPreset()
+ {
+ return (isPresetJob()) ? ((JabaPreset) preset).p : null;
+ }
}
String alTitle; // name which will be used to form new alignment window.
* @param seqset
* Alignment
*/
- MsaWSThread(MsaWS server2, Preset preset, List<Argument> paramset,
+ MsaWSThread(MsaWS server2, WsParamSetI preset, List<Argument> paramset,
String wsUrl, WebserviceInfo wsinfo,
jalview.gui.AlignFrame alFrame, String wsname, String title,
AlignmentView _msa, boolean subgaps, boolean presorder,
}
try
{
- // TODO: get the parameters (if any) for this job and submit the job
- if (j.arguments != null && j.arguments.size() > 0)
+ j.addInitialStatus(); // list the presets/parameters used for the job in
+ // status
+ if (j.isPresetJob())
{
- StringBuffer pset = new StringBuffer();
- for (Argument arg : j.arguments)
- {
- pset.append(arg.getName() + " " + arg.getDefaultValue() + "\n");
- }
- j.setStatus("Custom Parameters:\n" + pset.toString()
- + "\nJob Output:\n");
- j.setJobId(server.customAlign(j.seqs, j.arguments));
+ j.setJobId(server.presetAlign(j.seqs, j.getServerPreset()));
}
- else if (j.preset != null)
+ else if (j.hasArguments())
{
- j.setJobId(server.presetAlign(j.seqs, j.preset));
+ j.setJobId(server.customAlign(j.seqs,j.getJabaArguments()));
}
else
{