JAL-2349 don’t clobber existing label/description for an annotation when associating...
authorJames Procter <j.procter@dundee.ac.uk>
Wed, 15 Mar 2023 10:56:34 +0000 (10:56 +0000)
committerJames Procter <j.procter@dundee.ac.uk>
Wed, 15 Mar 2023 10:56:34 +0000 (10:56 +0000)
src/jalview/datamodel/ContactMapHolder.java

index a555a17..296feaf 100644 (file)
@@ -72,8 +72,15 @@ public class ContactMapHolder implements ContactMapHolderI
     annotation.editable = false;
     annotation.graph = AlignmentAnnotation.CONTACT_MAP;
     annotation.calcId = cm.getType();
-    annotation.label = cm.getAnnotLabel();
-    annotation.description = cm.getAnnotDescr();
+    if (annotation.label == null || "".equals(annotation.label))
+    {
+      annotation.label = cm.getAnnotLabel();
+
+    }
+    if (annotation.description == null || "".equals(annotation.description))
+    {
+      annotation.description = cm.getAnnotDescr();
+    }
     contactmaps.put(annotation.annotationId, cm);
   }
 }