From 2a6873d5bfdd3c0f501545dbf4b07c184a7352b5 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 18 Apr 2007 12:32:39 +0000 Subject: [PATCH] Pad gaps when annotation editing --- src/jalview/commands/EditCommand.java | 9 ++++++++- src/jalview/datamodel/AlignmentAnnotation.java | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/jalview/commands/EditCommand.java b/src/jalview/commands/EditCommand.java index 052b212..45b19af 100644 --- a/src/jalview/commands/EditCommand.java +++ b/src/jalview/commands/EditCommand.java @@ -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 { diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index f43529d..95af29d 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -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() + ""; -- 1.7.10.2