    001    /* ===========================================================
    002     * JFreeChart : a free chart library for the Java(tm) platform
    003     * ===========================================================
    004     *
    005     * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors.
    006     *
    007     * Project Info:  http://www.jfree.org/jfreechart/index.html
    008     *
    009     * This library is free software; you can redistribute it and/or modify it
    010     * under the terms of the GNU Lesser General Public License as published by
    011     * the Free Software Foundation; either version 2.1 of the License, or
    012     * (at your option) any later version.
    013     *
    014     * This library is distributed in the hope that it will be useful, but
    015     * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    016     * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
    017     * License for more details.
    018     *
    019     * You should have received a copy of the GNU Lesser General Public
    020     * License along with this library; if not, write to the Free Software
    021     * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
    022     * USA.
    023     *
    024     * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
    025     * in the United States and other countries.]
    026     *
    027     * ----------------------
    028     * PolarItemRenderer.java
    029     * ----------------------
    030     * (C) Copyright 2004, 2007, by Solution Engineering, Inc. and Contributors.
    031     *
    032     * Original Author:  Daniel Bridenbecker, Solution Engineering, Inc.;
    033     * Contributor(s):   David Gilbert (for Object Refinery Limited);
    034     *
    035     * Changes
    036     * -------
    037     * 19-Jan-2004 : Version 1, contributed by DB with minor changes by DG (DG);
    038     *
    039     */
    040
    041    package org.jfree.chart.renderer;
    042
    043    import java.awt.Graphics2D;
    044    import java.awt.geom.Rectangle2D;
    045    import java.util.List;
    046
    047    import org.jfree.chart.LegendItem;
    048    import org.jfree.chart.axis.ValueAxis;
    049    import org.jfree.chart.event.RendererChangeListener;
    050    import org.jfree.chart.plot.PlotRenderingInfo;
    051    import org.jfree.chart.plot.PolarPlot;
    052    import org.jfree.data.xy.XYDataset;
    053
    054    /**
    055     * The interface for a renderer that can be used by the {@link PolarPlot} class.
    056     */
    057    public interface PolarItemRenderer {
    058
    059        /**
    060         * Plots the data for a given series.
    061         *
    062         * @param g2  the drawing surface.
    063         * @param dataArea  the data area.
    064         * @param info  collects plot rendering info.
    065         * @param plot  the plot.
    066         * @param dataset  the dataset.
    067         * @param seriesIndex  the series index.
    068         */
    069        public void drawSeries(Graphics2D g2,
    070                               Rectangle2D dataArea,
    071                               PlotRenderingInfo info,
    072                               PolarPlot plot,
    073                               XYDataset dataset,
    074                               int seriesIndex);
    075
    076        /**
    077         * Draw the angular gridlines - the spokes.
    078         *
    079         * @param g2  the drawing surface.
    080         * @param plot  the plot.
    081         * @param ticks  the ticks.
    082         * @param dataArea  the data area.
    083         */
    084        public void drawAngularGridLines(Graphics2D g2,
    085                                         PolarPlot plot,
    086                                         List ticks,
    087                                         Rectangle2D dataArea);
    088
    089        /**
    090         * Draw the radial gridlines - the rings.
    091         *
    092         * @param g2  the drawing surface.
    093         * @param plot  the plot.
    094         * @param radialAxis  the radial axis.
    095         * @param ticks  the ticks.
    096         * @param dataArea  the data area.
    097         */
    098        public void drawRadialGridLines(Graphics2D g2,
    099                                        PolarPlot plot,
    100                                        ValueAxis radialAxis,
    101                                        List ticks,
    102                                        Rectangle2D dataArea);
    103
    104        /**
    105         * Return the legend for the given series.
    106         *
    107         * @param series  the series index.
    108         *
    109         * @return The legend item.
    110         */
    111        public LegendItem getLegendItem(int series);
    112
    113        /**
    114         * Returns the plot that this renderer has been assigned to.
    115         *
    116         * @return The plot.
    117         */
    118        public PolarPlot getPlot();
    119
    120        /**
    121         * Sets the plot that this renderer is assigned to.
    122         * <P>
    123         * This method will be called by the plot class...you do not need to call
    124         * it yourself.
    125         *
    126         * @param plot  the plot.
    127         */
    128        public void setPlot(PolarPlot plot);
    129
    130        /**
    131         * Adds a change listener.
    132         *
    133         * @param listener  the listener.
    134         */
    135        public void addChangeListener(RendererChangeListener listener);
    136
    137        /**
    138         * Removes a change listener.
    139         *
    140         * @param listener  the listener.
    141         */
    142        public void removeChangeListener(RendererChangeListener listener);
    143
    144
    145    }