KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2
3    Copyright 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.SVGPointList;
22
23 /**
24  * This class provide support for the SVGAnimatedPoints
25  * interface.
26  *
27  * @author <a HREF="mailto:nicolas.socheleau@bitflash.com">Nicolas Socheleau</a>
28  * @version $Id: SVGAnimatedPointsSupport.java,v 1.5 2004/08/18 07:13:13 vhardy Exp $
29  */

30 public class SVGAnimatedPointsSupport {
31
32     /**
33      * Default value for the 'points' attribute.
34      */

35     public static final String JavaDoc POINTS_DEFAULT_VALUE
36         = "";
37
38     /**
39      * <b>DOM</b>: Implements {@link
40      * org.w3c.dom.svg.SVGAnimatedPoints#getPoints()}.
41      */

42     public static SVGPointList getPoints(AbstractElement e){
43         SVGOMAnimatedPoints result =(SVGOMAnimatedPoints)
44             e.getLiveAttributeValue(null, SVGConstants.SVG_POINTS_ATTRIBUTE);
45         if (result == null) {
46             result = new SVGOMAnimatedPoints(e, null,
47                                              SVGConstants.SVG_POINTS_ATTRIBUTE,
48                                              POINTS_DEFAULT_VALUE);
49             e.putLiveAttributeValue(null,
50                                     SVGConstants.SVG_POINTS_ATTRIBUTE, result);
51         }
52         return result.getPoints();
53     }
54
55
56     /**
57      * <b>DOM</b>: Implements {@link
58      * org.w3c.dom.svg.SVGAnimatedPoints#getAnimatedPoints()}.
59      */

60     public static SVGPointList getAnimatedPoints(AbstractElement e){
61
62         SVGOMAnimatedPoints result =(SVGOMAnimatedPoints)
63             e.getLiveAttributeValue(null, SVGConstants.SVG_POINTS_ATTRIBUTE);
64         if (result == null) {
65             result = new SVGOMAnimatedPoints(e, null,
66                                              SVGConstants.SVG_POINTS_ATTRIBUTE,
67                                              POINTS_DEFAULT_VALUE);
68             e.putLiveAttributeValue(null,
69                                     SVGConstants.SVG_POINTS_ATTRIBUTE, result);
70         }
71         return result.getAnimatedPoints();
72     }
73
74 }
75
Popular Tags