001: /* ===========================================================
002: * JFreeChart : a free chart library for the Java(tm) platform
003: * ===========================================================
004: *
005: * (C) Copyright 2000-2005, 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, 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: * $Id: PolarItemRenderer.java,v 1.3.2.2 2005/10/25 20:53:40 mungady Exp $
036: *
037: * Changes
038: * -------
039: * 19-Jan-2004 : Version 1, contributed by DB with minor changes by DG (DG);
040: *
041: */
042:
043: package org.jfree.chart.renderer;
044:
045: import java.awt.Graphics2D;
046: import java.awt.geom.Rectangle2D;
047: import java.util.List;
048:
049: import org.jfree.chart.LegendItem;
050: import org.jfree.chart.axis.ValueAxis;
051: import org.jfree.chart.event.RendererChangeListener;
052: import org.jfree.chart.plot.PlotRenderingInfo;
053: import org.jfree.chart.plot.PolarPlot;
054: import org.jfree.data.xy.XYDataset;
055:
056: /**
057: * The interface for a renderer that can be used by the {@link PolarPlot} class.
058: */
059: public interface PolarItemRenderer {
060:
061: /**
062: * Plots the data for a given series.
063: *
064: * @param g2 the drawing surface.
065: * @param dataArea the data area.
066: * @param info collects plot rendering info.
067: * @param plot the plot.
068: * @param dataset the dataset.
069: * @param seriesIndex the series index.
070: */
071: public void drawSeries(Graphics2D g2, Rectangle2D dataArea,
072: PlotRenderingInfo info, PolarPlot plot, XYDataset dataset,
073: int seriesIndex);
074:
075: /**
076: * Draw the angular gridlines - the spokes.
077: *
078: * @param g2 the drawing surface.
079: * @param plot the plot.
080: * @param ticks the ticks.
081: * @param dataArea the data area.
082: */
083: public void drawAngularGridLines(Graphics2D g2, PolarPlot plot,
084: List ticks, Rectangle2D dataArea);
085:
086: /**
087: * Draw the radial gridlines - the rings.
088: *
089: * @param g2 the drawing surface.
090: * @param plot the plot.
091: * @param radialAxis the radial axis.
092: * @param ticks the ticks.
093: * @param dataArea the data area.
094: */
095: public void drawRadialGridLines(Graphics2D g2, PolarPlot plot,
096: ValueAxis radialAxis, List ticks, Rectangle2D dataArea);
097:
098: /**
099: * Return the legend for the given series.
100: *
101: * @param series the series index.
102: *
103: * @return The legend item.
104: */
105: public LegendItem getLegendItem(int series);
106:
107: /**
108: * Returns the plot that this renderer has been assigned to.
109: *
110: * @return The plot.
111: */
112: public PolarPlot getPlot();
113:
114: /**
115: * Sets the plot that this renderer is assigned to.
116: * <P>
117: * This method will be called by the plot class...you do not need to call
118: * it yourself.
119: *
120: * @param plot the plot.
121: */
122: public void setPlot(PolarPlot plot);
123:
124: /**
125: * Adds a change listener.
126: *
127: * @param listener the listener.
128: */
129: public void addChangeListener(RendererChangeListener listener);
130:
131: /**
132: * Removes a change listener.
133: *
134: * @param listener the listener.
135: */
136: public void removeChangeListener(RendererChangeListener listener);
137:
138: }
|