From 3a261a3e4451bb5c04af9e6f7da496951a569a18 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 3 Nov 2014 13:02:39 +0000 Subject: [PATCH] fix for JAL-1579 create threshold object for annotation rows that match shading pattern but do not have threshold objects as yet (nb - side effect is that cancel leaves old threshold lines on these annotation) --- src/jalview/gui/AnnotationColourChooser.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/jalview/gui/AnnotationColourChooser.java b/src/jalview/gui/AnnotationColourChooser.java index 3c552a4..b8996b6 100644 --- a/src/jalview/gui/AnnotationColourChooser.java +++ b/src/jalview/gui/AnnotationColourChooser.java @@ -22,6 +22,7 @@ package jalview.gui; import jalview.bin.Cache; import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.GraphLine; import jalview.datamodel.SequenceGroup; import jalview.schemes.AnnotationColourGradient; import jalview.schemes.ColourSchemeI; @@ -724,9 +725,19 @@ public class AnnotationColourChooser extends JPanel for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++) { AlignmentAnnotation aa = av.getAlignment().getAlignmentAnnotation()[i]; - if (aa.label.equals(currentAnnotation.label)) + if (aa.label.equals(currentAnnotation.label) + && (currentAnnotation.getCalcId() == null ? aa.getCalcId() == null + : currentAnnotation.getCalcId() + .equals(aa.getCalcId()))) { - aa.threshold.value = thr; + if (aa.threshold == null) + { + aa.threshold = new GraphLine(currentAnnotation.threshold); + } + else + { + aa.threshold.value = thr; + } } } } -- 1.7.10.2