GraphLine annotationThreshold;\r
\r
float r1, g1, b1, rr, gg, bb, dr, dg, db;\r
- float range;\r
+ float range = 0;\r
+\r
+ ColourSchemeI colourScheme;\r
+\r
+ /**\r
+ * Creates a new AnnotationColourGradient object.\r
+ */\r
+ public AnnotationColourGradient(AlignmentAnnotation annotation,\r
+ ColourSchemeI originalColour,\r
+ int aboveThreshold)\r
+ {\r
+ if(originalColour instanceof AnnotationColourGradient)\r
+ {\r
+ colourScheme = ((AnnotationColourGradient)originalColour).colourScheme;\r
+ }\r
+ else\r
+ colourScheme = originalColour;\r
+\r
+ this.annotation = annotation;\r
+\r
+ aboveAnnotationThreshold = aboveThreshold;\r
+\r
+ if(aboveThreshold!=NO_THRESHOLD && annotation.threshold!=null)\r
+ annotationThreshold = annotation.threshold;\r
+ }\r
\r
/**\r
* Creates a new AnnotationColourGradient object.\r
*/\r
public Color findColour(String n)\r
{\r
- System.out.println("AnnotationColourGradient findColour(string)");\r
return Color.red;\r
}\r
\r
|| (annotationThreshold!=null && aboveAnnotationThreshold==ABOVE_THRESHOLD && annotation.annotations[j].value>=annotationThreshold.value)\r
|| (annotationThreshold!=null && aboveAnnotationThreshold==BELOW_THRESHOLD && annotation.annotations[j].value<=annotationThreshold.value))\r
{\r
+ if(colourScheme!=null)\r
+ {\r
+ currentColour = colourScheme.findColour(n, j);\r
+ }\r
+ else if(range!=0)\r
+ {\r
dr = rr *\r
- ((annotation.annotations[j].value-annotation.graphMin) / range )\r
- +r1;\r
+ ( (annotation.annotations[j].value - annotation.graphMin) /\r
+ range)\r
+ + r1;\r
dg = gg *\r
- ((annotation.annotations[j].value-annotation.graphMin) / range )\r
- +g1;\r
+ ( (annotation.annotations[j].value - annotation.graphMin) /\r
+ range)\r
+ + g1;\r
db = bb *\r
- ((annotation.annotations[j].value-annotation.graphMin) / range )\r
- +b1;\r
-\r
- currentColour = new Color( (int) dr, (int) dg, (int) db);\r
+ ( (annotation.annotations[j].value - annotation.graphMin) /\r
+ range)\r
+ + b1;\r
+\r
+ currentColour = new Color( (int) dr, (int) dg, (int) db);\r
+ }\r
+ else\r
+ currentColour = Color.white;\r
}\r
else\r
currentColour = Color.white;\r