1. /* ===========================================================
  2. * JFreeChart : a free chart library for the Java(tm) platform
  3. * ===========================================================
  4. *
  5. * (C) Copyright 2000-2004, 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 under the terms
  10. * of the GNU Lesser General Public License as published by the Free Software Foundation;
  11. * either version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  14. * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. * See the GNU Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public License along with this
  18. * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  19. * Boston, MA 02111-1307, USA.
  20. *
  21. * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
  22. * in the United States and other countries.]
  23. *
  24. * ---------------------
  25. * XYLabelGenerator.java
  26. * ---------------------
  27. * (C) Copyright 2001-2004, by Object Refinery Limited.
  28. *
  29. * Original Author: David Gilbert (for Object Refinery Limited);
  30. * Contributor(s): -;
  31. *
  32. * $Id: XYLabelGenerator.java,v 1.1 2004/08/31 14:36:24 mungady Exp $
  33. *
  34. * Changes
  35. * -------
  36. * 13-Dec-2001 : Version 1 (DG);
  37. * 16-Jan-2002 : Completed Javadocs (DG);
  38. * 13-Jun-2002 : Correction to Javadoc comments (DG);
  39. * 26-Sep-2002 : Fixed errors reported by Checkstyle (DG);
  40. * 25-Feb-2004 : Renamed XYToolTipGenerator --> XYItemLabelGenerator (DG);
  41. * 15-Apr-2004 : Moved the generateToolTip() method to a separate interface (DG);
  42. * 11-May-2004 : Renamed XYItemLabelGenerator --> XYLabelGenerator (DG);
  43. *
  44. */
  45. package org.jfree.chart.labels;
  46. import org.jfree.data.xy.XYDataset;
  47. /**
  48. * Interface for a label generator for plots that use data from an {@link XYDataset}.
  49. */
  50. public interface XYLabelGenerator {
  51. /**
  52. * Generates a label for the specified item. The label is typically a formatted version of
  53. * the data value, but any text can be used.
  54. *
  55. * @param dataset the dataset (<code>null</code> not permitted).
  56. * @param series the series index (zero-based).
  57. * @param item the item index (zero-based).
  58. *
  59. * @return The label (possibly <code>null</code>).
  60. */
  61. public String generateLabel(XYDataset dataset, int series, int item);
  62. }