X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fjws2%2FAAConsClient.java;h=d1bf303ff2d8d941123b5086d8c9d57043bb0750;hb=c25e91301b4e05d8941215d845f863c57a43fd61;hp=f6c3fcf5dcec7ff877ac1c67b908f7f32b248bdb;hpb=e573bf375782b0dbdfacee15f6477d9630a234ee;p=jalview.git diff --git a/src/jalview/ws/jws2/AAConsClient.java b/src/jalview/ws/jws2/AAConsClient.java index f6c3fcf..d1bf303 100644 --- a/src/jalview/ws/jws2/AAConsClient.java +++ b/src/jalview/ws/jws2/AAConsClient.java @@ -4,6 +4,8 @@ import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.datamodel.Annotation; import jalview.gui.AlignFrame; +import jalview.gui.AlignmentPanel; +import jalview.ws.jws2.dm.AAConsSettings; import jalview.ws.jws2.jabaws2.Jws2Instance; import jalview.ws.params.WsParamSetI; @@ -28,8 +30,18 @@ public class AAConsClient extends JabawsAlignCalcWorker nucleotidesAllowed = false; proteinAllowed = true; gapMap=new boolean[0]; + initViewportParams(); } + protected void initViewportParams() + { + ((jalview.gui.AlignViewport) alignViewport).setCalcIdSettingsFor(getCalcId(), new AAConsSettings(true, service, this.preset, (arguments!=null) ? JabaParamStore.getJwsArgsfromJaba(arguments) : null), true); + } + @Override + public void updateParameters(WsParamSetI newpreset, java.util.List newarguments) { + super.updateParameters(newpreset, newarguments); + initViewportParams(); + }; public String getServiceActionText() { return "calculating Amino acid consensus using AACons service"; @@ -42,11 +54,9 @@ public class AAConsClient extends JabawsAlignCalcWorker public void updateResultAnnotation(boolean immediate) { - if (immediate || !calcMan.isWorking(this) && scoremanager != null) { AlignmentAnnotation annotation; - ; Map> scoremap = scoremanager.asMap(); int alWidth = alignViewport.getAlignment().getWidth(); AlignmentI alignment; @@ -73,7 +83,10 @@ public class AAConsClient extends JabawsAlignCalcWorker else { // simple annotation row - annotation = alignViewport.getAlignment().findOrCreateAnnotation(scr.getMethod(), true, null, null); + annotation = alignViewport.getAlignment() + .findOrCreateAnnotation(scr.getMethod(), getCalcId(), true, + null, null); + Annotation[] elm = new Annotation[alWidth]; if (alWidth == gapMap.length) // scr.getScores().size()) { @@ -156,4 +169,20 @@ public class AAConsClient extends JabawsAlignCalcWorker } } + public String getCalcId() + { + return SequenceAnnotationWSClient.AAConsCalcId; + } + + public static void removeAAConsAnnotation(AlignmentPanel alignPanel) + { + for (AlignmentAnnotation aa: alignPanel.getAlignment().findAnnotation(SequenceAnnotationWSClient.AAConsCalcId)) + { + alignPanel.getAlignment().deleteAnnotation(aa); + } + // List + // ourannots=alignPanel.getAlignment().findAnnotation(Screen3D.) + // TODO Auto-generated method stub + + } }