}
@Override
+ public String getCalcName()
+ {
+ return action.getWebService().getName();
+ }
+
+ @Override
public void updateAnnotation()
{
if (currentTask != null)
currentTask.removeTaskEventListener(listener);
}
+
+ @Override
+ public String toString()
+ {
+ return "AlignCalcWorkerAdapter for " + getCalcName();
+ }
}
if (action instanceof AnnotationAction)
{
var calcManager = viewport.getCalcManager();
- var oldWorkers = calcManager.getWorkersOfClass(AlignCalcWorkerAdapter.class);
- for (var worker : oldWorkers)
- {
- calcManager.cancelWorker(worker);
- calcManager.removeWorker(worker);
- }
var _action = (AnnotationAction) action;
var worker = new AlignCalcWorkerAdapter(viewport, frame.alignPanel,
_action, args, credentials);
var handler = new AnnotationServiceGuiHandler(_action, frame);
worker.addTaskEventListener(handler);
+ for (var w : calcManager.getWorkers())
+ {
+ if (worker.getCalcName() != null && worker.getCalcName().equals(w.getCalcName()))
+ {
+ calcManager.cancelWorker(w);
+ calcManager.removeWorker(w);
+ }
+ }
if (action.getWebService().isInteractive())
calcManager.registerWorker(worker);
else