KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > dom > svg > SVGOMCSSImportedElementRoot


1 /*
2
3    Copyright 2002-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.dom.svg;
19
20 import org.apache.batik.css.engine.CSSImportedElementRoot;
21 import org.apache.batik.dom.AbstractDocument;
22 import org.apache.batik.dom.AbstractDocumentFragment;
23 import org.w3c.dom.Element JavaDoc;
24 import org.w3c.dom.Node JavaDoc;
25
26 /**
27  * This class implements {@link org.w3c.dom.DocumentFragment} interface.
28  * It is used to implement the SVG use element behavioUr.
29  *
30  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
31  * @version $Id: SVGOMCSSImportedElementRoot.java,v 1.5 2004/08/18 07:13:14 vhardy Exp $
32  */

33 public class SVGOMCSSImportedElementRoot
34     extends AbstractDocumentFragment
35     implements CSSImportedElementRoot {
36
37     /**
38      * The parent CSS element.
39      */

40     protected Element JavaDoc cssParentElement;
41
42     /**
43      * Indicates if the imported css element is from
44      * this document.
45      */

46     protected boolean isLocal;
47
48     /**
49      * Creates a new DocumentFragment object.
50      */

51     protected SVGOMCSSImportedElementRoot() {
52     }
53
54     /**
55      * Creates a new DocumentFragment object.
56      */

57     public SVGOMCSSImportedElementRoot(AbstractDocument owner,
58                                        Element JavaDoc parent,
59                                        boolean isLocal) {
60     ownerDocument = owner;
61         cssParentElement = parent;
62         this.isLocal = isLocal;
63     }
64
65     /**
66      * Tests whether this node is readonly.
67      */

68     public boolean isReadonly() {
69         return false;
70     }
71
72     /**
73      * Sets this node readonly attribute.
74      */

75     public void setReadonly(boolean v) {
76     }
77
78     // CSSImportedElementRoot ///////////////////////////////
79

80     /**
81      * Returns the parent of the imported element, from the CSS
82      * point of view.
83      */

84     public Element JavaDoc getCSSParentElement() {
85         return cssParentElement;
86     }
87
88
89     /**
90      * Returns true if the imported CSS tree is from this
91      * 'owner' document.
92      */

93     public boolean getIsLocal() {
94         return isLocal;
95     }
96
97     /**
98      * Returns a new uninitialized instance of this object's class.
99      */

100     protected Node JavaDoc newNode() {
101         return new SVGOMCSSImportedElementRoot();
102     }
103 }
104
Popular Tags