import jalview.workers.AlignCalcWorker;
import jalview.ws.api.CancellableI;
import jalview.ws.api.JobId;
+import jalview.ws.api.SequenceAnnotationServiceI;
import jalview.ws.api.WSAnnotationCalcManagerI;
import jalview.ws.gui.AnnotationWsJob;
import jalview.ws.jws2.dm.AAConSettings;
}
}
+ public SequenceAnnotationServiceI getService()
+ {
+ return annotService;
+ }
+
}
{
aaConEnabled.setEnabled(false);
modifyParams.setEnabled(false);
+ return;
}
List<AlignCalcWorkerI> aaconClient = alignFrame.getViewport()
- .getCalcManager()
- .getRegisteredWorkersOfClass(aaui.getClient());
- if (aaconClient != null && aaconClient.size() > 0)
- {
- aaConEnabled.setSelected(true);
- }
- else
+ .getCalcManager().getRegisteredWorkersOfClass(
+ AbstractJabaCalcWorker.class);
+
+ boolean serviceEnabled = false;
+ if (aaconClient != null)
{
- aaConEnabled.setSelected(false);
+ for (AlignCalcWorkerI _worker : aaconClient)
+ {
+ AbstractJabaCalcWorker worker = (AbstractJabaCalcWorker) _worker;
+ // this could be cleaner ?
+ if (worker.hasService()
+ && aaui.getClient()
+ .equals(worker.getService().getClass()))
+ {
+ serviceEnabled = true;
+ }
+ }
}
+ aaConEnabled.setSelected(serviceEnabled);
}
@Override