From: amwaterhouse Date: Fri, 7 Jul 2006 13:00:45 +0000 (+0000) Subject: Checks on drawing characters and if sequence ref has been deleted X-Git-Tag: Release_2_1~312 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1a18a6b7326400739c20566d45c19281600217c4;p=jalview.git Checks on drawing characters and if sequence ref has been deleted --- 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);