1 /* ====================================== 2 * JFreeChart : a free Java chart library 3 * ====================================== 4 * 5 * Project Info: http://www.jfree.org/jfreechart/index.html 6 * Project Lead: David Gilbert (david.gilbert@object-refinery.com); 7 * 8 * (C) Copyright 2000-2003, by Object Refinery Limited and Contributors. 9 * 10 * This library is free software; you can redistribute it and/or modify it under the terms 11 * of the GNU Lesser General Public License as published by the Free Software Foundation; 12 * either version 2.1 of the License, or (at your option) any later version. 13 * 14 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 15 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 * See the GNU Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public License along with this 19 * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 * Boston, MA 02111-1307, USA. 21 * 22 * -------------------------- 23 * PieItemLabelGenerator.java 24 * -------------------------- 25 * (C) Copyright 2001-2003, by Object Refinery Limited. 26 * 27 * Original Author: David Gilbert (for Object Refinery Limited); 28 * Contributor(s): -; 29 * 30 * $Id: PieItemLabelGenerator.java,v 1.3 2003/11/11 15:12:18 mungady Exp $ 31 * 32 * Changes 33 * ------- 34 * 13-Dec-2001 : Version 1 (DG); 35 * 16-Jan-2002 : Completed Javadocs (DG); 36 * 26-Sep-2002 : Fixed errors reported by Checkstyle (DG); 37 * 30-Oct-2002 : Category is now a Comparable instance (DG); 38 * 07-Mar-2003 : Changed to KeyedValuesDataset and added pieIndex parameter (DG); 39 * 21-Mar-2003 : Updated Javadocs (DG); 40 * 24-Apr-2003 : Switched around PieDataset and KeyedValuesDataset (DG); 41 * 13-Aug-2003 : Added clone() method (DG); 42 * 19-Aug-2003 : Renamed PieToolTipGenerator --> PieItemLabelGenerator (DG); 43 * 11-Nov-2003 : Removed clone() method (DG); 44 * 45 */ 46 47 package org.jfree.chart.labels; 48 49 import org.jfree.data.PieDataset; 50 51 /** 52 * Interface for a label generator for plots that use data from a {@link PieDataset}. 53 * 54 * @author David Gilbert 55 */ 56 public interface PieItemLabelGenerator { 57 58 /** 59 * Generates a tool tip text item for a particular category in the dataset. 60 * 61 * @param data the dataset. 62 * @param key the item key. 63 * @param pieIndex the pie index (differentiates between pies in a 'multi' pie chart). 64 * 65 * @return The tool tip text. 66 */ 67 public String generateToolTip(PieDataset data, Comparable key, int pieIndex); 68 69 } 70