1. /* ===========================================================
  2. * JFreeChart : a free chart library for the Java(tm) platform
  3. * ===========================================================
  4. *
  5. * (C) Copyright 2000-2005, 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 License
  20. * along with this library; if not, write to the Free Software Foundation,
  21. * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  22. *
  23. * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
  24. * in the United States and other countries.]
  25. *
  26. * ----------------------
  27. * PolarItemRenderer.java
  28. * ----------------------
  29. * (C) Copyright 2004, by Solution Engineering, Inc. and Contributors.
  30. *
  31. * Original Author: Daniel Bridenbecker, Solution Engineering, Inc.;
  32. * Contributor(s): David Gilbert (for Object Refinery Limited);
  33. *
  34. * $Id: PolarItemRenderer.java,v 1.2 2005/02/09 13:57:23 mungady Exp $
  35. *
  36. * Changes
  37. * -------
  38. * 19-Jan-2004 : Version 1, contributed by DB with minor changes by DG (DG);
  39. *
  40. */
  41. package org.jfree.chart.renderer;
  42. import java.awt.Graphics2D;
  43. import java.awt.geom.Rectangle2D;
  44. import java.util.List;
  45. import org.jfree.chart.LegendItem;
  46. import org.jfree.chart.axis.ValueAxis;
  47. import org.jfree.chart.event.RendererChangeListener;
  48. import org.jfree.chart.plot.PlotRenderingInfo;
  49. import org.jfree.chart.plot.PolarPlot;
  50. import org.jfree.data.xy.XYDataset;
  51. /**
  52. * The interface for a renderer that can be used by the {@link PolarPlot} class.
  53. */
  54. public interface PolarItemRenderer {
  55. /**
  56. * Plots the data for a given series.
  57. *
  58. * @param g2 the drawing surface.
  59. * @param dataArea the data area.
  60. * @param info collects plot rendering info.
  61. * @param plot the plot.
  62. * @param dataset the dataset.
  63. * @param seriesIndex the series index.
  64. */
  65. public void drawSeries(Graphics2D g2,
  66. Rectangle2D dataArea,
  67. PlotRenderingInfo info,
  68. PolarPlot plot,
  69. XYDataset dataset,
  70. int seriesIndex);
  71. /**
  72. * Draw the angular gridlines - the spokes.
  73. *
  74. * @param g2 the drawing surface.
  75. * @param plot the plot.
  76. * @param ticks the ticks.
  77. * @param dataArea the data area.
  78. */
  79. public void drawAngularGridLines(Graphics2D g2,
  80. PolarPlot plot,
  81. List ticks,
  82. Rectangle2D dataArea);
  83. /**
  84. * Draw the radial gridlines - the rings.
  85. *
  86. * @param g2 the drawing surface.
  87. * @param plot the plot.
  88. * @param radialAxis the radial axis.
  89. * @param ticks the ticks.
  90. * @param dataArea the data area.
  91. */
  92. public void drawRadialGridLines(Graphics2D g2,
  93. PolarPlot plot,
  94. //RadialAxis radialAxis,
  95. ValueAxis radialAxis,
  96. List ticks,
  97. Rectangle2D dataArea);
  98. /**
  99. * 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. * Returns the plot that this renderer has been assigned to.
  108. *
  109. * @return the plot.
  110. */
  111. public PolarPlot getPlot();
  112. /**
  113. * Sets the plot that this renderer is assigned to.
  114. * <P>
  115. * This method will be called by the plot class...you do not need to call
  116. * it yourself.
  117. *
  118. * @param plot the plot.
  119. */
  120. public void setPlot(PolarPlot plot);
  121. /**
  122. * Adds a change listener.
  123. *
  124. * @param listener the listener.
  125. */
  126. public void addChangeListener(RendererChangeListener listener);
  127. /**
  128. * Removes a change listener.
  129. *
  130. * @param listener the listener.
  131. */
  132. public void removeChangeListener(RendererChangeListener listener);
  133. }