Merge branch 'alpha/origin_2022_JAL-3066_Jalview_212_slivka-integration' into spike...
[jalview.git] / src / jalview / io / SequenceAnnotationReport.java
index 6936686..dca53e1 100644 (file)
@@ -490,20 +490,27 @@ public class SequenceAnnotationReport
       ds = ds.getDatasetSequence();
     }
 
+    
     /*
      * add any annotation scores
      */
     AlignmentAnnotation[] anns = ds.getAnnotation();
-    for (int i = 0; anns != null && i < anns.length; i++)
-    {
-      AlignmentAnnotation aa = anns[i];
-      if (aa != null && aa.hasScore() && aa.sequenceRef != null)
+    if (anns!=null && anns.length>0) {
+      boolean first=true;
+      for (int i = 0; anns != null && i < anns.length; i++)
       {
-        sb.append("<br>").append(aa.label).append(": ")
-                .append(aa.getScore());
+        AlignmentAnnotation aa = anns[i];
+        if (aa != null && aa.hasScore() && aa.sequenceRef != null)
+        {
+          if (first) {
+                 sb.append("<br>").append("Annotation Scores<br>");
+                 first=false;
+          }
+          sb.append("<br>").append(aa.label).append(": ")
+                  .append(aa.getScore());
+        }
       }
     }
-
     if (showDbRefs)
     {
       maxWidth = Math.max(maxWidth, appendDbRefs(sb, ds, summary));
@@ -537,8 +544,8 @@ public class SequenceAnnotationReport
       sb.append(bitScore);
       maxWidth = Math.max(maxWidth, eValue.length());
       maxWidth = Math.max(maxWidth, bitScore.length());
+      sb.append("<br>");
     }
-    sb.append("<br>");
     sb.append("</i>");
 
     return maxWidth;