From 1a18a6b7326400739c20566d45c19281600217c4 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 7 Jul 2006 13:00:45 +0000 Subject: [PATCH] Checks on drawing characters and if sequence ref has been deleted --- src/jalview/datamodel/AlignmentAnnotation.java | 35 +++++++++++++++--------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index 7f6b08a..5a2c46e 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -168,33 +168,35 @@ public class AlignmentAnnotation } } - if(!drawValues) - { - for (int i = 0; i < annotations.length; i++) - { - if (annotations[i] != null) - annotations[i].displayCharacter = ""; - } - } - graphMin = min; graphMax = max; for (int i = 0; i < annotations.length; i++) { - if ((annotations[i] != null) && - ((annotations[i].secondaryStructure == 'H') || + if (!hasIcons + && annotations[i] != null + && ((annotations[i].secondaryStructure == 'H') || (annotations[i].secondaryStructure == 'E'))) { hasIcons = true; } - if ((annotations[i] != null) && - (annotations[i].displayCharacter.length() > 0)) + if (!hasText + && annotations[i]!=null + && annotations[i].displayCharacter.length() > 0) { hasText = true; } } + + if(!drawValues && graphType!=NO_GRAPH) + { + for (int i = 0; i < annotations.length; i++) + { + if (annotations[i] != null) + annotations[i].displayCharacter = ""; + } + } } /** @@ -299,9 +301,16 @@ public class AlignmentAnnotation { int a=0, aSize = sequenceRef.getLength(); + if(aSize == 0) + { + //Its been deleted + return; + } + int position; Annotation[] temp = new Annotation[aSize]; Integer index; + for (a = sequenceRef.getStart(); a <= sequenceRef.getEnd(); a++) { index = new Integer(a); -- 1.7.10.2