001: /*
002: JOpenChart Java Charting Library and Toolkit
003: Copyright (C) 2001 Sebastian Müller
004: http://jopenchart.sourceforge.net
005:
006: This library is free software; you can redistribute it and/or
007: modify it under the terms of the GNU Lesser General Public
008: License as published by the Free Software Foundation; either
009: version 2.1 of the License, or (at your option) any later version.
010:
011: This library is distributed in the hope that it will be useful,
012: but WITHOUT ANY WARRANTY; without even the implied warranty of
013: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: Lesser General Public License for more details.
015:
016: You should have received a copy of the GNU Lesser General Public
017: License along with this library; if not, write to the Free Software
018: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
019:
020: Chart.java
021: Created on 21. Juni 2001, 12:47
022: */
023:
024: package de.progra.charting;
025:
026: import de.progra.charting.render.AbstractChartRenderer;
027: import java.awt.Rectangle;
028: import de.progra.charting.model.ChartDataModel;
029: import java.awt.Graphics2D;
030:
031: /**
032: * This class defines the methods to access a chart. It provides methods
033: * to set the multiple chart components. You can set multiple ChartRenderer
034: * giving them a z-coordinate. The ChartRenderer that is rendered first is
035: * the one with the lowest z-coordinate.
036: * @author mueller
037: * @version 1.0
038: */
039: public interface Chart {
040:
041: /** Sets the legend for this chart.
042: * @param l The Legend this Chart contains.
043: */
044: public void setLegend(Legend l);
045:
046: /** Returns this chart's legend.
047: * @return the Legend for this Chart. Could be <CODE>null</CODE>.
048: */
049: public Legend getLegend();
050:
051: /** Sets the title for this chart.
052: * @param t This Chart's Title.
053: */
054: public void setTitle(Title t);
055:
056: /** Returns the title for this chart.
057: * @return this Chart's Title. Could be <CODE>null</CODE>.
058: */
059: public Title getTitle();
060:
061: /** Sets the coordinate system for this chart,
062: * which can be null if the ChartRenderer
063: * doesn't need a coordinate system, e.g. if it's a
064: * PieChart.
065: * @param c The Coordinate System for the Chart.
066: */
067: public void setCoordSystem(CoordSystem c);
068:
069: /** Returns the coordinate system.
070: * @return the Coordinate System for the Chart. Could be <CODE>null</CODE>.
071: */
072: public CoordSystem getCoordSystem();
073:
074: /** Sets the Map with all ChartRenderers. The keys
075: * have to be the z-coordinates of the ChartRenderers.
076: * @param renderer The Map of ChartRenderers.
077: */
078: public void setChartRenderer(java.util.Map renderer);
079:
080: /** Returns the Map of all ChartRenderers.
081: * @return the Map of Renderers.
082: */
083: public java.util.Map getChartRenderer();
084:
085: /** Adds a ChartRenderer with a specific z-coordinate.
086: * @param renderer the ChartRenderer
087: * @param z its z-coordinate.
088: */
089: public void addChartRenderer(AbstractChartRenderer renderer, int z);
090:
091: /** Returns the ChartRenderer with a specific z-coordinate.
092: * @param z the z-coordinate of the desired ChartRenderer.
093: * @return the ChartRenderer or <CODE>null</CODE> if none has been found.
094: */
095: public AbstractChartRenderer getChartRenderer(int z);
096:
097: /** Stores the ChartDataModel for this Chart.
098: * @param model the ChartDataModel
099: */
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 r);
111:
112: /** Returns the Bounds for the Chart.
113: * @return the bounds
114: */
115: public Rectangle 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 g);
122: }
|