KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2
3    Copyright 2000-2001,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.util.SVGConstants;
21 import org.w3c.dom.svg.SVGAnimatedTransformList;
22
23 /**
24  * This class provides support for the SVGTransformable interface.
25  *
26  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
27  * @version $Id: SVGTransformableSupport.java,v 1.7 2004/08/18 07:13:19 vhardy Exp $
28  */

29 public class SVGTransformableSupport {
30     /**
31      * Creates a new SVGTransformableSupport.
32      */

33     public SVGTransformableSupport() {
34     }
35     
36     /**
37      * Default value for the 'transform' attribute.
38      */

39     public static final String JavaDoc TRANSFORM_DEFAULT_VALUE
40         = "";
41
42     /**
43      * To implement {@link
44      * org.w3c.dom.svg.SVGTransformable#getTransform()}.
45      */

46     public static SVGAnimatedTransformList getTransform(AbstractElement elt) {
47         SVGOMAnimatedTransformList result =(SVGOMAnimatedTransformList)
48             elt.getLiveAttributeValue(null, SVGConstants.SVG_TRANSFORM_ATTRIBUTE);
49         if (result == null) {
50             result = new SVGOMAnimatedTransformList(elt, null,
51                                                     SVGConstants.SVG_TRANSFORM_ATTRIBUTE,
52                                                     TRANSFORM_DEFAULT_VALUE);
53             elt.putLiveAttributeValue(null,
54                                       SVGConstants.SVG_TRANSFORM_ATTRIBUTE,
55                                       result);
56         }
57         return result;
58
59     }
60 }
61
Popular Tags