From: Jim Procter Date: Fri, 2 Jun 2017 13:11:30 +0000 (+0100) Subject: JAL-2228 always set minimum for count to zero for annotation row X-Git-Tag: Release_2_10_2~3^2~43^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7ff8c3bd7a91e45a889765d7e2985bab04ff21a8;p=jalview.git JAL-2228 always set minimum for count to zero for annotation row --- diff --git a/src/jalview/workers/ColumnCounterSetWorker.java b/src/jalview/workers/ColumnCounterSetWorker.java index 6c5707d..8a1c8ec 100644 --- a/src/jalview/workers/ColumnCounterSetWorker.java +++ b/src/jalview/workers/ColumnCounterSetWorker.java @@ -182,8 +182,9 @@ class ColumnCounterSetWorker extends AlignCalcWorker for (int anrow = 0; anrow < rows; anrow++) { Annotation[] anns = new Annotation[width]; + long rmax = 0; /* - * add non-zero counts as annotations + * add counts as annotations. zeros are needed since select-by-annotation ignores empty annotation positions */ for (int i = 0; i < counts.length; i++) { @@ -195,6 +196,7 @@ class ColumnCounterSetWorker extends AlignCalcWorker String str = String.valueOf(count); anns[i] = new Annotation(str, str, '0', count, color); } + rmax = Long.max(count, rmax); } /* @@ -212,7 +214,8 @@ class ColumnCounterSetWorker extends AlignCalcWorker ann.scaleColLabel = true; ann.graph = AlignmentAnnotation.BAR_GRAPH; ann.annotations = anns; - setGraphMinMax(ann, anns); + ann.graphMin = 0f; // minimum always zero count + ann.graphMax = rmax; // maximum count from loop over feature columns ann.validateRangeAndDisplay(); if (!ourAnnots.contains(ann)) {