KickJava   Java API By Example, From Geeks To Geeks.

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


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.GridBagConstraints JavaDoc;
10 import java.awt.GridBagLayout JavaDoc;
11
12 import javax.swing.JComponent JavaDoc;
13
14 import org.ejtools.graph.GraphRenderer;
15
16 /**
17  * @author Laurent Etiemble
18  * @version $Revision: 1.6 $
19  * @todo Javadoc to complete
20  */

21 public class GridBagLayoutRenderer extends JPanelGraphRenderer
22 {
23    /** Constructor for Graph. */
24    public GridBagLayoutRenderer()
25    {
26       super(new GridBagLayout JavaDoc());
27    }
28
29
30    /**
31     * Sets the renderer attribute of the Graph object
32     *
33     * @param renderer The new renderer value
34     * @param constraints The feature to be added to the Renderer attribute
35     */

36    public void addRenderer(GraphRenderer renderer, GridBagConstraints JavaDoc constraints)
37    {
38       renderer.setGraphElement(this.element);
39       this.renderers.add(renderer);
40       this.add((JComponent JavaDoc) renderer, constraints);
41    }
42
43 }
44
Popular Tags