From 2aa69a7cbf3d401b0c4cbff140ad5e3b316634b5 Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 5 Jan 2011 16:05:47 +0000 Subject: [PATCH] ensure group props are recalculated before alignment displayed --- src/jalview/ws/rest/RestJobThread.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/jalview/ws/rest/RestJobThread.java b/src/jalview/ws/rest/RestJobThread.java index 581af9a..39f26ae 100644 --- a/src/jalview/ws/rest/RestJobThread.java +++ b/src/jalview/ws/rest/RestJobThread.java @@ -11,6 +11,7 @@ import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; import jalview.gui.Desktop; +import jalview.gui.PaintRefresher; import jalview.gui.WebserviceInfo; import jalview.io.NewickFile; import jalview.io.packed.JalviewDataset; @@ -50,7 +51,7 @@ public class RestJobThread extends AWSThread SUBMIT, POLL } - protected RestClient restClient;; + protected RestClient restClient; public RestJobThread(RestClient restClient) { @@ -786,7 +787,6 @@ public class RestJobThread extends AWSThread if (sg.getName() != null) { exsg = groupNames.get(sg.getName()); - recovered = true; } if (exsg == null) { @@ -795,6 +795,8 @@ public class RestJobThread extends AWSThread visgrps.add(exsg); exsg.setStartRes(sg.getStartRes() + contigs[ncnt]); exsg.setEndRes(sg.getEndRes() + contigs[ncnt]); + } else { + recovered = true; } // now replace any references from the result set with // corresponding refs from alignment input set. @@ -923,6 +925,13 @@ public class RestJobThread extends AWSThread visan.sequenceRef = sqass; visAlAn.add(visan); } + if (contigs[ncnt]+alan[nrj][an].annotations.length>visan.annotations.length) + { + // increase width of annotation row + Annotation[] newannv = new Annotation[contigs[ncnt]+alan[nrj][an].annotations.length]; + System.arraycopy(visan.annotations, 0, newannv, 0, visan.annotations.length); + visan.annotations=newannv; + } // now copy local annotation data into correct position System.arraycopy(alan[nrj][an].annotations, 0, visan.annotations, contigs[ncnt], @@ -985,6 +994,7 @@ public class RestJobThread extends AWSThread destcs = destColsel.get(als); destaf = new AlignFrame(destal, destcs, AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); + PaintRefresher.Refresh(destaf, destaf.getViewport().getSequenceSetId()); // todo transfer any feature settings and colouring /* * destaf.getFeatureRenderer().transferSettings(this.featureSettings); -- 1.7.10.2