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, 072 Rectangle2D dataArea, 073 PlotRenderingInfo info, 074 PolarPlot plot, 075 XYDataset dataset, 076 int seriesIndex); 077 078 /** 079 * Draw the angular gridlines - the spokes. 080 * 081 * @param g2 the drawing surface. 082 * @param plot the plot. 083 * @param ticks the ticks. 084 * @param dataArea the data area. 085 */ 086 public void drawAngularGridLines(Graphics2D g2, 087 PolarPlot plot, 088 List ticks, 089 Rectangle2D dataArea); 090 091 /** 092 * Draw the radial gridlines - the rings. 093 * 094 * @param g2 the drawing surface. 095 * @param plot the plot. 096 * @param radialAxis the radial axis. 097 * @param ticks the ticks. 098 * @param dataArea the data area. 099 */ 100 public void drawRadialGridLines(Graphics2D g2, 101 PolarPlot plot, 102 ValueAxis radialAxis, 103 List ticks, 104 Rectangle2D dataArea); 105 106 /** 107 * Return the legend for the given series. 108 * 109 * @param series the series index. 110 * 111 * @return The legend item. 112 */ 113 public LegendItem getLegendItem(int series); 114 115 /** 116 * Returns the plot that this renderer has been assigned to. 117 * 118 * @return The plot. 119 */ 120 public PolarPlot getPlot(); 121 122 /** 123 * Sets the plot that this renderer is assigned to. 124 * <P> 125 * This method will be called by the plot class...you do not need to call 126 * it yourself. 127 * 128 * @param plot the plot. 129 */ 130 public void setPlot(PolarPlot plot); 131 132 /** 133 * Adds a change listener. 134 * 135 * @param listener the listener. 136 */ 137 public void addChangeListener(RendererChangeListener listener); 138 139 /** 140 * Removes a change listener. 141 * 142 * @param listener the listener. 143 */ 144 public void removeChangeListener(RendererChangeListener listener); 145 146 147 }