KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > bridge > svg12 > SVG12BridgeExtension


1 /*
2
3    Copyright 2001-2002,2004-2005 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.bridge.svg12;
19
20 import java.util.Collections JavaDoc;
21 import java.util.Iterator JavaDoc;
22
23 import org.apache.batik.bridge.BridgeContext;
24 import org.apache.batik.bridge.SVGBridgeExtension;
25 import org.apache.batik.util.SVGConstants;
26 import org.w3c.dom.Element JavaDoc;
27
28 /**
29  * This is a Service interface for classes that want to extend the
30  * functionality of the Bridge, to support new tags in the rendering tree.
31  */

32 public class SVG12BridgeExtension extends SVGBridgeExtension {
33
34     /**
35      * Return the priority of this Extension. Extensions are
36      * registered from lowest to highest priority. So if for some
37      * reason you need to come before/after another existing extension
38      * make sure your priority is lower/higher than theirs.
39      */

40     public float getPriority() { return 0f; }
41
42     /**
43      * This should return the list of extensions implemented
44      * by this BridgeExtension.
45      * @return An iterator containing strings one for each implemented
46      * extension.
47      */

48     public Iterator JavaDoc getImplementedExtensions() {
49         return Collections.EMPTY_LIST.iterator();
50     }
51
52     /**
53      * This should return the individual or company name responsible
54      * for the this implementation of the extension.
55      */

56     public String JavaDoc getAuthor() {
57         return "The Apache Batik Team.";
58     }
59
60     /**
61      * This should contain a contact address (usually an e-mail address).
62      */

63     public String JavaDoc getContactAddress() {
64         return "batik-dev@xmlgraphics.apache.org";
65     }
66
67     /**
68      * This should return a URL where information can be obtained on
69      * this extension.
70      */

71     public String JavaDoc getURL() {
72         return "http://xml.apache.org/batik";
73     }
74
75     /**
76      * Human readable description of the extension.
77      * Perhaps that should be a resource for internationalization?
78      * (although I suppose it could be done internally)
79      */

80     public String JavaDoc getDescription() {
81         return "The required SVG 1.2 tags";
82     }
83
84     /**
85      * This method should update the BridgeContext with support
86      * for the tags in this extension. In some rare cases it may
87      * be necessary to replace existing tag handlers, although this
88      * is discouraged.
89      *
90      * @param ctx The BridgeContext instance to be updated
91      */

92     public void registerTags(BridgeContext ctx) {
93         // bridges to handle elements in the SVG namespace
94
super.registerTags(ctx);
95
96         ctx.putBridge(new SVGFlowRootElementBridge());
97         ctx.putBridge(new SVGMultiImageElementBridge());
98         ctx.putBridge(new SVGSolidColorElementBridge());
99     }
100 }
101
Popular Tags