/* * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9) * Copyright (C) 2015 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 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.SequenceI; import jalview.gui.AlignFrame; import jalview.gui.IProgressIndicator; import jalview.workers.AlignCalcWorker; import jalview.ws.jws2.dm.AAConSettings; import jalview.ws.jws2.dm.JabaWsParamSet; import jalview.ws.jws2.jabaws2.Jws2Instance; import jalview.ws.params.WsParamSetI; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import compbio.data.sequence.FastaSequence; import compbio.metadata.Argument; import compbio.metadata.ChunkHolder; import compbio.metadata.JobStatus; import compbio.metadata.JobSubmissionException; import compbio.metadata.Option; import compbio.metadata.ResultNotAvailableException; public abstract class AbstractJabaCalcWorker extends AlignCalcWorker { protected Jws2Instance service; protected WsParamSetI preset; protected List arguments; protected IProgressIndicator guiProgress; protected boolean submitGaps = true; /** * Recover any existing parameters for this service */ protected void initViewportParams() { if (getCalcId() != null) { ((jalview.gui.AlignViewport) alignViewport).setCalcIdSettingsFor( getCalcId(), new AAConSettings(true, service, this.preset, (arguments != null) ? JabaParamStore .getJwsArgsfromJaba(arguments) : null), true); } } /** * * @return null or a string used to recover all annotation generated by this * worker */ public abstract String getCalcId(); public WsParamSetI getPreset() { return preset; } public List getArguments() { return arguments; } /** * 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) { preset = newpreset; arguments = newarguments; calcMan.startWorker(this); initViewportParams(); } public List