marker.getLabelTextAnchor()
);
}
}
else if (marker instanceof IntervalMarker) {
IntervalMarker im = (IntervalMarker) marker;
double start = im.getStartValue();
double end = im.getEndValue();
Range range = domainAxis.getRange();
if (!(range.intersects(start, end))) {
return;
}
// don't draw beyond the axis range...
start = range.constrain(start);
end = range.constrain(end);
double v0 = domainAxis.valueToJava2D(
start, dataArea, plot.getDomainAxisEdge()
);
double v1 = domainAxis.valueToJava2D(
end, dataArea, plot.getDomainAxisEdge()
);
PlotOrientation orientation = plot.getOrientation();
Rectangle2D rect = null;
if (orientation == PlotOrientation.HORIZONTAL) {
rect = new Rectangle2D.Double(
dataArea.getMinX(), Math.min(v0, v1),
dataArea.getWidth(), Math.abs(v1 - v0)
);
}
else if (orientation == PlotOrientation.VERTICAL) {
rect = new Rectangle2D.Double(
Math.min(v0, v1), dataArea.getMinY(),
Math.abs(v1 - v0), dataArea.getHeight()
);
}
Paint p = marker.getPaint();
if (p instanceof GradientPaint) {
GradientPaint gp = (GradientPaint) p;
GradientPaintTransformer t = im.getGradientPaintTransformer();
if (t != null) {
gp = t.transform(gp, rect);
}
g2.setPaint(gp);
}