Pad gaps when annotation editing
authoramwaterhouse <Andrew Waterhouse>
Wed, 18 Apr 2007 12:32:39 +0000 (12:32 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 18 Apr 2007 12:32:39 +0000 (12:32 +0000)
src/jalview/commands/EditCommand.java
src/jalview/datamodel/AlignmentAnnotation.java

index 052b212..45b19af 100644 (file)
@@ -347,7 +347,7 @@ public class EditCommand
       AlignmentAnnotation[] tmp;
       for (int s = 0; s < command.seqs.length; s++)
       {
-        if (modifyVisibility) 
+        if (modifyVisibility)
         {
           // Rows are only removed or added to sequence object.
           if (!insert) {
@@ -433,6 +433,13 @@ public class EditCommand
       if (insert)
       {
         temp = new Annotation[aSize + command.number];
+        if(annotations[a].padGaps)
+          for (int aa = 0; aa < temp.length; aa++)
+          {
+            temp[aa] = new Annotation(
+                command.al.getGapCharacter()+"",
+                null, ' ', 0);
+          }
       }
       else
       {
index f43529d..95af29d 100755 (executable)
@@ -80,6 +80,8 @@ public class AlignmentAnnotation
 
   public int graphHeight = 40;
 
+  public boolean padGaps = true;
+
   public static final int NO_GRAPH = 0;
 
   public static final int BAR_GRAPH = 1;
@@ -128,6 +130,7 @@ public class AlignmentAnnotation
     {
       if (annotations[i] == null)
       {
+        padGaps = false;
         continue;
       }
 
@@ -154,6 +157,8 @@ public class AlignmentAnnotation
       {
         hasText = true;
       }
+      else
+        padGaps = false;
     }
 
     if (nonSSLabel)
@@ -169,7 +174,6 @@ public class AlignmentAnnotation
         }
 
       }
-
     }
 
     annotationId = this.hashCode() + "";