pad should leave null annotations array null
[jalview.git] / src / jalview / datamodel / AlignmentAnnotation.java
index 20a3633..ae81a90 100755 (executable)
@@ -152,8 +152,10 @@ Loading...
       }
 
       if(annotations[i].displayCharacter==null)
+      {
+        padGaps = false;
         continue;
-
+      }
 
       if (annotations[i].displayCharacter.length() == 1
           && !annotations[i].displayCharacter.equals("H")
@@ -396,8 +398,7 @@ Loading...
   public boolean padAnnotation(int length) {
     if (annotations==null)
     {
-      annotations = new Annotation[length];
-      return true;
+      return true; // annotation row is correct - null == not visible and undefined length 
     }
     if (annotations.length<length)
     {
@@ -637,4 +638,15 @@ Loading...
   {
     return hasScore || !Double.isNaN(score);
   }
+  /**
+   * Score only annotation
+   * @param label
+   * @param description
+   * @param score
+   */
+  public AlignmentAnnotation(String label, String description, double score)
+  {
+    this(label, description, null);
+    setScore(score);
+  }
 }