KickJava   Java API By Example, From Geeks To Geeks.

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


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.dom.svg;
19
20 import java.net.URL JavaDoc;
21
22 import org.apache.batik.css.dom.CSSOMSVGViewCSS;
23 import org.apache.batik.css.engine.CSSContext;
24 import org.apache.batik.css.engine.CSSEngine;
25 import org.apache.batik.css.engine.SVGCSSEngine;
26 import org.apache.batik.css.engine.value.ShorthandManager;
27 import org.apache.batik.css.engine.value.ValueManager;
28 import org.apache.batik.css.parser.ExtendedParser;
29 import org.apache.batik.css.parser.ExtendedParserWrapper;
30 import org.apache.batik.dom.AbstractDocument;
31 import org.apache.batik.dom.AbstractStylableDocument;
32 import org.apache.batik.dom.ExtensibleDOMImplementation;
33 import org.apache.batik.dom.GenericDocumentType;
34 import org.apache.batik.dom.GenericElement;
35 import org.apache.batik.dom.GenericElementNS;
36 import org.apache.batik.dom.StyleSheetFactory;
37 import org.apache.batik.dom.events.DocumentEventSupport;
38 import org.apache.batik.dom.util.CSSStyleDeclarationFactory;
39 import org.apache.batik.dom.util.DOMUtilities;
40 import org.apache.batik.dom.util.HashTable;
41 import org.apache.batik.i18n.LocalizableSupport;
42 import org.apache.batik.util.SVGConstants;
43 import org.apache.batik.util.XMLResourceDescriptor;
44
45 import org.w3c.css.sac.InputSource;
46 import org.w3c.css.sac.Parser;
47 import org.w3c.dom.DOMException JavaDoc;
48 import org.w3c.dom.DOMImplementation JavaDoc;
49 import org.w3c.dom.Document JavaDoc;
50 import org.w3c.dom.DocumentType JavaDoc;
51 import org.w3c.dom.Element JavaDoc;
52 import org.w3c.dom.Node JavaDoc;
53 import org.w3c.dom.css.CSSStyleDeclaration;
54 import org.w3c.dom.css.CSSStyleSheet;
55 import org.w3c.dom.css.DOMImplementationCSS;
56 import org.w3c.dom.css.ViewCSS;
57 import org.w3c.dom.events.Event JavaDoc;
58 import org.w3c.dom.stylesheets.StyleSheet;
59
60 /**
61  * This class implements the {@link DOMImplementation} interface.
62  * It provides support the SVG 1.1 documents.
63  *
64  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
65  * @version $Id: SVGDOMImplementation.java,v 1.31 2005/03/27 08:58:32 cam Exp $
66  */

67 public class SVGDOMImplementation
68     extends ExtensibleDOMImplementation
69     implements CSSStyleDeclarationFactory {
70     
71     /**
72      * The SVG namespace uri.
73      */

74     public final static String JavaDoc SVG_NAMESPACE_URI =
75         SVGConstants.SVG_NAMESPACE_URI;
76
77     /**
78      * The error messages bundle class name.
79      */

80     protected final static String JavaDoc RESOURCES =
81         "org.apache.batik.dom.svg.resources.Messages";
82
83     protected HashTable factories;
84
85     /**
86      * Returns the default instance of this class.
87      */

88     public static DOMImplementation getDOMImplementation() {
89         return DOM_IMPLEMENTATION;
90     }
91
92     
93     /**
94      * Creates a new SVGDOMImplementation object.
95      */

96     public SVGDOMImplementation() {
97         factories = svg11Factories;
98         registerFeature("CSS", "2.0");
99         registerFeature("StyleSheets", "2.0");
100         registerFeature("SVG", new String JavaDoc[] {"1.0", "1.1"});
101         registerFeature("SVGEvents", new String JavaDoc[] {"1.0", "1.1"});
102     }
103
104     protected void initLocalizable() {
105         localizableSupport = new LocalizableSupport
106             (RESOURCES, getClass().getClassLoader());
107     }
108
109     public CSSEngine createCSSEngine(AbstractStylableDocument doc,
110                                      CSSContext ctx,
111                                      ExtendedParser ep,
112                                      ValueManager [] vms,
113                                      ShorthandManager [] sms) {
114                                      
115         URL JavaDoc durl = ((SVGOMDocument)doc).getURLObject();
116         CSSEngine result = new SVGCSSEngine(doc, durl, ep, vms, sms, ctx);
117
118         URL JavaDoc url = getClass().getResource("resources/UserAgentStyleSheet.css");
119         if (url != null) {
120             InputSource is = new InputSource(url.toString());
121             result.setUserAgentStyleSheet
122                 (result.parseStyleSheet(is, url, "all"));
123         }
124
125         return result;
126     }
127
128     /**
129      * Creates a ViewCSS.
130      */

131     public ViewCSS createViewCSS(AbstractStylableDocument doc) {
132         return new CSSOMSVGViewCSS(doc.getCSSEngine());
133     }
134
135     /**
136      * <b>DOM</b>: Implements {@link
137      * DOMImplementation#createDocumentType(String,String,String)}.
138      */

139     public DocumentType createDocumentType(String JavaDoc qualifiedName,
140                                            String JavaDoc publicId,
141                                            String JavaDoc systemId) {
142         return new GenericDocumentType(qualifiedName, publicId, systemId);
143     }
144
145     /**
146      * <b>DOM</b>: Implements {@link
147      * DOMImplementation#createDocument(String,String,DocumentType)}.
148      */

149     public Document createDocument(String JavaDoc namespaceURI,
150                                    String JavaDoc qualifiedName,
151                                    DocumentType doctype)
152         throws DOMException JavaDoc {
153         Document result = new SVGOMDocument(doctype, this);
154         // BUG 32108: return empty document if qualifiedName is null.
155
if (qualifiedName != null)
156             result.appendChild(result.createElementNS(namespaceURI,
157                                                       qualifiedName));
158         return result;
159     }
160
161     // DOMImplementationCSS /////////////////////////////////////////////////
162

163     /**
164      * <b>DOM</b>: Implements {@link
165      * DOMImplementationCSS#createCSSStyleSheet(String,String)}.
166      */

167     public CSSStyleSheet createCSSStyleSheet(String JavaDoc title, String JavaDoc media) {
168         throw new InternalError JavaDoc("Not implemented");
169     }
170
171     // CSSStyleDeclarationFactory ///////////////////////////////////////////
172

173     /**
174      * Creates a style declaration.
175      * @return a CSSOMStyleDeclaration instance.
176      */

177     public CSSStyleDeclaration createCSSStyleDeclaration() {
178         throw new InternalError JavaDoc("Not implemented");
179     }
180
181     // StyleSheetFactory /////////////////////////////////////////////
182

183     /**
184      * Creates a stylesheet from the data of an xml-stylesheet
185      * processing instruction or return null.
186      */

187     public StyleSheet createStyleSheet(Node JavaDoc n, HashTable attrs) {
188         throw new InternalError JavaDoc("Not implemented");
189     }
190
191     /**
192      * Returns the user-agent stylesheet.
193      */

194     public CSSStyleSheet getUserAgentStyleSheet() {
195         throw new InternalError JavaDoc("Not implemented");
196     }
197
198     /**
199      * Implements the behavior of Document.createElementNS() for this
200      * DOM implementation.
201      */

202     public Element createElementNS(AbstractDocument document,
203                                    String JavaDoc namespaceURI,
204                                    String JavaDoc qualifiedName) {
205         if (SVGConstants.SVG_NAMESPACE_URI.equals(namespaceURI)) {
206             String JavaDoc name = DOMUtilities.getLocalName(qualifiedName);
207             ElementFactory ef = (ElementFactory)factories.get(name);
208             if (ef != null)
209                 return ef.create(DOMUtilities.getPrefix(qualifiedName),
210                                  document);
211             throw document.createDOMException
212                 (DOMException.NOT_FOUND_ERR, "invalid.element",
213                  new Object JavaDoc[] { namespaceURI, qualifiedName });
214         }
215
216         return super.createElementNS(document, namespaceURI, qualifiedName);
217     }
218
219     /**
220      * Creates an DocumentEventSupport object suitable for use with
221      * this implementation.
222      */

223     public DocumentEventSupport createDocumentEventSupport() {
224         DocumentEventSupport result = new DocumentEventSupport();
225         result.registerEventFactory("SVGEvents",
226                                     new DocumentEventSupport.EventFactory() {
227                                             public Event JavaDoc createEvent() {
228                                                 return new SVGOMEvent();
229                                             }
230                                         });
231         return result;
232     }
233
234     // The element factories /////////////////////////////////////////////////
235

236     /**
237      * The SVG element factories.
238      */

239     protected static HashTable svg11Factories = new HashTable();
240
241     static {
242         svg11Factories.put(SVGConstants.SVG_A_TAG,
243                            new AElementFactory());
244
245         svg11Factories.put(SVGConstants.SVG_ALT_GLYPH_TAG,
246                            new AltGlyphElementFactory());
247
248         svg11Factories.put(SVGConstants.SVG_ALT_GLYPH_DEF_TAG,
249                            new AltGlyphDefElementFactory());
250
251         svg11Factories.put(SVGConstants.SVG_ALT_GLYPH_ITEM_TAG,
252                            new AltGlyphItemElementFactory());
253
254         svg11Factories.put(SVGConstants.SVG_ANIMATE_TAG,
255                            new AnimateElementFactory());
256
257         svg11Factories.put(SVGConstants.SVG_ANIMATE_COLOR_TAG,
258                            new AnimateColorElementFactory());
259
260         svg11Factories.put(SVGConstants.SVG_ANIMATE_MOTION_TAG,
261                            new AnimateMotionElementFactory());
262
263         svg11Factories.put(SVGConstants.SVG_ANIMATE_TRANSFORM_TAG,
264                            new AnimateTransformElementFactory());
265
266         svg11Factories.put(SVGConstants.SVG_CIRCLE_TAG,
267                            new CircleElementFactory());
268
269         svg11Factories.put(SVGConstants.SVG_CLIP_PATH_TAG,
270                            new ClipPathElementFactory());
271
272         svg11Factories.put(SVGConstants.SVG_COLOR_PROFILE_TAG,
273                            new ColorProfileElementFactory());
274
275         svg11Factories.put(SVGConstants.SVG_CURSOR_TAG,
276                            new CursorElementFactory());
277
278         svg11Factories.put(SVGConstants.SVG_DEFINITION_SRC_TAG,
279                            new DefinitionSrcElementFactory());
280
281         svg11Factories.put(SVGConstants.SVG_DEFS_TAG,
282                            new DefsElementFactory());
283
284         svg11Factories.put(SVGConstants.SVG_DESC_TAG,
285                            new DescElementFactory());
286
287         svg11Factories.put(SVGConstants.SVG_ELLIPSE_TAG,
288                            new EllipseElementFactory());
289
290         svg11Factories.put(SVGConstants.SVG_FE_BLEND_TAG,
291                            new FeBlendElementFactory());
292
293         svg11Factories.put(SVGConstants.SVG_FE_COLOR_MATRIX_TAG,
294                            new FeColorMatrixElementFactory());
295
296         svg11Factories.put(SVGConstants.SVG_FE_COMPONENT_TRANSFER_TAG,
297                            new FeComponentTransferElementFactory());
298
299         svg11Factories.put(SVGConstants.SVG_FE_COMPOSITE_TAG,
300                            new FeCompositeElementFactory());
301
302         svg11Factories.put(SVGConstants.SVG_FE_CONVOLVE_MATRIX_TAG,
303                            new FeConvolveMatrixElementFactory());
304
305         svg11Factories.put(SVGConstants.SVG_FE_DIFFUSE_LIGHTING_TAG,
306                            new FeDiffuseLightingElementFactory());
307
308         svg11Factories.put(SVGConstants.SVG_FE_DISPLACEMENT_MAP_TAG,
309                            new FeDisplacementMapElementFactory());
310
311         svg11Factories.put(SVGConstants.SVG_FE_DISTANT_LIGHT_TAG,
312                            new FeDistantLightElementFactory());
313
314         svg11Factories.put(SVGConstants.SVG_FE_FLOOD_TAG,
315                            new FeFloodElementFactory());
316
317         svg11Factories.put(SVGConstants.SVG_FE_FUNC_A_TAG,
318                            new FeFuncAElementFactory());
319
320         svg11Factories.put(SVGConstants.SVG_FE_FUNC_R_TAG,
321                            new FeFuncRElementFactory());
322
323         svg11Factories.put(SVGConstants.SVG_FE_FUNC_G_TAG,
324                            new FeFuncGElementFactory());
325
326         svg11Factories.put(SVGConstants.SVG_FE_FUNC_B_TAG,
327                            new FeFuncBElementFactory());
328
329         svg11Factories.put(SVGConstants.SVG_FE_GAUSSIAN_BLUR_TAG,
330                            new FeGaussianBlurElementFactory());
331
332         svg11Factories.put(SVGConstants.SVG_FE_IMAGE_TAG,
333                            new FeImageElementFactory());
334
335         svg11Factories.put(SVGConstants.SVG_FE_MERGE_TAG,
336                            new FeMergeElementFactory());
337
338         svg11Factories.put(SVGConstants.SVG_FE_MERGE_NODE_TAG,
339                            new FeMergeNodeElementFactory());
340
341         svg11Factories.put(SVGConstants.SVG_FE_MORPHOLOGY_TAG,
342                            new FeMorphologyElementFactory());
343
344         svg11Factories.put(SVGConstants.SVG_FE_OFFSET_TAG,
345                            new FeOffsetElementFactory());
346
347         svg11Factories.put(SVGConstants.SVG_FE_POINT_LIGHT_TAG,
348                            new FePointLightElementFactory());
349
350         svg11Factories.put(SVGConstants.SVG_FE_SPECULAR_LIGHTING_TAG,
351                            new FeSpecularLightingElementFactory());
352
353         svg11Factories.put(SVGConstants.SVG_FE_SPOT_LIGHT_TAG,
354                            new FeSpotLightElementFactory());
355
356         svg11Factories.put(SVGConstants.SVG_FE_TILE_TAG,
357                            new FeTileElementFactory());
358
359         svg11Factories.put(SVGConstants.SVG_FE_TURBULENCE_TAG,
360                            new FeTurbulenceElementFactory());
361
362         svg11Factories.put(SVGConstants.SVG_FILTER_TAG,
363                            new FilterElementFactory());
364
365         svg11Factories.put(SVGConstants.SVG_FONT_TAG,
366                            new FontElementFactory());
367
368         svg11Factories.put(SVGConstants.SVG_FONT_FACE_TAG,
369                            new FontFaceElementFactory());
370
371         svg11Factories.put(SVGConstants.SVG_FONT_FACE_FORMAT_TAG,
372                            new FontFaceFormatElementFactory());
373
374         svg11Factories.put(SVGConstants.SVG_FONT_FACE_NAME_TAG,
375                            new FontFaceNameElementFactory());
376
377         svg11Factories.put(SVGConstants.SVG_FONT_FACE_SRC_TAG,
378                            new FontFaceSrcElementFactory());
379
380         svg11Factories.put(SVGConstants.SVG_FONT_FACE_URI_TAG,
381                            new FontFaceUriElementFactory());
382
383         svg11Factories.put(SVGConstants.SVG_FOREIGN_OBJECT_TAG,
384                            new ForeignObjectElementFactory());
385
386         svg11Factories.put(SVGConstants.SVG_G_TAG,
387                            new GElementFactory());
388
389         svg11Factories.put(SVGConstants.SVG_GLYPH_TAG,
390                            new GlyphElementFactory());
391
392         svg11Factories.put(SVGConstants.SVG_GLYPH_REF_TAG,
393                            new GlyphRefElementFactory());
394
395         svg11Factories.put(SVGConstants.SVG_HKERN_TAG,
396                            new HkernElementFactory());
397
398         svg11Factories.put(SVGConstants.SVG_IMAGE_TAG,
399                            new ImageElementFactory());
400
401         svg11Factories.put(SVGConstants.SVG_LINE_TAG,
402                            new LineElementFactory());
403
404         svg11Factories.put(SVGConstants.SVG_LINEAR_GRADIENT_TAG,
405                            new LinearGradientElementFactory());
406
407         svg11Factories.put(SVGConstants.SVG_MARKER_TAG,
408                            new MarkerElementFactory());
409
410         svg11Factories.put(SVGConstants.SVG_MASK_TAG,
411                            new MaskElementFactory());
412
413         svg11Factories.put(SVGConstants.SVG_METADATA_TAG,
414                            new MetadataElementFactory());
415
416         svg11Factories.put(SVGConstants.SVG_MISSING_GLYPH_TAG,
417                            new MissingGlyphElementFactory());
418
419         svg11Factories.put(SVGConstants.SVG_MPATH_TAG,
420                            new MpathElementFactory());
421
422         svg11Factories.put(SVGConstants.SVG_PATH_TAG,
423                            new PathElementFactory());
424
425         svg11Factories.put(SVGConstants.SVG_PATTERN_TAG,
426                            new PatternElementFactory());
427
428         svg11Factories.put(SVGConstants.SVG_POLYGON_TAG,
429                            new PolygonElementFactory());
430
431         svg11Factories.put(SVGConstants.SVG_POLYLINE_TAG,
432                            new PolylineElementFactory());
433
434         svg11Factories.put(SVGConstants.SVG_RADIAL_GRADIENT_TAG,
435                            new RadialGradientElementFactory());
436
437         svg11Factories.put(SVGConstants.SVG_RECT_TAG,
438                            new RectElementFactory());
439
440         svg11Factories.put(SVGConstants.SVG_SET_TAG,
441                            new SetElementFactory());
442
443         svg11Factories.put(SVGConstants.SVG_SCRIPT_TAG,
444                            new ScriptElementFactory());
445
446         svg11Factories.put(SVGConstants.SVG_STOP_TAG,
447                            new StopElementFactory());
448
449         svg11Factories.put(SVGConstants.SVG_STYLE_TAG,
450                            new StyleElementFactory());
451
452         svg11Factories.put(SVGConstants.SVG_SVG_TAG,
453                            new SvgElementFactory());
454
455         svg11Factories.put(SVGConstants.SVG_SWITCH_TAG,
456                            new SwitchElementFactory());
457
458         svg11Factories.put(SVGConstants.SVG_SYMBOL_TAG,
459                            new SymbolElementFactory());
460
461         svg11Factories.put(SVGConstants.SVG_TEXT_TAG,
462                            new TextElementFactory());
463
464         svg11Factories.put(SVGConstants.SVG_TEXT_PATH_TAG,
465                            new TextPathElementFactory());
466
467         svg11Factories.put(SVGConstants.SVG_TITLE_TAG,
468                            new TitleElementFactory());
469
470         svg11Factories.put(SVGConstants.SVG_TREF_TAG,
471                            new TrefElementFactory());
472
473         svg11Factories.put(SVGConstants.SVG_TSPAN_TAG,
474                            new TspanElementFactory());
475
476         svg11Factories.put(SVGConstants.SVG_USE_TAG,
477                            new UseElementFactory());
478
479         svg11Factories.put(SVGConstants.SVG_VIEW_TAG,
480                            new ViewElementFactory());
481
482         svg11Factories.put(SVGConstants.SVG_VKERN_TAG,
483                            new VkernElementFactory());
484     }
485
486     /**
487      * To create a 'a' element.
488      */

489     protected static class AElementFactory implements ElementFactory {
490         public AElementFactory() {}
491         /**
492          * Creates an instance of the associated element type.
493          */

494         public Element create(String JavaDoc prefix, Document doc) {
495             return new SVGOMAElement(prefix, (AbstractDocument)doc);
496         }
497     }
498     
499     /**
500      * To create a 'altGlyph' element.
501      */

502     protected static class AltGlyphElementFactory implements ElementFactory {
503         public AltGlyphElementFactory() {}
504         /**
505          * Creates an instance of the associated element type.
506          */

507         public Element create(String JavaDoc prefix, Document doc) {
508             return new SVGOMAltGlyphElement(prefix, (AbstractDocument)doc);
509         }
510     }
511
512     /**
513      * To create a 'altGlyphDef' element.
514      */

515     protected static class AltGlyphDefElementFactory
516         implements ElementFactory {
517         public AltGlyphDefElementFactory() {}
518         /**
519          * Creates an instance of the associated element type.
520          */

521         public Element create(String JavaDoc prefix, Document doc) {
522             return new SVGOMAltGlyphDefElement(prefix, (AbstractDocument)doc);
523         }
524     }
525
526     /**
527      * To create a 'altGlyphItem' element.
528      */

529     protected static class AltGlyphItemElementFactory
530         implements ElementFactory {
531         public AltGlyphItemElementFactory() {}
532         /**
533          * Creates an instance of the associated element type.
534          */

535         public Element create(String JavaDoc prefix, Document doc) {
536             return new SVGOMAltGlyphItemElement(prefix, (AbstractDocument)doc);
537         }
538     }
539
540     /**
541      * To create a 'animate' element.
542      */

543     protected static class AnimateElementFactory implements ElementFactory {
544         public AnimateElementFactory() {}
545         /**
546          * Creates an instance of the associated element type.
547          */

548         public Element create(String JavaDoc prefix, Document doc) {
549             return new SVGOMAnimateElement(prefix, (AbstractDocument)doc);
550         }
551     }
552
553     /**
554      * To create a 'animateColor' element.
555      */

556     protected static class AnimateColorElementFactory
557         implements ElementFactory {
558         public AnimateColorElementFactory() {}
559         /**
560          * Creates an instance of the associated element type.
561          */

562         public Element create(String JavaDoc prefix, Document doc) {
563             return new SVGOMAnimateColorElement(prefix, (AbstractDocument)doc);
564         }
565     }
566
567     /**
568      * To create a 'animateMotion' element.
569      */

570     protected static class AnimateMotionElementFactory
571         implements ElementFactory {
572         public AnimateMotionElementFactory() {}
573         /**
574          * Creates an instance of the associated element type.
575          */

576         public Element create(String JavaDoc prefix, Document doc) {
577             return new SVGOMAnimateMotionElement(prefix,
578                                                  (AbstractDocument)doc);
579         }
580     }
581
582     /**
583      * To create a 'animateTransform' element.
584      */

585     protected static class AnimateTransformElementFactory
586         implements ElementFactory {
587         public AnimateTransformElementFactory() {}
588         /**
589          * Creates an instance of the associated element type.
590          */

591         public Element create(String JavaDoc prefix, Document doc) {
592             return new SVGOMAnimateTransformElement(prefix,
593                                                     (AbstractDocument)doc);
594         }
595     }
596
597     /**
598      * To create a 'circle' element.
599      */

600     protected static class CircleElementFactory implements ElementFactory {
601         public CircleElementFactory() {}
602         /**
603          * Creates an instance of the associated element type.
604          */

605         public Element create(String JavaDoc prefix, Document doc) {
606             return new SVGOMCircleElement(prefix, (AbstractDocument)doc);
607         }
608     }
609
610     /**
611      * To create a 'clip-path' element.
612      */

613     protected static class ClipPathElementFactory implements ElementFactory {
614         public ClipPathElementFactory() {}
615         /**
616          * Creates an instance of the associated element type.
617          */

618         public Element create(String JavaDoc prefix, Document doc) {
619             return new SVGOMClipPathElement(prefix, (AbstractDocument)doc);
620         }
621     }
622
623     /**
624      * To create a 'color-profile' element.
625      */

626     protected static class ColorProfileElementFactory
627         implements ElementFactory {
628         public ColorProfileElementFactory() {}
629         /**
630          * Creates an instance of the associated element type.
631          */

632         public Element create(String JavaDoc prefix, Document doc) {
633             return new SVGOMColorProfileElement(prefix, (AbstractDocument)doc);
634         }
635     }
636
637     /**
638      * To create a 'cursor' element.
639      */

640     protected static class CursorElementFactory implements ElementFactory {
641         public CursorElementFactory() {}
642         /**
643          * Creates an instance of the associated element type.
644          */

645         public Element create(String JavaDoc prefix, Document doc) {
646             return new SVGOMCursorElement(prefix, (AbstractDocument)doc);
647         }
648     }
649
650     /**
651      * To create a 'definition-src' element.
652      */

653     protected static class DefinitionSrcElementFactory
654         implements ElementFactory {
655         public DefinitionSrcElementFactory() {}
656         /**
657          * Creates an instance of the associated element type.
658          */

659         public Element create(String JavaDoc prefix, Document doc) {
660             return new SVGOMDefinitionSrcElement(prefix,
661                                                  (AbstractDocument)doc);
662         }
663     }
664
665     /**
666      * To create a 'defs' element.
667      */

668     protected static class DefsElementFactory implements ElementFactory {
669         public DefsElementFactory() {}
670         /**
671          * Creates an instance of the associated element type.
672          */

673         public Element create(String JavaDoc prefix, Document doc) {
674             return new SVGOMDefsElement(prefix, (AbstractDocument)doc);
675         }
676     }
677
678     /**
679      * To create a 'desc' element.
680      */

681     protected static class DescElementFactory implements ElementFactory {
682         public DescElementFactory() {}
683         /**
684          * Creates an instance of the associated element type.
685          */

686         public Element create(String JavaDoc prefix, Document doc) {
687             return new SVGOMDescElement(prefix, (AbstractDocument)doc);
688         }
689     }
690
691     /**
692      * To create an 'ellipse' element.
693      */

694     protected static class EllipseElementFactory implements ElementFactory {
695         public EllipseElementFactory() {}
696         /**
697          * Creates an instance of the associated element type.
698          */

699         public Element create(String JavaDoc prefix, Document doc) {
700             return new SVGOMEllipseElement(prefix, (AbstractDocument)doc);
701         }
702     }
703
704     /**
705      * To create a 'feBlend' element.
706      */

707     protected static class FeBlendElementFactory implements ElementFactory {
708         public FeBlendElementFactory() {}
709         /**
710          * Creates an instance of the associated element type.
711          */

712         public Element create(String JavaDoc prefix, Document doc) {
713             return new SVGOMFEBlendElement(prefix, (AbstractDocument)doc);
714         }
715     }
716
717     /**
718      * To create a 'feColorMatrix' element.
719      */

720     protected static class FeColorMatrixElementFactory
721         implements ElementFactory {
722         public FeColorMatrixElementFactory() {}
723         /**
724          * Creates an instance of the associated element type.
725          */

726         public Element create(String JavaDoc prefix, Document doc) {
727             return new SVGOMFEColorMatrixElement(prefix,
728                                                  (AbstractDocument)doc);
729         }
730     }
731
732     /**
733      * To create a 'feComponentTransfer' element.
734      */

735     protected static class FeComponentTransferElementFactory
736         implements ElementFactory {
737         public FeComponentTransferElementFactory() {}
738         /**
739          * Creates an instance of the associated element type.
740          */

741         public Element create(String JavaDoc prefix, Document doc) {
742             return new SVGOMFEComponentTransferElement(prefix,
743                                                        (AbstractDocument)doc);
744         }
745     }
746
747     /**
748      * To create a 'feComposite' element.
749      */

750     protected static class FeCompositeElementFactory
751         implements ElementFactory {
752         public FeCompositeElementFactory() {}
753         /**
754          * Creates an instance of the associated element type.
755          */

756         public Element create(String JavaDoc prefix, Document doc) {
757             return new SVGOMFECompositeElement(prefix, (AbstractDocument)doc);
758         }
759     }
760
761     /**
762      * To create a 'feConvolveMatrix' element.
763      */

764     protected static class FeConvolveMatrixElementFactory
765         implements ElementFactory {
766         public FeConvolveMatrixElementFactory() {}
767         /**
768          * Creates an instance of the associated element type.
769          */

770         public Element create(String JavaDoc prefix, Document doc) {
771             return new SVGOMFEConvolveMatrixElement(prefix,
772                                                     (AbstractDocument)doc);
773         }
774     }
775
776     /**
777      * To create a 'feDiffuseLighting' element.
778      */

779     protected static class FeDiffuseLightingElementFactory
780         implements ElementFactory {
781         public FeDiffuseLightingElementFactory() {}
782         /**
783          * Creates an instance of the associated element type.
784          */

785         public Element create(String JavaDoc prefix, Document doc) {
786             return new SVGOMFEDiffuseLightingElement(prefix,
787                                                      (AbstractDocument)doc);
788         }
789     }
790
791     /**
792      * To create a 'feDisplacementMap' element.
793      */

794     protected static class FeDisplacementMapElementFactory
795         implements ElementFactory {
796         public FeDisplacementMapElementFactory() {}
797         /**
798          * Creates an instance of the associated element type.
799          */

800         public Element create(String JavaDoc prefix, Document doc) {
801             return new SVGOMFEDisplacementMapElement(prefix,
802                                                      (AbstractDocument)doc);
803         }
804     }
805
806     /**
807      * To create a 'feDistantLight' element.
808      */

809     protected static class FeDistantLightElementFactory
810         implements ElementFactory {
811         public FeDistantLightElementFactory() {}
812         /**
813          * Creates an instance of the associated element type.
814          */

815         public Element create(String JavaDoc prefix, Document doc) {
816             return new SVGOMFEDistantLightElement(prefix,
817                                                   (AbstractDocument)doc);
818         }
819     }
820
821     /**
822      * To create a 'feFlood' element.
823      */

824     protected static class FeFloodElementFactory implements ElementFactory {
825         public FeFloodElementFactory() {}
826         /**
827          * Creates an instance of the associated element type.
828          */

829         public Element create(String JavaDoc prefix, Document doc) {
830             return new SVGOMFEFloodElement(prefix, (AbstractDocument)doc);
831         }
832     }
833
834     /**
835      * To create a 'feFuncA' element.
836      */

837     protected static class FeFuncAElementFactory implements ElementFactory {
838         public FeFuncAElementFactory() {}
839         /**
840          * Creates an instance of the associated element type.
841          */

842         public Element create(String JavaDoc prefix, Document doc) {
843             return new SVGOMFEFuncAElement(prefix, (AbstractDocument)doc);
844         }
845     }
846
847     /**
848      * To create a 'feFuncR' element.
849      */

850     protected static class FeFuncRElementFactory implements ElementFactory {
851         public FeFuncRElementFactory() {}
852         /**
853          * Creates an instance of the associated element type.
854          */

855         public Element create(String JavaDoc prefix, Document doc) {
856             return new SVGOMFEFuncRElement(prefix, (AbstractDocument)doc);
857         }
858     }
859
860     /**
861      * To create a 'feFuncG' element.
862      */

863     protected static class FeFuncGElementFactory implements ElementFactory {
864         public FeFuncGElementFactory() {}
865         /**
866          * Creates an instance of the associated element type.
867          */

868         public Element create(String JavaDoc prefix, Document doc) {
869             return new SVGOMFEFuncGElement(prefix, (AbstractDocument)doc);
870         }
871     }
872
873
874     /**
875      * To create a 'feFuncB' element.
876      */

877     protected static class FeFuncBElementFactory
878         implements ElementFactory {
879         public FeFuncBElementFactory() {}
880         /**
881          * Creates an instance of the associated element type.
882          */

883         public Element create(String JavaDoc prefix, Document doc) {
884             return new SVGOMFEFuncBElement(prefix, (AbstractDocument)doc);
885         }
886     }
887
888     /**
889      * To create a 'feGaussianBlur' element.
890      */

891     protected static class FeGaussianBlurElementFactory
892         implements ElementFactory {
893         public FeGaussianBlurElementFactory() {}
894         /**
895          * Creates an instance of the associated element type.
896          */

897         public Element create(String JavaDoc prefix, Document doc) {
898             return new SVGOMFEGaussianBlurElement(prefix,
899                                                   (AbstractDocument)doc);
900         }
901     }
902
903     /**
904      * To create a 'feImage' element.
905      */

906     protected static class FeImageElementFactory implements ElementFactory {
907         public FeImageElementFactory() {}
908         /**
909          * Creates an instance of the associated element type.
910          */

911         public Element create(String JavaDoc prefix, Document doc) {
912             return new SVGOMFEImageElement(prefix, (AbstractDocument)doc);
913         }
914     }
915
916     /**
917      * To create a 'feMerge' element.
918      */

919     protected static class FeMergeElementFactory
920         implements ElementFactory {
921         public FeMergeElementFactory() {}
922         /**
923          * Creates an instance of the associated element type.
924          */

925         public Element create(String JavaDoc prefix, Document doc) {
926             return new SVGOMFEMergeElement(prefix, (AbstractDocument)doc);
927         }
928     }
929
930     /**
931      * To create a 'feMergeNode' element.
932      */

933     protected static class FeMergeNodeElementFactory
934         implements ElementFactory {
935         public FeMergeNodeElementFactory() {}
936         /**
937          * Creates an instance of the associated element type.
938          */

939         public Element create(String JavaDoc prefix, Document doc) {
940             return new SVGOMFEMergeNodeElement(prefix, (AbstractDocument)doc);
941         }
942     }
943
944     /**
945      * To create a 'feMorphology' element.
946      */

947     protected static class FeMorphologyElementFactory
948         implements ElementFactory {
949         public FeMorphologyElementFactory() {}
950         /**
951          * Creates an instance of the associated element type.
952          */

953         public Element create(String JavaDoc prefix, Document doc) {
954             return new SVGOMFEMorphologyElement(prefix,
955                                                 (AbstractDocument)doc);
956         }
957     }
958
959     /**
960      * To create a 'feOffset' element.
961      */

962     protected static class FeOffsetElementFactory implements ElementFactory {
963         public FeOffsetElementFactory() {}
964         /**
965          * Creates an instance of the associated element type.
966          */

967         public Element create(String JavaDoc prefix, Document doc) {
968             return new SVGOMFEOffsetElement(prefix, (AbstractDocument)doc);
969         }
970     }
971
972     /**
973      * To create a 'fePointLight' element.
974      */

975     protected static class FePointLightElementFactory
976         implements ElementFactory {
977         public FePointLightElementFactory() {}
978         /**
979          * Creates an instance of the associated element type.
980          */

981         public Element create(String JavaDoc prefix, Document doc) {
982             return new SVGOMFEPointLightElement(prefix, (AbstractDocument)doc);
983         }
984     }
985
986     /**
987      * To create a 'feSpecularLighting' element.
988      */

989     protected static class FeSpecularLightingElementFactory
990         implements ElementFactory {
991         public FeSpecularLightingElementFactory() {}
992         /**
993          * Creates an instance of the associated element type.
994          */

995         public Element create(String JavaDoc prefix, Document doc) {
996             return new SVGOMFESpecularLightingElement(prefix,
997                                                       (AbstractDocument)doc);
998         }
999     }
1000
1001    /**
1002     * To create a 'feSpotLight' element.
1003     */

1004    protected static class FeSpotLightElementFactory
1005        implements ElementFactory {
1006        public FeSpotLightElementFactory() {}
1007        /**
1008         * Creates an instance of the associated element type.
1009         */

1010        public Element create(String JavaDoc prefix, Document doc) {
1011            return new SVGOMFESpotLightElement(prefix, (AbstractDocument)doc);
1012        }
1013    }
1014
1015    /**
1016     * To create a 'feTile' element.
1017     */

1018    protected static class FeTileElementFactory implements ElementFactory {
1019        public FeTileElementFactory() {}
1020        /**
1021         * Creates an instance of the associated element type.
1022         */

1023        public Element create(String JavaDoc prefix, Document doc) {
1024            return new SVGOMFETileElement(prefix, (AbstractDocument)doc);
1025        }
1026    }
1027
1028    /**
1029     * To create a 'feTurbulence' element
1030     */

1031    protected static class FeTurbulenceElementFactory
1032        implements ElementFactory{
1033        public FeTurbulenceElementFactory() {}
1034        /**
1035         * Creates an instance of the associated element type.
1036         */

1037        public Element create(String JavaDoc prefix, Document doc) {
1038            return new SVGOMFETurbulenceElement(prefix, (AbstractDocument)doc);
1039        }
1040    }
1041
1042    /**
1043     * To create a 'filter' element.
1044     */

1045    protected static class FilterElementFactory implements ElementFactory {
1046        public FilterElementFactory() {}
1047        /**
1048         * Creates an instance of the associated element type.
1049         */

1050        public Element create(String JavaDoc prefix, Document doc) {
1051            return new SVGOMFilterElement(prefix, (AbstractDocument)doc);
1052        }
1053    }
1054
1055    /**
1056     * To create a 'font' element.
1057     */

1058    protected static class FontElementFactory implements ElementFactory {
1059        public FontElementFactory() {}
1060        /**
1061         * Creates an instance of the associated element type.
1062         */

1063        public Element create(String JavaDoc prefix, Document doc) {
1064            return new SVGOMFontElement(prefix, (AbstractDocument)doc);
1065        }
1066    }
1067
1068    /**
1069     * To create a 'font-face' element.
1070     */

1071    protected static class FontFaceElementFactory implements ElementFactory {
1072        public FontFaceElementFactory() {}
1073        /**
1074         * Creates an instance of the associated element type.
1075         */

1076        public Element create(String JavaDoc prefix, Document doc) {
1077            return new SVGOMFontFaceElement(prefix, (AbstractDocument)doc);
1078        }
1079    }
1080
1081    /**
1082     * To create a 'font-face-format' element.
1083     */

1084    protected static class FontFaceFormatElementFactory
1085        implements ElementFactory {
1086        public FontFaceFormatElementFactory() {}
1087        /**
1088         * Creates an instance of the associated element type.
1089         */

1090        public Element create(String JavaDoc prefix, Document doc) {
1091            return new SVGOMFontFaceFormatElement(prefix,
1092                                                  (AbstractDocument)doc);
1093        }
1094    }
1095
1096    /**
1097     * To create a 'font-face-name' element.
1098     */

1099    protected static class FontFaceNameElementFactory
1100        implements ElementFactory {
1101        public FontFaceNameElementFactory() {}
1102        /**
1103         * Creates an instance of the associated element type.
1104         */

1105        public Element create(String JavaDoc prefix, Document doc) {
1106            return new SVGOMFontFaceNameElement(prefix, (AbstractDocument)doc);
1107        }
1108    }
1109
1110    /**
1111     * To create a 'font-face-src' element.
1112     */

1113    protected static class FontFaceSrcElementFactory
1114        implements ElementFactory {
1115        public FontFaceSrcElementFactory() {}
1116        /**
1117         * Creates an instance of the associated element type.
1118         */

1119        public Element create(String JavaDoc prefix, Document doc) {
1120            return new SVGOMFontFaceSrcElement(prefix, (AbstractDocument)doc);
1121        }
1122    }
1123
1124    /**
1125     * To create a 'font-face-uri' element.
1126     */

1127    protected static class FontFaceUriElementFactory
1128        implements ElementFactory {
1129        public FontFaceUriElementFactory() {}
1130        /**
1131         * Creates an instance of the associated element type.
1132         */

1133        public Element create(String JavaDoc prefix, Document doc) {
1134            return new SVGOMFontFaceUriElement(prefix, (AbstractDocument)doc);
1135        }
1136    }
1137
1138    /**
1139     * To create a 'foreignObject' element.
1140     */

1141    protected static class ForeignObjectElementFactory
1142        implements ElementFactory {
1143        public ForeignObjectElementFactory() {}
1144        /**
1145         * Creates an instance of the associated element type.
1146         */

1147        public Element create(String JavaDoc prefix, Document doc) {
1148            return new SVGOMForeignObjectElement(prefix,
1149                                                 (AbstractDocument)doc);
1150        }
1151    }
1152
1153    /**
1154     * To create a 'g' element.
1155     */

1156    protected static class GElementFactory implements ElementFactory {
1157        public GElementFactory() {}
1158        /**
1159         * Creates an instance of the associated element type.
1160         */

1161        public Element create(String JavaDoc prefix, Document doc) {
1162            return new SVGOMGElement(prefix, (AbstractDocument)doc);
1163        }
1164    }
1165
1166    /**
1167     * To create a 'glyph' element.
1168     */

1169    protected static class GlyphElementFactory implements ElementFactory {
1170        public GlyphElementFactory() {}
1171        /**
1172         * Creates an instance of the associated element type.
1173         */

1174        public Element create(String JavaDoc prefix, Document doc) {
1175            return new SVGOMGlyphElement(prefix, (AbstractDocument)doc);
1176        }
1177    }
1178
1179    /**
1180     * To create a 'glyphRef' element.
1181     */

1182    protected static class GlyphRefElementFactory implements ElementFactory {
1183        public GlyphRefElementFactory() {}
1184        /**
1185         * Creates an instance of the associated element type.
1186         */

1187        public Element create(String JavaDoc prefix, Document doc) {
1188            return new SVGOMGlyphRefElement(prefix, (AbstractDocument)doc);
1189        }
1190    }
1191
1192    /**
1193     * To create a 'hkern' element.
1194     */

1195    protected static class HkernElementFactory implements ElementFactory {
1196        public HkernElementFactory() {}
1197        /**
1198         * Creates an instance of the associated element type.
1199         */

1200        public Element create(String JavaDoc prefix, Document doc) {
1201            return new SVGOMHKernElement(prefix, (AbstractDocument)doc);
1202        }
1203    }
1204
1205    /**
1206     * To create a 'image' element.
1207     */

1208    protected static class ImageElementFactory implements ElementFactory {
1209        public ImageElementFactory() {}
1210        /**
1211         * Creates an instance of the associated element type.
1212         */

1213        public Element create(String JavaDoc prefix, Document doc) {
1214            return new SVGOMImageElement(prefix, (AbstractDocument)doc);
1215        }
1216    }
1217
1218    /**
1219     * To create a 'line' element.
1220     */

1221    protected static class LineElementFactory implements ElementFactory {
1222        public LineElementFactory() {}
1223        /**
1224         * Creates an instance of the associated element type.
1225         */

1226        public Element create(String JavaDoc prefix, Document doc) {
1227            return new SVGOMLineElement(prefix, (AbstractDocument)doc);
1228        }
1229    }
1230
1231    /**
1232     * To create a 'linearGradient' element.
1233     */

1234    protected static class LinearGradientElementFactory
1235        implements ElementFactory {
1236        public LinearGradientElementFactory() {}
1237        /**
1238         * Creates an instance of the associated element type.
1239         */

1240        public Element create(String JavaDoc prefix, Document doc) {
1241            return new SVGOMLinearGradientElement(prefix,
1242                                                  (AbstractDocument)doc);
1243        }
1244    }
1245
1246    /**
1247     * To create a 'marker' element.
1248     */

1249    protected static class MarkerElementFactory implements ElementFactory {
1250        public MarkerElementFactory() {}
1251        /**
1252         * Creates an instance of the associated element type.
1253         */

1254        public Element create(String JavaDoc prefix, Document doc) {
1255            return new SVGOMMarkerElement(prefix, (AbstractDocument)doc);
1256        }
1257    }
1258
1259    /**
1260     * To create a 'mask' element.
1261     */

1262    protected static class MaskElementFactory implements ElementFactory {
1263        public MaskElementFactory() {}
1264        /**
1265         * Creates an instance of the associated element type.
1266         */

1267        public Element create(String JavaDoc prefix, Document doc) {
1268            return new SVGOMMaskElement(prefix, (AbstractDocument)doc);
1269        }
1270    }
1271
1272    /**
1273     * To create a 'metadata' element.
1274     */

1275    protected static class MetadataElementFactory implements ElementFactory {
1276        public MetadataElementFactory() {}
1277        /**
1278         * Creates an instance of the associated element type.
1279         */

1280        public Element create(String JavaDoc prefix, Document doc) {
1281            return new SVGOMMetadataElement(prefix, (AbstractDocument)doc);
1282        }
1283    }
1284
1285    /**
1286     * To create a 'missing-glyph' element.
1287     */

1288    protected static class MissingGlyphElementFactory
1289        implements ElementFactory {
1290        public MissingGlyphElementFactory() {}
1291        /**
1292         * Creates an instance of the associated element type.
1293         */

1294        public Element create(String JavaDoc prefix, Document doc) {
1295            return new SVGOMMissingGlyphElement(prefix, (AbstractDocument)doc);
1296        }
1297    }
1298
1299    /**
1300     * To create a 'mpath' element.
1301     */

1302    protected static class MpathElementFactory implements ElementFactory {
1303        public MpathElementFactory() {}
1304        /**
1305         * Creates an instance of the associated element type.
1306         */

1307        public Element create(String JavaDoc prefix, Document doc) {
1308            return new SVGOMMPathElement(prefix, (AbstractDocument)doc);
1309        }
1310    }
1311
1312    /**
1313     * To create a 'path' element.
1314     */

1315    protected static class PathElementFactory implements ElementFactory {
1316        public PathElementFactory() {}
1317        /**
1318         * Creates an instance of the associated element type.
1319         */

1320        public Element create(String JavaDoc prefix, Document doc) {
1321            return new SVGOMPathElement(prefix, (AbstractDocument)doc);
1322        }
1323    }
1324
1325    /**
1326     * To create a 'pattern' element.
1327     */

1328    protected static class PatternElementFactory implements ElementFactory {
1329        public PatternElementFactory() {}
1330        /**
1331         * Creates an instance of the associated element type.
1332         */

1333        public Element create(String JavaDoc prefix, Document doc) {
1334            return new SVGOMPatternElement(prefix, (AbstractDocument)doc);
1335        }
1336    }
1337
1338    /**
1339     * To create a 'polygon' element.
1340     */

1341    protected static class PolygonElementFactory implements ElementFactory {
1342        public PolygonElementFactory() {}
1343        /**
1344         * Creates an instance of the associated element type.
1345         */

1346        public Element create(String JavaDoc prefix, Document doc) {
1347            return new SVGOMPolygonElement(prefix, (AbstractDocument)doc);
1348        }
1349    }
1350
1351    /**
1352     * To create a 'polyline' element.
1353     */

1354    protected static class PolylineElementFactory implements ElementFactory {
1355        public PolylineElementFactory() {}
1356        /**
1357         * Creates an instance of the associated element type.
1358         */

1359        public Element create(String JavaDoc prefix, Document doc) {
1360            return new SVGOMPolylineElement(prefix, (AbstractDocument)doc);
1361        }
1362    }
1363
1364    /**
1365     * To create a 'radialGradient' element.
1366     */

1367    protected static class RadialGradientElementFactory
1368        implements ElementFactory {
1369        public RadialGradientElementFactory() {}
1370        /**
1371         * Creates an instance of the associated element type.
1372         */

1373        public Element create(String JavaDoc prefix, Document doc) {
1374            return new SVGOMRadialGradientElement(prefix,
1375                                                  (AbstractDocument)doc);
1376        }
1377    }
1378
1379    /**
1380     * To create a 'rect' element.
1381     */

1382    protected static class RectElementFactory implements ElementFactory {
1383        public RectElementFactory() {}
1384        /**
1385         * Creates an instance of the associated element type.
1386         */

1387        public Element create(String JavaDoc prefix, Document doc) {
1388            return new SVGOMRectElement(prefix, (AbstractDocument)doc);
1389        }
1390    }
1391
1392    /**
1393     * To create a 'script' element.
1394     */

1395    protected static class ScriptElementFactory implements ElementFactory {
1396        public ScriptElementFactory() {}
1397        /**
1398         * Creates an instance of the associated element type.
1399         */

1400        public Element create(String JavaDoc prefix, Document doc) {
1401            return new SVGOMScriptElement(prefix, (AbstractDocument)doc);
1402        }
1403    }
1404
1405    /**
1406     * To create a 'set' element.
1407     */

1408    protected static class SetElementFactory implements ElementFactory {
1409        public SetElementFactory() {}
1410        /**
1411         * Creates an instance of the associated element type.
1412         */

1413        public Element create(String JavaDoc prefix, Document doc) {
1414            return new SVGOMSetElement(prefix, (AbstractDocument)doc);
1415        }
1416    }
1417
1418    /**
1419     * To create a 'stop' element.
1420     */

1421    protected static class StopElementFactory implements ElementFactory {
1422        public StopElementFactory() {}
1423        /**
1424         * Creates an instance of the associated element type.
1425         */

1426        public Element create(String JavaDoc prefix, Document doc) {
1427            return new SVGOMStopElement(prefix, (AbstractDocument)doc);
1428        }
1429    }
1430
1431    /**
1432     * To create a 'style' element.
1433     */

1434    protected static class StyleElementFactory implements ElementFactory {
1435        public StyleElementFactory() {}
1436        /**
1437         * Creates an instance of the associated element type.
1438         */

1439        public Element create(String JavaDoc prefix, Document doc) {
1440            return new SVGOMStyleElement(prefix, (AbstractDocument)doc);
1441        }
1442    }
1443
1444    /**
1445     * To create an 'svg' element.
1446     */

1447    protected static class SvgElementFactory implements ElementFactory {
1448        public SvgElementFactory() {}
1449        /**
1450         * Creates an instance of the associated element type.
1451         */

1452        public Element create(String JavaDoc prefix, Document doc) {
1453            return new SVGOMSVGElement(prefix, (AbstractDocument)doc);
1454        }
1455    }
1456
1457    /**
1458     * To create a 'switch' element.
1459     */

1460    protected static class SwitchElementFactory implements ElementFactory {
1461        public SwitchElementFactory() {}
1462        /**
1463         * Creates an instance of the associated element type.
1464         */

1465        public Element create(String JavaDoc prefix, Document doc) {
1466            return new SVGOMSwitchElement(prefix, (AbstractDocument)doc);
1467        }
1468    }
1469
1470    /**
1471     * To create a 'symbol' element.
1472     */

1473    protected static class SymbolElementFactory implements ElementFactory {
1474        public SymbolElementFactory() {}
1475        /**
1476         * Creates an instance of the associated element type.
1477         */

1478        public Element create(String JavaDoc prefix, Document doc) {
1479            return new SVGOMSymbolElement(prefix, (AbstractDocument)doc);
1480        }
1481    }
1482
1483    /**
1484     * To create a 'text' element.
1485     */

1486    protected static class TextElementFactory implements ElementFactory {
1487        public TextElementFactory() {}
1488        /**
1489         * Creates an instance of the associated element type.
1490         */

1491        public Element create(String JavaDoc prefix, Document doc) {
1492            return new SVGOMTextElement(prefix, (AbstractDocument)doc);
1493        }
1494    }
1495
1496    /**
1497     * To create a 'textPath' element.
1498     */

1499    protected static class TextPathElementFactory implements ElementFactory {
1500        public TextPathElementFactory() {}
1501        /**
1502         * Creates an instance of the associated element type.
1503         */

1504        public Element create(String JavaDoc prefix, Document doc) {
1505            return new SVGOMTextPathElement(prefix, (AbstractDocument)doc);
1506        }
1507    }
1508
1509    /**
1510     * To create a 'title' element.
1511     */

1512    protected static class TitleElementFactory implements ElementFactory {
1513        public TitleElementFactory() {}
1514        /**
1515         * Creates an instance of the associated element type.
1516         */

1517        public Element create(String JavaDoc prefix, Document doc) {
1518            return new SVGOMTitleElement(prefix, (AbstractDocument)doc);
1519        }
1520    }
1521
1522    /**
1523     * To create a 'tref' element.
1524     */

1525    protected static class TrefElementFactory implements ElementFactory {
1526        public TrefElementFactory() {}
1527        /**
1528         * Creates an instance of the associated element type.
1529         */

1530        public Element create(String JavaDoc prefix, Document doc) {
1531            return new SVGOMTRefElement(prefix, (AbstractDocument)doc);
1532        }
1533    }
1534
1535    /**
1536     * To create a 'tspan' element.
1537     */

1538    protected static class TspanElementFactory implements ElementFactory {
1539        public TspanElementFactory() {}
1540        /**
1541         * Creates an instance of the associated element type.
1542         */

1543        public Element create(String JavaDoc prefix, Document doc) {
1544            return new SVGOMTSpanElement(prefix, (AbstractDocument)doc);
1545        }
1546    }
1547
1548    /**
1549     * To create a 'use' element.
1550     */

1551    protected static class UseElementFactory implements ElementFactory {
1552        public UseElementFactory() {}
1553        /**
1554         * Creates an instance of the associated element type.
1555         */

1556        public Element create(String JavaDoc prefix, Document doc) {
1557            return new SVGOMUseElement(prefix, (AbstractDocument)doc);
1558        }
1559    }
1560
1561    /**
1562     * To create a 'view' element.
1563     */

1564    protected static class ViewElementFactory implements ElementFactory {
1565        public ViewElementFactory() {}
1566        /**
1567         * Creates an instance of the associated element type.
1568         */

1569        public Element create(String JavaDoc prefix, Document doc) {
1570            return new SVGOMViewElement(prefix, (AbstractDocument)doc);
1571        }
1572    }
1573
1574    /**
1575     * To create a 'vkern' element.
1576     */

1577    protected static class VkernElementFactory implements ElementFactory {
1578        public VkernElementFactory() {}
1579        /**
1580         * Creates an instance of the associated element type.
1581         */

1582        public Element create(String JavaDoc prefix, Document doc) {
1583            return new SVGOMVKernElement(prefix, (AbstractDocument)doc);
1584        }
1585    }
1586
1587    /**
1588     * The default instance of this class.
1589     */

1590    protected final static DOMImplementation DOM_IMPLEMENTATION =
1591        new SVGDOMImplementation();
1592
1593}
1594
Popular Tags