X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fworkers%2FAnnotationWorker.java;h=b812c655048bd65fad36f940c31a517a840051dd;hb=3459a8a691cb22508d7067f240b7254e588e77d3;hp=8569039f6323219a2c0d480ea63a0c56706643cf;hpb=f4766a7bbcfae845fc95923b01fa14ff83d589ff;p=jalview.git diff --git a/src/jalview/workers/AnnotationWorker.java b/src/jalview/workers/AnnotationWorker.java index 8569039..b812c65 100644 --- a/src/jalview/workers/AnnotationWorker.java +++ b/src/jalview/workers/AnnotationWorker.java @@ -51,7 +51,7 @@ class AnnotationWorker extends AlignCalcWorker AnnotationProviderI counter) { super(viewport, panel); - ourAnnots = new ArrayList(); + ourAnnots = new ArrayList<>(); this.counter = counter; calcMan.registerWorker(this); } @@ -90,7 +90,12 @@ class AnnotationWorker extends AlignCalcWorker for (AlignmentAnnotation ann : anns) { AlignmentAnnotation theAnn = alignment.findOrCreateAnnotation( - ann.label, ann.description, false, null, null); + ann.label, ann.getCalcId(), ann.autoCalculated, + ann.sequenceRef, + ann.groupRef); + if (ann.description!=null) { + theAnn.description = ann.description; + } theAnn.showAllColLabels = true; theAnn.graph = AlignmentAnnotation.BAR_GRAPH; theAnn.scaleColLabel = true; @@ -121,7 +126,10 @@ class AnnotationWorker extends AlignCalcWorker if (ap != null) { ap.adjustAnnotationHeight(); - ap.paintAlignment(true); + // TODO: only need to update colour and geometry if panel height changes + // and view is coloured by annotation, and the annotation is actually + // changed! + ap.paintAlignment(true, true); } }