Java Code Examples for org.jfree.chart.renderer.category.AbstractCategoryItemRenderer#drawRangeLine()

The following examples show how to use org.jfree.chart.renderer.category.AbstractCategoryItemRenderer#drawRangeLine() . 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: CategoryPlot.java    From openstock 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 2
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 3
Source File: CategoryPlot.java    From SIMVA-SoS with Apache License 2.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 4
Source File: CategoryPlot.java    From ECG-Viewer with GNU General Public License v2.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 5
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 6
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 7
Source File: CategoryPlot.java    From openstock 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 8
Source File: CategoryPlot.java    From ccu-historian 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 9
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 10
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());
            }
        }
    }
}
 
Example 11
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 12
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());
            }
        }
    }
}