use of org.jfree.chart.renderer.category.AbstractCategoryItemRenderer in project SIMVA-SoS by SESoS.
the class CategoryPlot method drawRangeGridlines.
/**
* Draws the range gridlines for the plot, if they are visible.
*
* @param g2 the graphics device ({@code null} not permitted).
* @param dataArea the area inside the axes ({@code null} not permitted).
* @param ticks the ticks.
*
* @see #drawDomainGridlines(Graphics2D, Rectangle2D)
*/
protected void drawRangeGridlines(Graphics2D g2, Rectangle2D dataArea, List ticks) {
// draw the range grid lines, if any...
if (!isRangeGridlinesVisible() && !isRangeMinorGridlinesVisible()) {
return;
}
// no axis, no gridlines...
ValueAxis axis = getRangeAxis();
if (axis == null) {
return;
}
// no renderer, no gridlines...
CategoryItemRenderer r = getRenderer();
if (r == null) {
return;
}
Stroke gridStroke = null;
Paint gridPaint = null;
boolean paintLine;
Iterator iterator = ticks.iterator();
while (iterator.hasNext()) {
paintLine = false;
ValueTick tick = (ValueTick) iterator.next();
if ((tick.getTickType() == TickType.MINOR) && isRangeMinorGridlinesVisible()) {
gridStroke = getRangeMinorGridlineStroke();
gridPaint = getRangeMinorGridlinePaint();
paintLine = true;
} else if ((tick.getTickType() == TickType.MAJOR) && isRangeGridlinesVisible()) {
gridStroke = getRangeGridlineStroke();
gridPaint = getRangeGridlinePaint();
paintLine = true;
}
if (((tick.getValue() != 0.0) || !isRangeZeroBaselineVisible()) && paintLine) {
// interface...
if (r instanceof AbstractCategoryItemRenderer) {
AbstractCategoryItemRenderer aci = (AbstractCategoryItemRenderer) r;
aci.drawRangeLine(g2, this, axis, dataArea, tick.getValue(), gridPaint, gridStroke);
} else {
// we'll have to use the method in the interface, but
// this doesn't have the paint and stroke settings...
r.drawRangeGridline(g2, this, axis, dataArea, tick.getValue());
}
}
}
}
use of org.jfree.chart.renderer.category.AbstractCategoryItemRenderer in project SIMVA-SoS by SESoS.
the class CategoryPlot method drawZeroRangeBaseline.
/**
* Draws a base line across the chart at value zero on the range axis.
*
* @param g2 the graphics device.
* @param area the data area.
*
* @see #setRangeZeroBaselineVisible(boolean)
*
* @since 1.0.13
*/
protected void drawZeroRangeBaseline(Graphics2D g2, Rectangle2D area) {
if (!isRangeZeroBaselineVisible()) {
return;
}
CategoryItemRenderer r = getRenderer();
if (r instanceof AbstractCategoryItemRenderer) {
AbstractCategoryItemRenderer aci = (AbstractCategoryItemRenderer) r;
aci.drawRangeLine(g2, this, getRangeAxis(), area, 0.0, this.rangeZeroBaselinePaint, this.rangeZeroBaselineStroke);
} else {
r.drawRangeGridline(g2, this, getRangeAxis(), area, 0.0);
}
}
Aggregations