org.cds06.speleograph.graph.SpeleoXYPlot.java Source code

Java tutorial

Introduction

Here is the source code for org.cds06.speleograph.graph.SpeleoXYPlot.java

Source

/*
 * Copyright (c) 2013 Philippe VIENNE
 *
 * This file is a part of SpeleoGraph
 *
 * SpeleoGraph is free software: you can redistribute
 * it and/or modify it under the terms of the GNU General
 * Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your
 * option) any later version.
 *
 * SpeleoGraph is distributed in the hope that it will
 * be useful, but WITHOUT ANY WARRANTY; without even the
 * implied warranty of MERCHANTABILITY or FITNESS FOR A
 * PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with SpeleoGraph.
 * If not, see <http://www.gnu.org/licenses/>.
 */

package org.cds06.speleograph.graph;

import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.xy.XYItemRenderer;

/**
 * This file is created by PhilippeGeek.
 * Distributed on licence GNU GPL V3.
 */
public class SpeleoXYPlot extends XYPlot {

    /**
     * Returns the renderer for the primary dataset.
     *
     * @return The item renderer (possibly <code>null</code>).
     * @see #setRenderer(org.jfree.chart.renderer.xy.XYItemRenderer)
     */
    @Override
    public XYItemRenderer getRenderer() {
        XYItemRenderer result = null;
        for (int i = 0; i < getDatasetCount(); i++) {
            XYItemRenderer foundAxis = getRenderer(i);
            if (foundAxis != null)
                return foundAxis;
        }
        return result;
    }
}