KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > progra > charting > render > Renderer


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     Renderer.java
21     Created on 5. Juni 2001, 17:13
22 */

23
24 package de.progra.charting.render;
25
26 import java.awt.Graphics2D JavaDoc;
27 import java.awt.Dimension JavaDoc;
28 import java.awt.Rectangle JavaDoc;
29
30
31 /** This interface defines the common methods needed for a Renderer class. This
32  * contains methods to define specific options, set/get the rendering size and
33  * to finally render something.
34  */

35 public interface Renderer {
36     
37     /** Returns the preferred size needed for the renderer.
38      * @return a non-null Dimension object
39      */

40     public Dimension JavaDoc getPreferredSize();
41     
42     /** Sets the bounds the layout manager has assigned to
43      * this renderer. Those, of course, have to be
44      * considered in the rendering process.
45      * @param bounds the new bounds for the renderer.
46      */

47     public void setBounds(Rectangle JavaDoc bounds);
48     
49     /** Gets the bounds for this renderer.
50      * @return the bounds of this renderer. If <code>setBounds</code> has not
51      * been called before, the bounds computed from
52      * <code>getPreferredSize</code> is returned.
53      */

54     public Rectangle JavaDoc getBounds();
55     
56     /** Finally renders the Object in the Graphics object.
57      * @param g the Graphics2D object in which to render
58      */

59     public void render(Graphics2D JavaDoc g);
60 }
61
62
Popular Tags