KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > gvt > RootGraphicsNode


1 /*
2
3    Copyright 2000-2003 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.gvt;
19
20 import java.util.LinkedList JavaDoc;
21 import java.util.List JavaDoc;
22
23 import org.apache.batik.gvt.event.GraphicsNodeChangeListener;
24
25 /**
26  * The top-level graphics node of the GVT tree.
27  *
28  * @author <a HREF="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
29  * @version $Id: RootGraphicsNode.java,v 1.9 2004/08/18 07:14:27 vhardy Exp $
30  */

31 public class RootGraphicsNode extends CompositeGraphicsNode {
32
33     List JavaDoc treeGraphicsNodeChangeListeners = null;
34
35    /**
36      * Constructs a new empty <tt>RootGraphicsNode</tt>.
37      */

38     public RootGraphicsNode() {}
39
40     /**
41      * Returns the root of the GVT tree or null if the node is not
42      * part of a GVT tree.
43      */

44     public RootGraphicsNode getRoot() {
45         return this;
46     }
47
48     public List JavaDoc getTreeGraphicsNodeChangeListeners() {
49         if (treeGraphicsNodeChangeListeners == null) {
50             treeGraphicsNodeChangeListeners = new LinkedList JavaDoc();
51         }
52         return treeGraphicsNodeChangeListeners;
53     }
54
55     public void addTreeGraphicsNodeChangeListener
56         (GraphicsNodeChangeListener l) {
57         getTreeGraphicsNodeChangeListeners().add(l);
58     }
59
60     public void removeTreeGraphicsNodeChangeListener
61         (GraphicsNodeChangeListener l) {
62         getTreeGraphicsNodeChangeListeners().remove(l);
63     }
64
65 }
66
Popular Tags