KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejtools > graph > renderer > AbstractGraphRenderer


1 /*
2  * EJTools, the Enterprise Java Tools
3  *
4  * Distributable under LGPL license.
5  * See terms of license at www.gnu.org.
6  */

7 package org.ejtools.graph.renderer;
8
9 import java.awt.Graphics JavaDoc;
10
11 import javax.swing.JComponent JavaDoc;
12
13 import org.ejtools.graph.GraphElement;
14 import org.ejtools.graph.GraphRenderer;
15
16 /**
17  * @author Laurent Etiemble
18  * @version $Revision: 1.7 $
19  * @todo Javadoc to complete
20  */

21 public abstract class AbstractGraphRenderer extends JComponent JavaDoc implements GraphRenderer
22 {
23    /** Description of the Field */
24    protected GraphElement element = null;
25    /** Description of the Field */
26    protected double horizontalScale = 1.0d;
27    /** Description of the Field */
28    protected int horizontalScaling = ALIGN_RIGHT;
29    /** Description of the Field */
30    protected double verticalScale = 1.0d;
31    /** Description of the Field */
32    protected int verticalScaling = BOUNDED;
33
34
35    /** Constructor for TrackRenderer. */
36    public AbstractGraphRenderer()
37    {
38       super();
39    }
40
41
42    /**
43     * @param element The new graphElement value
44     */

45    public void setGraphElement(GraphElement element)
46    {
47       this.element = element;
48    }
49
50
51    /**
52     * @param multiplier The new horizontalScale value
53     */

54    public void setHorizontalScale(double multiplier)
55    {
56       this.horizontalScale = multiplier;
57    }
58
59
60    /**
61     * @param type The new horizontalScaling value
62     */

63    public void setHorizontalScaling(int type)
64    {
65       this.horizontalScaling = type;
66    }
67
68
69    /**
70     * @param multiplier The new verticalScale value
71     */

72    public void setVerticalScale(double multiplier)
73    {
74       this.verticalScale = multiplier;
75    }
76
77
78    /**
79     * @param type The new verticalScaling value
80     */

81    public void setVerticalScaling(int type) { }
82
83
84    /**
85     * @param graphics Description of the Parameter
86     */

87    protected abstract void paintComponent(Graphics JavaDoc graphics);
88 }
89
Popular Tags