import jalview.gui.IProgressIndicator;
import jalview.gui.IProgressIndicatorHandler;
import jalview.gui.JvOptionPane;
+import jalview.gui.WebserviceInfo;
import jalview.schemes.FeatureSettingsAdapter;
import jalview.schemes.ResidueProperties;
import jalview.util.MapList;
import jalview.util.MessageManager;
import jalview.workers.AlignCalcWorker;
+import jalview.ws.JobStateSummary;
import jalview.ws.api.CancellableI;
import jalview.ws.api.JalviewServiceEndpointProviderI;
import jalview.ws.api.JobId;
final boolean cancellable = CancellableI.class
.isAssignableFrom(annotService.getClass());
StringBuffer msg = new StringBuffer();
+ JobStateSummary job = new JobStateSummary();
+ WebserviceInfo info = new WebserviceInfo("foo", "bar", false);
try
{
if (checkDone())
running.setSeqNames(seqNames);
running.setStartPos(start);
running.setSeqs(seqs);
-
+ job.updateJobPanelState(info, "", running);
if (guiProgress != null)
{
guiProgress.registerHandler(progressId,
{
Cache.log.debug("Updating status for annotation service.");
annotService.updateStatus(running);
-
- if (running.isFinished())
+ job.updateJobPanelState(info, "", running);
+ if (running.isSubjobComplete())
{
- Cache.log.debug("Analysis service job reported finished.");
+ Cache.log.debug(
+ "Finished polling analysis service job: status reported is "
+ + running.getState());
finished = true;
}
else
}
} while (!finished);
+ Cache.log.debug("Job poll loop exited. Job is " + running.getState());
// TODO: need to poll/retry
if (serverErrorsLeft > 0)
{
{
}
}
- // configure job with the associated view's feature renderer, if one
- // exists.
- // TODO: here one would also grab the 'master feature renderer' in order
- // to enable/disable
- // features automatically according to user preferences
- running.setFeatureRenderer(
- ((jalview.gui.AlignmentPanel) ap).cloneFeatureRenderer());
- Cache.log.debug("retrieving job results.");
- final Map<String, FeatureColourI> featureColours = new HashMap<>();
- final Map<String, FeatureMatcherSetI> featureFilters = new HashMap<>();
- List<AlignmentAnnotation> returnedAnnot = annotService
- .getAnnotationResult(running.getJobHandle(), seqs,
- featureColours, featureFilters);
-
- Cache.log.debug("Obtained " + (returnedAnnot == null ? "no rows"
- : ("" + returnedAnnot.size())));
- Cache.log.debug("There were " + featureColours.size()
- + " feature colours and " + featureFilters.size()
- + " filters defined.");
-
- // TODO
- // copy over each annotation row reurned and also defined on each
- // sequence, excluding regions not annotated due to gapMap/column
- // visibility
-
- running.setAnnotation(returnedAnnot);
-
- if (running.hasResults())
+ if (running.isFinished())
{
- jalview.bin.Cache.log.debug("Updating result annotation from Job "
- + rslt + " at " + service.getUri());
- updateResultAnnotation(true);
- if (running.isTransferSequenceFeatures())
+ // expect there to be results to collect
+ // configure job with the associated view's feature renderer, if one
+ // exists.
+ // TODO: here one would also grab the 'master feature renderer' in order
+ // to enable/disable
+ // features automatically according to user preferences
+ running.setFeatureRenderer(
+ ((jalview.gui.AlignmentPanel) ap).cloneFeatureRenderer());
+ Cache.log.debug("retrieving job results.");
+ final Map<String, FeatureColourI> featureColours = new HashMap<>();
+ final Map<String, FeatureMatcherSetI> featureFilters = new HashMap<>();
+ List<AlignmentAnnotation> returnedAnnot = annotService
+ .getAnnotationResult(running.getJobHandle(), seqs,
+ featureColours, featureFilters);
+
+ Cache.log.debug("Obtained " + (returnedAnnot == null ? "no rows"
+ : ("" + returnedAnnot.size())));
+ Cache.log.debug("There were " + featureColours.size()
+ + " feature colours and " + featureFilters.size()
+ + " filters defined.");
+
+ // TODO
+ // copy over each annotation row reurned and also defined on each
+ // sequence, excluding regions not annotated due to gapMap/column
+ // visibility
+
+ running.setAnnotation(returnedAnnot);
+
+ if (running.hasResults())
{
- // TODO
- // look at each sequence and lift over any features, excluding regions
- // not annotated due to gapMap/column visibility
-
- jalview.bin.Cache.log.debug(
- "Updating feature display settings and transferring features from Job "
- + rslt + " at " + service.getUri());
- // TODO: consider merge rather than apply here
- alignViewport.applyFeaturesStyle(new FeatureSettingsAdapter()
+ jalview.bin.Cache.log.debug("Updating result annotation from Job "
+ + rslt + " at " + service.getUri());
+ updateResultAnnotation(true);
+ if (running.isTransferSequenceFeatures())
{
- @Override
- public FeatureColourI getFeatureColour(String type)
+ // TODO
+ // look at each sequence and lift over any features, excluding
+ // regions
+ // not annotated due to gapMap/column visibility
+
+ jalview.bin.Cache.log.debug(
+ "Updating feature display settings and transferring features from Job "
+ + rslt + " at " + service.getUri());
+ // TODO: consider merge rather than apply here
+ alignViewport.applyFeaturesStyle(new FeatureSettingsAdapter()
{
- return featureColours.get(type);
- }
+ @Override
+ public FeatureColourI getFeatureColour(String type)
+ {
+ return featureColours.get(type);
+ }
- @Override
- public FeatureMatcherSetI getFeatureFilters(String type)
- {
- return featureFilters.get(type);
- }
+ @Override
+ public FeatureMatcherSetI getFeatureFilters(String type)
+ {
+ return featureFilters.get(type);
+ }
- @Override
- public boolean isFeatureDisplayed(String type)
- {
- return featureColours.containsKey(type);
- }
+ @Override
+ public boolean isFeatureDisplayed(String type)
+ {
+ return featureColours.containsKey(type);
+ }
- });
- // TODO: JAL-1150 - create sequence feature settings API for defining
- // styles and enabling/disabling feature overlay on alignment panel
+ });
+ // TODO: JAL-1150 - create sequence feature settings API for
+ // defining
+ // styles and enabling/disabling feature overlay on alignment panel
- if (alignFrame.alignPanel == ap)
- {
- alignViewport.setShowSequenceFeatures(true);
- alignFrame.setMenusForViewport();
+ if (alignFrame.alignPanel == ap)
+ {
+ alignViewport.setShowSequenceFeatures(true);
+ alignFrame.setMenusForViewport();
+ }
}
+ ap.adjustAnnotationHeight();
}
- ap.adjustAnnotationHeight();
}
Cache.log.debug("Annotation Service Worker thread finished.");
}