KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfree > chart > labels > CategoryItemLabelGenerator


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  * CategoryItemLabelGenerator.java
28  * -------------------------------
29  * (C) Copyright 2001-2005, by Object Refinery Limited.
30  *
31  * Original Author: David Gilbert (for Object Refinery Limited);
32  * Contributor(s): -;
33  *
34  * $Id: CategoryItemLabelGenerator.java,v 1.1 2005/04/20 22:19:11 mungady Exp $
35  *
36  * Changes
37  * -------
38  * 13-Dec-2001 : Version 1 (DG);
39  * 16-Jan-2002 : Completed Javadocs (DG);
40  * 26-Sep-2002 : Fixed errors reported by Checkstyle (DG);
41  * 24-Oct-2002 : Method now specifies category index (DG);
42  * 05-Nov-2002 : Replaced reference to CategoryDataset with TableDataset (DG);
43  * 21-Jan-2003 : TableDataset merged with CategoryDataset (DG);
44  * 10-Apr-2003 : Changed CategoryDataset --> KeyedValues2DDataset (DG);
45  * 01-May-2003 : Added generateValueLabel() method (with a plan to renaming
46  * this interface to reflect its more general use) (DG);
47  * 09-Jun-2003 : Renamed CategoryToolTipGenerator
48  * --> CategoryItemLabelGenerator (DG);
49  * 13-Aug-2003 : Added clone() method (DG);
50  * 12-Feb-2004 : Removed clone() method (DG);
51  * 15-Apr-2004 : Moved generateToolTip() method into CategoryToolTipGenerator
52  * interface (DG);
53  * 11-May-2004 : Renamed CategoryItemLabelGenerator
54  * --> CategoryLabelGenerator (DG);
55  * 31-Jan-2005 : Added generateRowLabel() and generateColumnLabel()
56  * methods (DG);
57  * 20-Apr-2005 : Reverted name change of 11-May-2004 (DG);
58  *
59  */

60
61 package org.jfree.chart.labels;
62
63 import org.jfree.data.category.CategoryDataset;
64
65 /**
66  * A <i>category item label generator</i> is an object that can be assigned to a
67  * {@link org.jfree.chart.renderer.category.CategoryItemRenderer} and that
68  * assumes responsibility for creating text items to be used as labels for the
69  * items in a {@link org.jfree.chart.plot.CategoryPlot}.
70  * <p>
71  * To assist with cloning charts, classes that implement this interface should
72  * also implement the {@link org.jfree.util.PublicCloneable} interface.
73  */

74 public interface CategoryItemLabelGenerator {
75
76     /**
77      * Generates a label for the specified row.
78      *
79      * @param dataset the dataset (<code>null</code> not permitted).
80      * @param row the row index (zero-based).
81      *
82      * @return The label.
83      */

84     public String JavaDoc generateRowLabel(CategoryDataset dataset, int row);
85     
86     /**
87      * Generates a label for the specified row.
88      *
89      * @param dataset the dataset (<code>null</code> not permitted).
90      * @param column the column index (zero-based).
91      *
92      * @return The label.
93      */

94     public String JavaDoc generateColumnLabel(CategoryDataset dataset, int column);
95     
96     /**
97      * Generates a label for the specified item. The label is typically a
98      * formatted version of the data value, but any text can be used.
99      *
100      * @param dataset the dataset (<code>null</code> not permitted).
101      * @param row the row index (zero-based).
102      * @param column the column index (zero-based).
103      *
104      * @return The label (possibly <code>null</code>).
105      */

106     public String JavaDoc generateLabel(CategoryDataset dataset, int row, int column);
107     
108 }
109
Popular Tags