X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fjws2%2FJabawsCalcWorker.java;h=fc362052c6f368bc1b6be975ac1f4153b52b7d77;hb=58d01bd17f04745e37f69f947a41432fb9e3ec15;hp=8515dbc83fc936a69765f70d87eba24414917860;hpb=b1ec3caa00df9beb437ca31647268158a79748c5;p=jalview.git
diff --git a/src/jalview/ws/jws2/JabawsCalcWorker.java b/src/jalview/ws/jws2/JabawsCalcWorker.java
index 8515dbc..fc36205 100644
--- a/src/jalview/ws/jws2/JabawsCalcWorker.java
+++ b/src/jalview/ws/jws2/JabawsCalcWorker.java
@@ -1,506 +1,131 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
package jalview.ws.jws2;
-import java.util.ArrayList;
-import java.util.HashMap;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.Annotation;
+import jalview.datamodel.SequenceI;
+import jalview.gui.AlignFrame;
+import jalview.util.MessageManager;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.WsParamSetI;
+
import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import compbio.data.msa.SequenceAnnotation;
-import compbio.data.sequence.FastaSequence;
import compbio.data.sequence.Score;
import compbio.data.sequence.ScoreManager;
import compbio.metadata.Argument;
import compbio.metadata.ChunkHolder;
import compbio.metadata.JobStatus;
import compbio.metadata.JobSubmissionException;
-import compbio.metadata.Option;
import compbio.metadata.ResultNotAvailableException;
import compbio.metadata.WrongParameterException;
-import jalview.analysis.AlignSeq;
-import jalview.analysis.SeqsetUtils;
-import jalview.api.AlignViewportI;
-import jalview.api.AlignmentViewPanel;
-import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.AnnotatedCollectionI;
-import jalview.datamodel.Annotation;
-import jalview.datamodel.SequenceI;
-import jalview.gui.AlignFrame;
-import jalview.gui.IProgressIndicator;
-import jalview.workers.AlignCalcWorker;
-import jalview.ws.jws2.dm.JabaWsParamSet;
-import jalview.ws.jws2.jabaws2.Jws2Instance;
-import jalview.ws.params.WsParamSetI;
-public abstract class JabawsCalcWorker extends AlignCalcWorker
+public abstract class JabawsCalcWorker extends AbstractJabaCalcWorker
{
- protected Jws2Instance service;
@SuppressWarnings("unchecked")
protected SequenceAnnotation aaservice;
- protected ScoreManager scoremanager;
- protected WsParamSetI preset;
- protected List arguments;
- protected IProgressIndicator guiProgress;
- public JabawsCalcWorker(AlignViewportI alignViewport,
- AlignmentViewPanel alignPanel)
- {
- super(alignViewport, alignPanel);
- }
+ protected ScoreManager scoremanager;
public JabawsCalcWorker(Jws2Instance service, AlignFrame alignFrame,
WsParamSetI preset, List paramset)
{
- this(alignFrame.getCurrentView(), alignFrame.alignPanel);
- this.guiProgress = alignFrame;
- this.preset = preset;
- this.arguments = paramset;
- this.service = service;
+ super(service, alignFrame, preset, paramset);
aaservice = (SequenceAnnotation) service.service;
-
}
- public WsParamSetI getPreset()
+ @Override
+ ChunkHolder pullExecStatistics(String rslt, long rpos)
{
- return preset;
+ return aaservice.pullExecStatistics(rslt, rpos);
}
- public List getArguments()
+ @Override
+ boolean collectAnnotationResultsFor(String rslt)
+ throws ResultNotAvailableException
{
- return arguments;
+ scoremanager = aaservice.getAnnotation(rslt);
+ if (scoremanager != null)
+ {
+ return true;
+ }
+ return false;
}
- /**
- * reconfigure and restart the AAConClient. This method will spawn a new
- * thread that will wait until any current jobs are finished, modify the
- * parameters and restart the conservation calculation with the new values.
- *
- * @param newpreset
- * @param newarguments
- */
- public void updateParameters(final WsParamSetI newpreset, final List newarguments)
+ @Override
+ boolean cancelJob(String rslt) throws Exception
{
- preset = newpreset;
- arguments = newarguments;
- calcMan.startWorker(this);
+ return aaservice.cancelJob(rslt);
}
- public List