01: /*
02: JOpenChart Java Charting Library and Toolkit
03: Copyright (C) 2001 Sebastian Müller
04: http://jopenchart.sourceforge.net
05:
06: This library is free software; you can redistribute it and/or
07: modify it under the terms of the GNU Lesser General Public
08: License as published by the Free Software Foundation; either
09: 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: Renderer.java
21: Created on 5. Juni 2001, 17:13
22: */
23:
24: package de.progra.charting.render;
25:
26: import java.awt.Graphics2D;
27: import java.awt.Dimension;
28: import java.awt.Rectangle;
29:
30: /** This interface defines the common methods needed for a Renderer class. This
31: * contains methods to define specific options, set/get the rendering size and
32: * to finally render something.
33: */
34: public interface Renderer {
35:
36: /** Returns the preferred size needed for the renderer.
37: * @return a non-null Dimension object
38: */
39: public Dimension getPreferredSize();
40:
41: /** Sets the bounds the layout manager has assigned to
42: * this renderer. Those, of course, have to be
43: * considered in the rendering process.
44: * @param bounds the new bounds for the renderer.
45: */
46: public void setBounds(Rectangle bounds);
47:
48: /** Gets the bounds for this renderer.
49: * @return the bounds of this renderer. If <code>setBounds</code> has not
50: * been called before, the bounds computed from
51: * <code>getPreferredSize</code> is returned.
52: */
53: public Rectangle getBounds();
54:
55: /** Finally renders the Object in the Graphics object.
56: * @param g the Graphics2D object in which to render
57: */
58: public void render(Graphics2D g);
59: }
|