Checks on drawing characters and if sequence ref has been deleted
authoramwaterhouse <Andrew Waterhouse>
Fri, 7 Jul 2006 13:00:45 +0000 (13:00 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 7 Jul 2006 13:00:45 +0000 (13:00 +0000)
src/jalview/datamodel/AlignmentAnnotation.java

index 7f6b08a..5a2c46e 100755 (executable)
@@ -168,33 +168,35 @@ public class AlignmentAnnotation
             }\r
         }\r
 \r
-        if(!drawValues)\r
-        {\r
-          for (int i = 0; i < annotations.length; i++)\r
-          {\r
-            if (annotations[i] != null)\r
-              annotations[i].displayCharacter = "";\r
-          }\r
-        }\r
-\r
         graphMin = min;\r
         graphMax = max;\r
 \r
         for (int i = 0; i < annotations.length; i++)\r
         {\r
-            if ((annotations[i] != null) &&\r
-                    ((annotations[i].secondaryStructure == 'H') ||\r
+            if (!hasIcons\r
+                && annotations[i] != null\r
+                && ((annotations[i].secondaryStructure == 'H') ||\r
                     (annotations[i].secondaryStructure == 'E')))\r
             {\r
                 hasIcons = true;\r
             }\r
 \r
-            if ((annotations[i] != null) &&\r
-                    (annotations[i].displayCharacter.length() > 0))\r
+            if (!hasText\r
+                && annotations[i]!=null\r
+                && annotations[i].displayCharacter.length() > 0)\r
             {\r
                 hasText = true;\r
             }\r
         }\r
+\r
+        if(!drawValues && graphType!=NO_GRAPH)\r
+        {\r
+          for (int i = 0; i < annotations.length; i++)\r
+          {\r
+            if (annotations[i] != null)\r
+              annotations[i].displayCharacter = "";\r
+          }\r
+        }\r
     }\r
 \r
     /**\r
@@ -299,9 +301,16 @@ public class AlignmentAnnotation
       {\r
           int a=0, aSize = sequenceRef.getLength();\r
 \r
+          if(aSize == 0)\r
+          {\r
+            //Its been deleted\r
+            return;\r
+          }\r
+\r
           int position;\r
           Annotation[] temp = new Annotation[aSize];\r
           Integer index;\r
+\r
           for (a = sequenceRef.getStart(); a <= sequenceRef.getEnd(); a++)\r
           {\r
               index = new Integer(a);\r