AlignmentAnnotation: added annotation score attribute and allowed for annotation...
[jalview.git] / src / jalview / commands / EditCommand.java
index ccc6a81..ce88127 100644 (file)
@@ -151,16 +151,16 @@ public class EditCommand
       switch(edits[e].command)
       {
         case INSERT_GAP:
-          insertGap(edits[e]);
+        insertGap(edits[e]);
           break;
         case DELETE_GAP:
-          deleteGap(edits[e]);
+        deleteGap(edits[e]);
           break;
         case CUT:
-          cut(edits[e]);
+        cut(edits[e]);
           break;
         case PASTE:
-          paste(edits[e]);
+        paste(edits[e]);
           break;
         case REPLACE:
           replace(edits[e]);
@@ -182,16 +182,16 @@ public class EditCommand
       switch (edits[e].command)
       {
         case INSERT_GAP:
-          deleteGap(edits[e]);
+        deleteGap(edits[e]);
           break;
         case DELETE_GAP:
-          insertGap(edits[e]);
+        insertGap(edits[e]);
           break;
         case CUT:
-          paste(edits[e]);
+        paste(edits[e]);
           break;
         case PASTE:
-          cut(edits[e]);
+        cut(edits[e]);
           break;
         case REPLACE:
           replace(edits[e]);
@@ -373,6 +373,7 @@ public class EditCommand
 
   final void adjustAnnotations(Edit command, boolean insert, boolean modifyVisibility)
   {
+
     AlignmentAnnotation[] annotations = null;
 
     if (modifyVisibility && !insert)
@@ -471,7 +472,11 @@ public class EditCommand
       }
 
       int tSize = 0;
-
+      if (annotations[a].annotations == null)
+      {
+        // nothing to edit here ?
+        continue;
+      }
       aSize = annotations[a].annotations.length;
       if (insert)
       {
@@ -480,7 +485,7 @@ public class EditCommand
           for (int aa = 0; aa < temp.length; aa++)
           {
             temp[aa] = new Annotation(
-                command.al.getGapCharacter()+"",
+                command.gapChar+"",
                 null, ' ', 0);
           }
       }
@@ -760,6 +765,7 @@ public class EditCommand
       this.position = position;
       this.number = number;
       this.al = al;
+      this.gapChar = al.getGapCharacter();
       string = new char[seqs.length][];
       for (int i = 0; i < seqs.length; i++)
       {
@@ -769,5 +775,4 @@ public class EditCommand
       fullAlignmentHeight = (al.getHeight() == seqs.length);
     }
   }
-
 }