one colour flag in annotation export
authoramwaterhouse <Andrew Waterhouse>
Fri, 27 Apr 2007 09:53:27 +0000 (09:53 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 27 Apr 2007 09:53:27 +0000 (09:53 +0000)
src/jalview/io/AnnotationFile.java

index 463e922..e54ae71 100755 (executable)
@@ -40,6 +40,7 @@ public class AnnotationFile
   {\r
     if (annotations != null)\r
     {\r
+      boolean oneColour = true;\r
       AlignmentAnnotation row;\r
       String comma;\r
       SequenceI refSeq = null;\r
@@ -61,6 +62,7 @@ public class AnnotationFile
         }\r
 \r
         color = null;\r
+        oneColour = true;\r
 \r
         if (row.sequenceRef == null)\r
         {\r
@@ -151,6 +153,11 @@ public class AnnotationFile
 \r
             if (row.annotations[j] != null)\r
             {\r
+              if(color!=null && !color.equals(row.annotations[j].colour))\r
+              {\r
+                oneColour = false;\r
+              }\r
+\r
               color = row.annotations[j].colour;\r
               if (row.annotations[j].value != 0f)\r
               {\r
@@ -174,7 +181,7 @@ public class AnnotationFile
 \r
         text.append("\n");\r
 \r
-        if (color != null && color != java.awt.Color.black)\r
+        if (color != null && color != java.awt.Color.black && oneColour)\r
         {\r
           colours.append("COLOUR\t"\r
                          + row.label + "\t"\r
@@ -578,7 +585,8 @@ public class AnnotationFile
 \r
     }\r
 \r
-    if (displayChar.length() > 1\r
+    if (displayChar!=null\r
+        && displayChar.length() > 1\r
         &&  desc!=null\r
         && desc.length() == 1)\r
     {\r