From: amwaterhouse Date: Mon, 23 Apr 2007 11:47:47 +0000 (+0000) Subject: check dispalyChar is not null X-Git-Tag: Release_2_3~193 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=40513f0731d40f708dfe414d75fa335ab47a2391;p=jalview.git check dispalyChar is not null --- diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 2f444d6..c9fa597 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -821,15 +821,20 @@ public class AnnotationPanel } } - if (av.validCharWidth && validRes && - (row.annotations[column].displayCharacter.length() > 0)) + if (av.validCharWidth && validRes + && row.annotations[column].displayCharacter != null + && (row.annotations[column].displayCharacter.length() > 0)) { int charOffset = (av.charWidth - fm.charWidth(row.annotations[column]. displayCharacter.charAt( 0))) / 2; - g.setColor(row.annotations[column].colour); + + if (row.annotations[column].colour == null) + g.setColor(Color.black); + else + g.setColor(row.annotations[column].colour); if (column == 0 || row.graph > 0) { @@ -1143,7 +1148,11 @@ public class AnnotationPanel continue; } - g.setColor(aa.annotations[column].colour); + if (aa.annotations[column].colour == null) + g.setColor(Color.black); + else + g.setColor(aa.annotations[column].colour); + y1 = y - (int) ( ( (aa.annotations[column - 1].value - min) / range) * graphHeight); y2 = y - @@ -1217,7 +1226,11 @@ public class AnnotationPanel continue; } - g.setColor(aa.annotations[column].colour); + if (aa.annotations[column].colour == null) + g.setColor(Color.black); + else + g.setColor(aa.annotations[column].colour); + y1 = y - (int) ( ( (aa.annotations[column].value - min) / (range)) * aa.graphHeight); @@ -1264,7 +1277,10 @@ public class AnnotationPanel { if (aa.annotations[j] != null) { - g.setColor(aa.annotations[j].colour); + if (aa.annotations[j].colour == null) + g.setColor(Color.black); + else + g.setColor(aa.annotations[j].colour); height = (int) ( (aa.annotations[j].value / aa.graphMax) * y); if (height > y)