for (LocusScore score : locusScores) {
// We'll have to case this score to an RNAiGeneScore here for now. This is not
// particularly safe and should be redesigned to eliminate the need to cache.
RNAIGeneScore rnaiScore = (RNAIGeneScore) score;
// Note -- don't cast these to an int until the range is checked.
// could get an overflow.
double pX = ((score.getStart() - origin) / locScale);
double dx = Math.ceil((score.getEnd() - score.getStart()) / locScale) + 1;
// Don't bother drawing if the data is not in range
if ((pX + dx) >= 0 && (pX <= drawingRect.getMaxX())) {
float dataY = score.getScore();
// Draw the gene score
if (!Float.isNaN(dataY)) {
int pY = computeYPixelValue(drawingRect, axisDefinition, dataY);
drawDataPoint(new Color(57, 67, 201), (int) dx, (int) pX, baseY, pY,
context);
}
// Draw the hairpin values, if any
if (rnaiScore.getHairpinValues() != null) {
// my blue color new Color(195, 211, 237)
for (RNAIHairpinValue hValue : rnaiScore.getHairpinValues()) {
int scoreY = computeYPixelValue(drawingRect,
axisDefinition,
hValue.getScoreMean());
context.getGraphic2DForColor(new Color(95, 120, 200).brighter()).drawLine(
(int) pX, scoreY, ((int) pX + (int) dx) - 1, scoreY);