KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > progra > charting > Chart


1 /*
2     JOpenChart Java Charting Library and Toolkit
3     Copyright (C) 2001 Sebastian Müller
4     http://jopenchart.sourceforge.net
5
6     This library is free software; you can redistribute it and/or
7     modify it under the terms of the GNU Lesser General Public
8     License as published by the Free Software Foundation; either
9     version 2.1 of the License, or (at your option) any later version.
10
11     This library is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14     Lesser General Public License for more details.
15
16     You should have received a copy of the GNU Lesser General Public
17     License along with this library; if not, write to the Free Software
18     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
20     Chart.java
21     Created on 21. Juni 2001, 12:47
22  */

23
24 package de.progra.charting;
25
26 import de.progra.charting.render.AbstractChartRenderer;
27 import java.awt.Rectangle JavaDoc;
28 import de.progra.charting.model.ChartDataModel;
29 import java.awt.Graphics2D JavaDoc;
30
31 /**
32  * This class defines the methods to access a chart. It provides methods
33  * to set the multiple chart components. You can set multiple ChartRenderer
34  * giving them a z-coordinate. The ChartRenderer that is rendered first is
35  * the one with the lowest z-coordinate.
36  * @author mueller
37  * @version 1.0
38  */

39 public interface Chart {
40     
41     /** Sets the legend for this chart.
42      * @param l The Legend this Chart contains.
43      */

44     public void setLegend(Legend l);
45     
46     /** Returns this chart's legend.
47      * @return the Legend for this Chart. Could be <CODE>null</CODE>.
48      */

49     public Legend getLegend();
50     
51     /** Sets the title for this chart.
52      * @param t This Chart's Title.
53      */

54     public void setTitle(Title t);
55     
56     /** Returns the title for this chart.
57      * @return this Chart's Title. Could be <CODE>null</CODE>.
58      */

59     public Title getTitle();
60     
61     /** Sets the coordinate system for this chart,
62      * which can be null if the ChartRenderer
63      * doesn't need a coordinate system, e.g. if it's a
64      * PieChart.
65      * @param c The Coordinate System for the Chart.
66      */

67     public void setCoordSystem(CoordSystem c);
68     
69     /** Returns the coordinate system.
70      * @return the Coordinate System for the Chart. Could be <CODE>null</CODE>.
71      */

72     public CoordSystem getCoordSystem();
73     
74     /** Sets the Map with all ChartRenderers. The keys
75      * have to be the z-coordinates of the ChartRenderers.
76      * @param renderer The Map of ChartRenderers.
77      */

78     public void setChartRenderer(java.util.Map JavaDoc renderer);
79     
80     /** Returns the Map of all ChartRenderers.
81      * @return the Map of Renderers.
82      */

83     public java.util.Map JavaDoc getChartRenderer();
84     
85     /** Adds a ChartRenderer with a specific z-coordinate.
86      * @param renderer the ChartRenderer
87      * @param z its z-coordinate.
88      */

89     public void addChartRenderer(AbstractChartRenderer renderer, int z);
90     
91     /** Returns the ChartRenderer with a specific z-coordinate.
92      * @param z the z-coordinate of the desired ChartRenderer.
93      * @return the ChartRenderer or <CODE>null</CODE> if none has been found.
94      */

95     public AbstractChartRenderer getChartRenderer(int z);
96     
97     /** Stores the ChartDataModel for this Chart.
98      * @param model the ChartDataModel
99      */

100     public void setChartDataModel(ChartDataModel model);
101     
102     /** Returns the ChartDataModel.
103      * @return the ChartDataModel
104      */

105     public ChartDataModel getChartDataModel();
106     
107     /** Sets the Bounds for this Chart.
108      * @param r the <CODE>Rectangle</CODE> object defining the bounds
109      */

110     public void setBounds(Rectangle JavaDoc r);
111     
112     /** Returns the Bounds for the Chart.
113      * @return the bounds
114      */

115     public Rectangle JavaDoc getBounds();
116     
117     /** Does the layout of the title, legend and coordinate system and
118      * calls the render method of all those including the ChartRenderers.
119      * @param g the <CODE>Graphics2D</CODE> object to paint in.
120      */

121     public void render(Graphics2D JavaDoc g);
122 }
123
124
Popular Tags