From: jprocter Date: Mon, 7 Nov 2011 13:11:54 +0000 (+0000) Subject: (JAL-974,JAL-975) refactor common code for a JABAWS sequence annotation client to... X-Git-Tag: Jalview_2_9~559^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f11c195585d2c4b6671b6e349fc152b8eb1fbc50;p=jalview.git (JAL-974,JAL-975) refactor common code for a JABAWS sequence annotation client to base JabawsAlignCalcWorker --- diff --git a/src/jalview/ws/jws2/AAConsClient.java b/src/jalview/ws/jws2/AAConsClient.java index a720593..289d49b 100644 --- a/src/jalview/ws/jws2/AAConsClient.java +++ b/src/jalview/ws/jws2/AAConsClient.java @@ -1,18 +1,9 @@ package jalview.ws.jws2; - -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.Annotation; -import jalview.datamodel.SequenceGroup; -import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; -import jalview.workers.AlignCalcWorker; -import jalview.ws.jws2.dm.JabaWsParamSet; import jalview.ws.jws2.jabaws2.Jws2Instance; import jalview.ws.params.WsParamSetI; @@ -22,335 +13,32 @@ import java.util.List; import java.util.Map; import java.util.TreeSet; -import compbio.data.msa.SequenceAnnotation; 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; -public class AAConsClient extends AlignCalcWorker +public class AAConsClient extends JabawsAlignCalcWorker { - public AAConsClient(AlignViewportI alignViewport, - AlignmentViewPanel alignPanel) - { - super(alignViewport, alignPanel); - } - - @SuppressWarnings("unchecked") - SequenceAnnotation aaservice; - - private ScoreManager scoremanager; - - private WsParamSetI preset; - - private List arguments; - - public WsParamSetI getPreset() - { - return preset; - } - public List getArguments() - { - return arguments; - } - /** - * reconfigure and restart the AAConsClient. 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) - { - if (calcMan.isWorking(this)) - { - new Thread(new Runnable() { - @Override - public void run() - { - - try {Thread.sleep(200); - } catch (InterruptedException x) {}; - updateParameters(newpreset, newarguments); - } - } - ).start(); - } else { - preset=newpreset; - arguments=newarguments; - calcMan.startWorker(this); - } - } - - public AAConsClient(Jws2Instance service, AlignFrame alignFrame, WsParamSetI preset, List paramset) { - this(alignFrame.getCurrentView(), alignFrame.alignPanel); - this.preset = preset; - this.arguments = paramset; - aaservice = (SequenceAnnotation) service.service; - + super(service, alignFrame, preset, paramset); + submitGaps=true; + alignedSeqs=true; + nucleotidesAllowed=false; + proteinAllowed=true; } - public List