Set black if colour null
authoramwaterhouse <Andrew Waterhouse>
Fri, 27 Apr 2007 09:54:41 +0000 (09:54 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 27 Apr 2007 09:54:41 +0000 (09:54 +0000)
src/jalview/appletgui/AnnotationPanel.java

index 5242752..fbc98be 100755 (executable)
@@ -653,7 +653,11 @@ public class AnnotationPanel
                             fm.charWidth(row.annotations[column].\r
                                          displayCharacter.charAt(\r
                                              0))) / 2;\r
-          g.setColor(row.annotations[column].colour);\r
+\r
+          if (row.annotations[column].colour == null)\r
+            g.setColor(Color.black);\r
+          else\r
+            g.setColor(row.annotations[column].colour);\r
 \r
           if (column == 0 || row.graph > 0)\r
           {\r
@@ -971,7 +975,11 @@ public class AnnotationPanel
         continue;\r
       }\r
 \r
-      g.setColor(aa.annotations[column].colour);\r
+      if (aa.annotations[column].colour == null)\r
+        g.setColor(Color.black);\r
+      else\r
+        g.setColor(aa.annotations[column].colour);\r
+\r
       y1 = y -\r
           (int) ( ( (aa.annotations[column - 1].value - min) / range) * graphHeight);\r
       y2 = y -\r
@@ -1038,7 +1046,11 @@ public class AnnotationPanel
         continue;\r
       }\r
 \r
-      g.setColor(aa.annotations[column].colour);\r
+      if (aa.annotations[column].colour == null)\r
+        g.setColor(Color.black);\r
+      else\r
+        g.setColor(aa.annotations[column].colour);\r
+\r
       y1 = y -\r
           (int) ( ( (aa.annotations[column].value - min) / (range)) * aa.graphHeight);\r
 \r
@@ -1074,7 +1086,10 @@ public class AnnotationPanel
 \r
     for (int j = sRes; j < eRes; j++)\r
     {\r
-      g.setColor(aa.annotations[j].colour);\r
+      if (aa.annotations[j].colour == null)\r
+        g.setColor(Color.black);\r
+      else\r
+        g.setColor(aa.annotations[j].colour);\r
 \r
       height = (int) ( (aa.annotations[j].value / aa.graphMax) * GRAPH_HEIGHT);\r
       if (height > y)\r