From: Jim Procter Date: Mon, 3 Nov 2014 13:02:39 +0000 (+0000) Subject: fix for JAL-1579 create threshold object for annotation rows that match shading patte... X-Git-Tag: Jalview_2_9~155^2~15^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=3a261a3e4451bb5c04af9e6f7da496951a569a18;p=jalview.git 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) --- 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; + } } } }