Java Code Examples for org.jfree.chart.renderer.category.CategoryItemRenderer#drawRangeGridline()

The following examples show how to use org.jfree.chart.renderer.category.CategoryItemRenderer#drawRangeGridline() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: jMutRepair_0021_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Draws the gridlines for the plot.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 * @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()) {
        Stroke gridStroke = getRangeGridlineStroke();
        Paint gridPaint = getRangeGridlinePaint();
        if ((gridStroke != null) && (gridPaint != null)) {
            ValueAxis axis = getRangeAxis();
            if (axis != null) {
                Iterator iterator = ticks.iterator();
                while (iterator.hasNext()) {
                    ValueTick tick = (ValueTick) iterator.next();
                    CategoryItemRenderer renderer1 = getRenderer();
                    if (renderer1 != null) {
                        renderer1.drawRangeGridline(g2, this, 
                                getRangeAxis(), dataArea, tick.getValue());
                    }
                }
            }
        }
    }
}
 
Example 2
Source File: jKali_001_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Draws the gridlines for the plot.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 * @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()) {
        Stroke gridStroke = getRangeGridlineStroke();
        Paint gridPaint = getRangeGridlinePaint();
        if ((gridStroke != null) && (gridPaint != null)) {
            ValueAxis axis = getRangeAxis();
            if (axis != null) {
                Iterator iterator = ticks.iterator();
                while (iterator.hasNext()) {
                    ValueTick tick = (ValueTick) iterator.next();
                    CategoryItemRenderer renderer1 = getRenderer();
                    if (renderer1 != null) {
                        renderer1.drawRangeGridline(g2, this, 
                                getRangeAxis(), dataArea, tick.getValue());
                    }
                }
            }
        }
    }
}
 
Example 3
Source File: JGenProg2017_0081_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Draws the gridlines for the plot.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 * @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()) {
        Stroke gridStroke = getRangeGridlineStroke();
        Paint gridPaint = getRangeGridlinePaint();
        if ((gridStroke != null) && (gridPaint != null)) {
            ValueAxis axis = getRangeAxis();
            if (axis != null) {
                Iterator iterator = ticks.iterator();
                while (iterator.hasNext()) {
                    ValueTick tick = (ValueTick) iterator.next();
                    CategoryItemRenderer renderer1 = getRenderer();
                    if (renderer1 != null) {
                        renderer1.drawRangeGridline(g2, this, 
                                getRangeAxis(), dataArea, tick.getValue());
                    }
                }
            }
        }
    }
}
 
Example 4
Source File: Cardumen_00243_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Draws the gridlines for the plot.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 * @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()) {
        Stroke gridStroke = getRangeGridlineStroke();
        Paint gridPaint = getRangeGridlinePaint();
        if ((gridStroke != null) && (gridPaint != null)) {
            ValueAxis axis = getRangeAxis();
            if (axis != null) {
                Iterator iterator = ticks.iterator();
                while (iterator.hasNext()) {
                    ValueTick tick = (ValueTick) iterator.next();
                    CategoryItemRenderer renderer1 = getRenderer();
                    if (renderer1 != null) {
                        renderer1.drawRangeGridline(g2, this, 
                                getRangeAxis(), dataArea, tick.getValue());
                    }
                }
            }
        }
    }
}
 
Example 5
Source File: Chart_19_CategoryPlot_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Draws the gridlines for the plot.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 * @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()) {
        Stroke gridStroke = getRangeGridlineStroke();
        Paint gridPaint = getRangeGridlinePaint();
        if ((gridStroke != null) && (gridPaint != null)) {
            ValueAxis axis = getRangeAxis();
            if (axis != null) {
                Iterator iterator = ticks.iterator();
                while (iterator.hasNext()) {
                    ValueTick tick = (ValueTick) iterator.next();
                    CategoryItemRenderer renderer1 = getRenderer();
                    if (renderer1 != null) {
                        renderer1.drawRangeGridline(g2, this, 
                                getRangeAxis(), dataArea, tick.getValue());
                    }
                }
            }
        }
    }
}
 
Example 6
Source File: Cardumen_006_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Draws the gridlines for the plot.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 * @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()) {
        Stroke gridStroke = getRangeGridlineStroke();
        Paint gridPaint = getRangeGridlinePaint();
        if ((gridStroke != null) && (gridPaint != null)) {
            ValueAxis axis = getRangeAxis();
            if (axis != null) {
                Iterator iterator = ticks.iterator();
                while (iterator.hasNext()) {
                    ValueTick tick = (ValueTick) iterator.next();
                    CategoryItemRenderer renderer1 = getRenderer();
                    if (renderer1 != null) {
                        renderer1.drawRangeGridline(g2, this, 
                                getRangeAxis(), dataArea, tick.getValue());
                    }
                }
            }
        }
    }
}
 
Example 7
Source File: Cardumen_006_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Draws the gridlines for the plot.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 * @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()) {
        Stroke gridStroke = getRangeGridlineStroke();
        Paint gridPaint = getRangeGridlinePaint();
        if ((gridStroke != null) && (gridPaint != null)) {
            ValueAxis axis = getRangeAxis();
            if (axis != null) {
                Iterator iterator = ticks.iterator();
                while (iterator.hasNext()) {
                    ValueTick tick = (ValueTick) iterator.next();
                    CategoryItemRenderer renderer1 = getRenderer();
                    if (renderer1 != null) {
                        renderer1.drawRangeGridline(g2, this, 
                                getRangeAxis(), dataArea, tick.getValue());
                    }
                }
            }
        }
    }
}
 
Example 8
Source File: jKali_001_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Draws the gridlines for the plot.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 * @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()) {
        Stroke gridStroke = getRangeGridlineStroke();
        Paint gridPaint = getRangeGridlinePaint();
        if ((gridStroke != null) && (gridPaint != null)) {
            ValueAxis axis = getRangeAxis();
            if (axis != null) {
                Iterator iterator = ticks.iterator();
                while (iterator.hasNext()) {
                    ValueTick tick = (ValueTick) iterator.next();
                    CategoryItemRenderer renderer1 = getRenderer();
                    if (renderer1 != null) {
                        renderer1.drawRangeGridline(g2, this, 
                                getRangeAxis(), dataArea, tick.getValue());
                    }
                }
            }
        }
    }
}
 
Example 9
Source File: patch1-Chart-26-jMutRepair_patch1-Chart-26-jMutRepair_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Draws the gridlines for the plot.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 * @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()) {
        Stroke gridStroke = getRangeGridlineStroke();
        Paint gridPaint = getRangeGridlinePaint();
        if ((gridStroke != null) && (gridPaint != null)) {
            ValueAxis axis = getRangeAxis();
            if (axis != null) {
                Iterator iterator = ticks.iterator();
                while (iterator.hasNext()) {
                    ValueTick tick = (ValueTick) iterator.next();
                    CategoryItemRenderer renderer1 = getRenderer();
                    if (renderer1 != null) {
                        renderer1.drawRangeGridline(g2, this, 
                                getRangeAxis(), dataArea, tick.getValue());
                    }
                }
            }
        }
    }
}
 
Example 10
Source File: jMutRepair_001_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Draws the gridlines for the plot.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 * @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()) {
        Stroke gridStroke = getRangeGridlineStroke();
        Paint gridPaint = getRangeGridlinePaint();
        if ((gridStroke != null) && (gridPaint != null)) {
            ValueAxis axis = getRangeAxis();
            if (axis != null) {
                Iterator iterator = ticks.iterator();
                while (iterator.hasNext()) {
                    ValueTick tick = (ValueTick) iterator.next();
                    CategoryItemRenderer renderer1 = getRenderer();
                    if (renderer1 != null) {
                        renderer1.drawRangeGridline(g2, this, 
                                getRangeAxis(), dataArea, tick.getValue());
                    }
                }
            }
        }
    }
}
 
Example 11
Source File: patch1-Chart-26-jMutRepair_patch1-Chart-26-jMutRepair_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Draws the gridlines for the plot.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 * @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()) {
        Stroke gridStroke = getRangeGridlineStroke();
        Paint gridPaint = getRangeGridlinePaint();
        if ((gridStroke != null) && (gridPaint != null)) {
            ValueAxis axis = getRangeAxis();
            if (axis != null) {
                Iterator iterator = ticks.iterator();
                while (iterator.hasNext()) {
                    ValueTick tick = (ValueTick) iterator.next();
                    CategoryItemRenderer renderer1 = getRenderer();
                    if (renderer1 != null) {
                        renderer1.drawRangeGridline(g2, this, 
                                getRangeAxis(), dataArea, tick.getValue());
                    }
                }
            }
        }
    }
}
 
Example 12
Source File: Nopol2017_005_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Draws the gridlines for the plot.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 * @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()) {
        Stroke gridStroke = getRangeGridlineStroke();
        Paint gridPaint = getRangeGridlinePaint();
        if ((gridStroke != null) && (gridPaint != null)) {
            ValueAxis axis = getRangeAxis();
            if (axis != null) {
                Iterator iterator = ticks.iterator();
                while (iterator.hasNext()) {
                    ValueTick tick = (ValueTick) iterator.next();
                    CategoryItemRenderer renderer1 = getRenderer();
                    if (renderer1 != null) {
                        renderer1.drawRangeGridline(g2, this, 
                                getRangeAxis(), dataArea, tick.getValue());
                    }
                }
            }
        }
    }
}
 
Example 13
Source File: Nopol2017_005_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Draws the gridlines for the plot.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 * @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()) {
        Stroke gridStroke = getRangeGridlineStroke();
        Paint gridPaint = getRangeGridlinePaint();
        if ((gridStroke != null) && (gridPaint != null)) {
            ValueAxis axis = getRangeAxis();
            if (axis != null) {
                Iterator iterator = ticks.iterator();
                while (iterator.hasNext()) {
                    ValueTick tick = (ValueTick) iterator.next();
                    CategoryItemRenderer renderer1 = getRenderer();
                    if (renderer1 != null) {
                        renderer1.drawRangeGridline(g2, this, 
                                getRangeAxis(), dataArea, tick.getValue());
                    }
                }
            }
        }
    }
}
 
Example 14
Source File: jMutRepair_001_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Draws the gridlines for the plot.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 * @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()) {
        Stroke gridStroke = getRangeGridlineStroke();
        Paint gridPaint = getRangeGridlinePaint();
        if ((gridStroke != null) && (gridPaint != null)) {
            ValueAxis axis = getRangeAxis();
            if (axis != null) {
                Iterator iterator = ticks.iterator();
                while (iterator.hasNext()) {
                    ValueTick tick = (ValueTick) iterator.next();
                    CategoryItemRenderer renderer1 = getRenderer();
                    if (renderer1 != null) {
                        renderer1.drawRangeGridline(g2, this, 
                                getRangeAxis(), dataArea, tick.getValue());
                    }
                }
            }
        }
    }
}
 
Example 15
Source File: CategoryPlot.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example 16
Source File: CategoryPlot.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example 17
Source File: CategoryPlot.java    From buffer_bci with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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) {
            // the method we want isn't in the CategoryItemRenderer
            // 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());
            }
        }
    }
}
 
Example 18
Source File: CategoryPlot.java    From SIMVA-SoS with Apache License 2.0 4 votes vote down vote up
/**
 * 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) {
            // the method we want isn't in the CategoryItemRenderer
            // 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());
            }
        }
    }
}
 
Example 19
Source File: CategoryPlot.java    From buffer_bci with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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) {
            // the method we want isn't in the CategoryItemRenderer
            // 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());
            }
        }
    }
}
 
Example 20
Source File: CategoryPlot.java    From ECG-Viewer with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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) {
            // the method we want isn't in the CategoryItemRenderer
            // 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());
            }
        }
    }
}