Source for org.jfree.chart.renderer.PolarItemRenderer

   1: /* ===========================================================
   2:  * JFreeChart : a free chart library for the Java(tm) platform
   3:  * ===========================================================
   4:  *
   5:  * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors.
   6:  *
   7:  * Project Info:  http://www.jfree.org/jfreechart/index.html
   8:  *
   9:  * This library is free software; you can redistribute it and/or modify it 
  10:  * under the terms of the GNU Lesser General Public License as published by 
  11:  * the Free Software Foundation; either version 2.1 of the License, or 
  12:  * (at your option) any later version.
  13:  *
  14:  * This library is distributed in the hope that it will be useful, but 
  15:  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
  16:  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 
  17:  * License for more details.
  18:  *
  19:  * You should have received a copy of the GNU Lesser General Public
  20:  * License along with this library; if not, write to the Free Software
  21:  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
  22:  * USA.  
  23:  *
  24:  * [Java is a trademark or registered trademark of Sun Microsystems, Inc. 
  25:  * in the United States and other countries.]
  26:  *
  27:  * ----------------------
  28:  * PolarItemRenderer.java
  29:  * ----------------------
  30:  * (C) Copyright 2004, 2007, by Solution Engineering, Inc. and Contributors.
  31:  *
  32:  * Original Author:  Daniel Bridenbecker, Solution Engineering, Inc.;
  33:  * Contributor(s):   David Gilbert (for Object Refinery Limited);
  34:  *
  35:  * Changes
  36:  * -------
  37:  * 19-Jan-2004 : Version 1, contributed by DB with minor changes by DG (DG);
  38:  *
  39:  */
  40: 
  41: package org.jfree.chart.renderer;
  42: 
  43: import java.awt.Graphics2D;
  44: import java.awt.geom.Rectangle2D;
  45: import java.util.List;
  46: 
  47: import org.jfree.chart.LegendItem;
  48: import org.jfree.chart.axis.ValueAxis;
  49: import org.jfree.chart.event.RendererChangeListener;
  50: import org.jfree.chart.plot.PlotRenderingInfo;
  51: import org.jfree.chart.plot.PolarPlot;
  52: import org.jfree.data.xy.XYDataset;
  53: 
  54: /**
  55:  * The interface for a renderer that can be used by the {@link PolarPlot} class.
  56:  */
  57: public interface PolarItemRenderer {
  58:     
  59:     /**
  60:      * Plots the data for a given series.
  61:      * 
  62:      * @param g2  the drawing surface.
  63:      * @param dataArea  the data area.
  64:      * @param info  collects plot rendering info.
  65:      * @param plot  the plot.
  66:      * @param dataset  the dataset.
  67:      * @param seriesIndex  the series index.
  68:      */
  69:     public void drawSeries(Graphics2D g2, 
  70:                            Rectangle2D dataArea, 
  71:                            PlotRenderingInfo info,
  72:                            PolarPlot plot,
  73:                            XYDataset dataset,
  74:                            int seriesIndex);
  75:     
  76:     /**
  77:      * Draw the angular gridlines - the spokes.
  78:      * 
  79:      * @param g2  the drawing surface.
  80:      * @param plot  the plot.
  81:      * @param ticks  the ticks.
  82:      * @param dataArea  the data area.
  83:      */
  84:     public void drawAngularGridLines(Graphics2D g2, 
  85:                                      PolarPlot plot, 
  86:                                      List ticks,
  87:                                      Rectangle2D dataArea);
  88:     
  89:     /**
  90:      * Draw the radial gridlines - the rings.
  91:      * 
  92:      * @param g2  the drawing surface.
  93:      * @param plot  the plot.
  94:      * @param radialAxis  the radial axis.
  95:      * @param ticks  the ticks.
  96:      * @param dataArea  the data area.
  97:      */
  98:     public void drawRadialGridLines(Graphics2D g2, 
  99:                                     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: }