fix for JAL-1579 create threshold object for annotation rows that match shading patte...
authorJim Procter <jprocter@dundee.ac.uk>
Mon, 3 Nov 2014 13:02:39 +0000 (13:02 +0000)
committerJim Procter <jprocter@dundee.ac.uk>
Mon, 3 Nov 2014 13:02:39 +0000 (13:02 +0000)
src/jalview/gui/AnnotationColourChooser.java

index 3c552a4..b8996b6 100644 (file)
@@ -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;
+        }
       }
     }
   }