1
19 package org.apache.batik.anim.dom;
20
21 import java.net.URL;
22 import java.util.HashMap;
23
24 import org.apache.batik.css.dom.CSSOMSVGViewCSS;
25 import org.apache.batik.css.engine.CSSContext;
26 import org.apache.batik.css.engine.CSSEngine;
27 import org.apache.batik.css.engine.SVGCSSEngine;
28 import org.apache.batik.css.engine.value.ShorthandManager;
29 import org.apache.batik.css.engine.value.ValueManager;
30 import org.apache.batik.css.parser.ExtendedParser;
31 import org.apache.batik.dom.AbstractDocument;
32 import org.apache.batik.dom.AbstractStylableDocument;
33 import org.apache.batik.dom.ExtensibleDOMImplementation;
34 import org.apache.batik.dom.events.DOMTimeEvent;
35 import org.apache.batik.dom.events.DocumentEventSupport;
36 import org.apache.batik.dom.svg.SVGOMEvent;
37 import org.apache.batik.dom.util.CSSStyleDeclarationFactory;
38 import org.apache.batik.dom.util.DOMUtilities;
39
40 import org.apache.batik.i18n.LocalizableSupport;
41 import org.apache.batik.util.ParsedURL;
42 import org.apache.batik.util.SVGConstants;
43
44 import org.w3c.css.sac.InputSource;
45 import org.w3c.dom.DOMException;
46 import org.w3c.dom.DOMImplementation;
47 import org.w3c.dom.Document;
48 import org.w3c.dom.DocumentType;
49 import org.w3c.dom.Element;
50 import org.w3c.dom.Node;
51 import org.w3c.dom.css.CSSStyleDeclaration;
52 import org.w3c.dom.css.CSSStyleSheet;
53 import org.w3c.dom.css.ViewCSS;
54 import org.w3c.dom.events.Event;
55 import org.w3c.dom.stylesheets.StyleSheet;
56
57
64 public class SVGDOMImplementation
65 extends ExtensibleDOMImplementation
66 implements CSSStyleDeclarationFactory {
67
68
71 public static final String SVG_NAMESPACE_URI =
72 SVGConstants.SVG_NAMESPACE_URI;
73
74
77 protected static final String RESOURCES =
78 "org.apache.batik.dom.svg.resources.Messages";
79
80 protected HashMap<String, ElementFactory> factories;
81
82
85 public static DOMImplementation getDOMImplementation() {
86 return DOM_IMPLEMENTATION;
87 }
88
89
92 public SVGDOMImplementation() {
93 factories = svg11Factories;
94 registerFeature("CSS", "2.0");
95 registerFeature("StyleSheets", "2.0");
96 registerFeature("SVG", new String[] {"1.0", "1.1"});
97 registerFeature("SVGEvents", new String[] {"1.0", "1.1"});
98 }
99
100 protected void initLocalizable() {
101 localizableSupport = new LocalizableSupport
102 (RESOURCES, getClass().getClassLoader());
103 }
104
105 public CSSEngine createCSSEngine(AbstractStylableDocument doc,
106 CSSContext ctx,
107 ExtendedParser ep,
108 ValueManager [] vms,
109 ShorthandManager [] sms) {
110
111 ParsedURL durl = ((SVGOMDocument)doc).getParsedURL();
112 CSSEngine result = new SVGCSSEngine(doc, durl, ep, vms, sms, ctx);
113
114 URL url = getClass().getResource("resources/UserAgentStyleSheet.css");
115 if (url != null) {
116 ParsedURL purl = new ParsedURL(url);
117 InputSource is = new InputSource(purl.toString());
118 result.setUserAgentStyleSheet
119 (result.parseStyleSheet(is, purl, "all"));
120 }
121
122 return result;
123 }
124
125
128 public ViewCSS createViewCSS(AbstractStylableDocument doc) {
129 return new CSSOMSVGViewCSS(doc.getCSSEngine());
130 }
131
132
136 public Document createDocument(String namespaceURI,
137 String qualifiedName,
138 DocumentType doctype)
139 throws DOMException {
140 Document result = new SVGOMDocument(doctype, this);
141
142 if (qualifiedName != null)
143 result.appendChild(result.createElementNS(namespaceURI,
144 qualifiedName));
145 return result;
146 }
147
148
149
150
154 public CSSStyleSheet createCSSStyleSheet(String title, String media) {
155 throw new UnsupportedOperationException
156 ("DOMImplementationCSS.createCSSStyleSheet is not implemented");
157 }
158
159
160
161
165 public CSSStyleDeclaration createCSSStyleDeclaration() {
166 throw new UnsupportedOperationException
167 ("CSSStyleDeclarationFactory.createCSSStyleDeclaration is not implemented");
168 }
169
170
171
172
176 public StyleSheet createStyleSheet(Node n, HashMap<String, String> attrs) {
177 throw new UnsupportedOperationException
178 ("StyleSheetFactory.createStyleSheet is not implemented");
179 }
180
181
184 public CSSStyleSheet getUserAgentStyleSheet() {
185 throw new UnsupportedOperationException
186 ("StyleSheetFactory.getUserAgentStyleSheet is not implemented");
187 }
188
189
193 public Element createElementNS(AbstractDocument document,
194 String namespaceURI,
195 String qualifiedName) {
196 if (SVGConstants.SVG_NAMESPACE_URI.equals(namespaceURI)) {
197 String name = DOMUtilities.getLocalName(qualifiedName);
198 ElementFactory ef = factories.get(name);
199 if (ef != null)
200 return ef.create(DOMUtilities.getPrefix(qualifiedName),
201 document);
202 throw document.createDOMException
203 (DOMException.NOT_FOUND_ERR, "invalid.element",
204 new Object[] { namespaceURI, qualifiedName });
205 }
206
207 return super.createElementNS(document, namespaceURI, qualifiedName);
208 }
209
210
214 public DocumentEventSupport createDocumentEventSupport() {
215 DocumentEventSupport result = new DocumentEventSupport();
216 result.registerEventFactory("SVGEvents",
217 new DocumentEventSupport.EventFactory() {
218 public Event createEvent() {
219 return new SVGOMEvent();
220 }
221 });
222 result.registerEventFactory("TimeEvent",
223 new DocumentEventSupport.EventFactory() {
224 public Event createEvent() {
225 return new DOMTimeEvent();
226 }
227 });
228 return result;
229 }
230
231
232
233
236 protected static HashMap<String, ElementFactory> svg11Factories = new HashMap<String, ElementFactory>();
237
238 static {
239 svg11Factories.put(SVGConstants.SVG_A_TAG,
240 new AElementFactory());
241
242 svg11Factories.put(SVGConstants.SVG_ALT_GLYPH_TAG,
243 new AltGlyphElementFactory());
244
245 svg11Factories.put(SVGConstants.SVG_ALT_GLYPH_DEF_TAG,
246 new AltGlyphDefElementFactory());
247
248 svg11Factories.put(SVGConstants.SVG_ALT_GLYPH_ITEM_TAG,
249 new AltGlyphItemElementFactory());
250
251 svg11Factories.put(SVGConstants.SVG_ANIMATE_TAG,
252 new AnimateElementFactory());
253
254 svg11Factories.put(SVGConstants.SVG_ANIMATE_COLOR_TAG,
255 new AnimateColorElementFactory());
256
257 svg11Factories.put(SVGConstants.SVG_ANIMATE_MOTION_TAG,
258 new AnimateMotionElementFactory());
259
260 svg11Factories.put(SVGConstants.SVG_ANIMATE_TRANSFORM_TAG,
261 new AnimateTransformElementFactory());
262
263 svg11Factories.put(SVGConstants.SVG_CIRCLE_TAG,
264 new CircleElementFactory());
265
266 svg11Factories.put(SVGConstants.SVG_CLIP_PATH_TAG,
267 new ClipPathElementFactory());
268
269 svg11Factories.put(SVGConstants.SVG_COLOR_PROFILE_TAG,
270 new ColorProfileElementFactory());
271
272 svg11Factories.put(SVGConstants.SVG_CURSOR_TAG,
273 new CursorElementFactory());
274
275 svg11Factories.put(SVGConstants.SVG_DEFINITION_SRC_TAG,
276 new DefinitionSrcElementFactory());
277
278 svg11Factories.put(SVGConstants.SVG_DEFS_TAG,
279 new DefsElementFactory());
280
281 svg11Factories.put(SVGConstants.SVG_DESC_TAG,
282 new DescElementFactory());
283
284 svg11Factories.put(SVGConstants.SVG_ELLIPSE_TAG,
285 new EllipseElementFactory());
286
287 svg11Factories.put(SVGConstants.SVG_FE_BLEND_TAG,
288 new FeBlendElementFactory());
289
290 svg11Factories.put(SVGConstants.SVG_FE_COLOR_MATRIX_TAG,
291 new FeColorMatrixElementFactory());
292
293 svg11Factories.put(SVGConstants.SVG_FE_COMPONENT_TRANSFER_TAG,
294 new FeComponentTransferElementFactory());
295
296 svg11Factories.put(SVGConstants.SVG_FE_COMPOSITE_TAG,
297 new FeCompositeElementFactory());
298
299 svg11Factories.put(SVGConstants.SVG_FE_CONVOLVE_MATRIX_TAG,
300 new FeConvolveMatrixElementFactory());
301
302 svg11Factories.put(SVGConstants.SVG_FE_DIFFUSE_LIGHTING_TAG,
303 new FeDiffuseLightingElementFactory());
304
305 svg11Factories.put(SVGConstants.SVG_FE_DISPLACEMENT_MAP_TAG,
306 new FeDisplacementMapElementFactory());
307
308 svg11Factories.put(SVGConstants.SVG_FE_DISTANT_LIGHT_TAG,
309 new FeDistantLightElementFactory());
310
311 svg11Factories.put(SVGConstants.SVG_FE_FLOOD_TAG,
312 new FeFloodElementFactory());
313
314 svg11Factories.put(SVGConstants.SVG_FE_FUNC_A_TAG,
315 new FeFuncAElementFactory());
316
317 svg11Factories.put(SVGConstants.SVG_FE_FUNC_R_TAG,
318 new FeFuncRElementFactory());
319
320 svg11Factories.put(SVGConstants.SVG_FE_FUNC_G_TAG,
321 new FeFuncGElementFactory());
322
323 svg11Factories.put(SVGConstants.SVG_FE_FUNC_B_TAG,
324 new FeFuncBElementFactory());
325
326 svg11Factories.put(SVGConstants.SVG_FE_GAUSSIAN_BLUR_TAG,
327 new FeGaussianBlurElementFactory());
328
329 svg11Factories.put(SVGConstants.SVG_FE_IMAGE_TAG,
330 new FeImageElementFactory());
331
332 svg11Factories.put(SVGConstants.SVG_FE_MERGE_TAG,
333 new FeMergeElementFactory());
334
335 svg11Factories.put(SVGConstants.SVG_FE_MERGE_NODE_TAG,
336 new FeMergeNodeElementFactory());
337
338 svg11Factories.put(SVGConstants.SVG_FE_MORPHOLOGY_TAG,
339 new FeMorphologyElementFactory());
340
341 svg11Factories.put(SVGConstants.SVG_FE_OFFSET_TAG,
342 new FeOffsetElementFactory());
343
344 svg11Factories.put(SVGConstants.SVG_FE_POINT_LIGHT_TAG,
345 new FePointLightElementFactory());
346
347 svg11Factories.put(SVGConstants.SVG_FE_SPECULAR_LIGHTING_TAG,
348 new FeSpecularLightingElementFactory());
349
350 svg11Factories.put(SVGConstants.SVG_FE_SPOT_LIGHT_TAG,
351 new FeSpotLightElementFactory());
352
353 svg11Factories.put(SVGConstants.SVG_FE_TILE_TAG,
354 new FeTileElementFactory());
355
356 svg11Factories.put(SVGConstants.SVG_FE_TURBULENCE_TAG,
357 new FeTurbulenceElementFactory());
358
359 svg11Factories.put(SVGConstants.SVG_FILTER_TAG,
360 new FilterElementFactory());
361
362 svg11Factories.put(SVGConstants.SVG_FONT_TAG,
363 new FontElementFactory());
364
365 svg11Factories.put(SVGConstants.SVG_FONT_FACE_TAG,
366 new FontFaceElementFactory());
367
368 svg11Factories.put(SVGConstants.SVG_FONT_FACE_FORMAT_TAG,
369 new FontFaceFormatElementFactory());
370
371 svg11Factories.put(SVGConstants.SVG_FONT_FACE_NAME_TAG,
372 new FontFaceNameElementFactory());
373
374 svg11Factories.put(SVGConstants.SVG_FONT_FACE_SRC_TAG,
375 new FontFaceSrcElementFactory());
376
377 svg11Factories.put(SVGConstants.SVG_FONT_FACE_URI_TAG,
378 new FontFaceUriElementFactory());
379
380 svg11Factories.put(SVGConstants.SVG_FOREIGN_OBJECT_TAG,
381 new ForeignObjectElementFactory());
382
383 svg11Factories.put(SVGConstants.SVG_G_TAG,
384 new GElementFactory());
385
386 svg11Factories.put(SVGConstants.SVG_GLYPH_TAG,
387 new GlyphElementFactory());
388
389 svg11Factories.put(SVGConstants.SVG_GLYPH_REF_TAG,
390 new GlyphRefElementFactory());
391
392 svg11Factories.put(SVGConstants.SVG_HKERN_TAG,
393 new HkernElementFactory());
394
395 svg11Factories.put(SVGConstants.SVG_IMAGE_TAG,
396 new ImageElementFactory());
397
398 svg11Factories.put(SVGConstants.SVG_LINE_TAG,
399 new LineElementFactory());
400
401 svg11Factories.put(SVGConstants.SVG_LINEAR_GRADIENT_TAG,
402 new LinearGradientElementFactory());
403
404 svg11Factories.put(SVGConstants.SVG_MARKER_TAG,
405 new MarkerElementFactory());
406
407 svg11Factories.put(SVGConstants.SVG_MASK_TAG,
408 new MaskElementFactory());
409
410 svg11Factories.put(SVGConstants.SVG_METADATA_TAG,
411 new MetadataElementFactory());
412
413 svg11Factories.put(SVGConstants.SVG_MISSING_GLYPH_TAG,
414 new MissingGlyphElementFactory());
415
416 svg11Factories.put(SVGConstants.SVG_MPATH_TAG,
417 new MpathElementFactory());
418
419 svg11Factories.put(SVGConstants.SVG_PATH_TAG,
420 new PathElementFactory());
421
422 svg11Factories.put(SVGConstants.SVG_PATTERN_TAG,
423 new PatternElementFactory());
424
425 svg11Factories.put(SVGConstants.SVG_POLYGON_TAG,
426 new PolygonElementFactory());
427
428 svg11Factories.put(SVGConstants.SVG_POLYLINE_TAG,
429 new PolylineElementFactory());
430
431 svg11Factories.put(SVGConstants.SVG_RADIAL_GRADIENT_TAG,
432 new RadialGradientElementFactory());
433
434 svg11Factories.put(SVGConstants.SVG_RECT_TAG,
435 new RectElementFactory());
436
437 svg11Factories.put(SVGConstants.SVG_SET_TAG,
438 new SetElementFactory());
439
440 svg11Factories.put(SVGConstants.SVG_SCRIPT_TAG,
441 new ScriptElementFactory());
442
443 svg11Factories.put(SVGConstants.SVG_STOP_TAG,
444 new StopElementFactory());
445
446 svg11Factories.put(SVGConstants.SVG_STYLE_TAG,
447 new StyleElementFactory());
448
449 svg11Factories.put(SVGConstants.SVG_SVG_TAG,
450 new SvgElementFactory());
451
452 svg11Factories.put(SVGConstants.SVG_SWITCH_TAG,
453 new SwitchElementFactory());
454
455 svg11Factories.put(SVGConstants.SVG_SYMBOL_TAG,
456 new SymbolElementFactory());
457
458 svg11Factories.put(SVGConstants.SVG_TEXT_TAG,
459 new TextElementFactory());
460
461 svg11Factories.put(SVGConstants.SVG_TEXT_PATH_TAG,
462 new TextPathElementFactory());
463
464 svg11Factories.put(SVGConstants.SVG_TITLE_TAG,
465 new TitleElementFactory());
466
467 svg11Factories.put(SVGConstants.SVG_TREF_TAG,
468 new TrefElementFactory());
469
470 svg11Factories.put(SVGConstants.SVG_TSPAN_TAG,
471 new TspanElementFactory());
472
473 svg11Factories.put(SVGConstants.SVG_USE_TAG,
474 new UseElementFactory());
475
476 svg11Factories.put(SVGConstants.SVG_VIEW_TAG,
477 new ViewElementFactory());
478
479 svg11Factories.put(SVGConstants.SVG_VKERN_TAG,
480 new VkernElementFactory());
481 }
482
483
486 protected static class AElementFactory implements ElementFactory {
487 public AElementFactory() {}
488
491 public Element create(String prefix, Document doc) {
492 return new SVGOMAElement(prefix, (AbstractDocument)doc);
493 }
494 }
495
496
499 protected static class AltGlyphElementFactory implements ElementFactory {
500 public AltGlyphElementFactory() {}
501
504 public Element create(String prefix, Document doc) {
505 return new SVGOMAltGlyphElement(prefix, (AbstractDocument)doc);
506 }
507 }
508
509
512 protected static class AltGlyphDefElementFactory
513 implements ElementFactory {
514 public AltGlyphDefElementFactory() {}
515
518 public Element create(String prefix, Document doc) {
519 return new SVGOMAltGlyphDefElement(prefix, (AbstractDocument)doc);
520 }
521 }
522
523
526 protected static class AltGlyphItemElementFactory
527 implements ElementFactory {
528 public AltGlyphItemElementFactory() {}
529
532 public Element create(String prefix, Document doc) {
533 return new SVGOMAltGlyphItemElement(prefix, (AbstractDocument)doc);
534 }
535 }
536
537
540 protected static class AnimateElementFactory implements ElementFactory {
541 public AnimateElementFactory() {}
542
545 public Element create(String prefix, Document doc) {
546 return new SVGOMAnimateElement(prefix, (AbstractDocument)doc);
547 }
548 }
549
550
553 protected static class AnimateColorElementFactory
554 implements ElementFactory {
555 public AnimateColorElementFactory() {}
556
559 public Element create(String prefix, Document doc) {
560 return new SVGOMAnimateColorElement(prefix, (AbstractDocument)doc);
561 }
562 }
563
564
567 protected static class AnimateMotionElementFactory
568 implements ElementFactory {
569 public AnimateMotionElementFactory() {}
570
573 public Element create(String prefix, Document doc) {
574 return new SVGOMAnimateMotionElement(prefix,
575 (AbstractDocument)doc);
576 }
577 }
578
579
582 protected static class AnimateTransformElementFactory
583 implements ElementFactory {
584 public AnimateTransformElementFactory() {}
585
588 public Element create(String prefix, Document doc) {
589 return new SVGOMAnimateTransformElement(prefix,
590 (AbstractDocument)doc);
591 }
592 }
593
594
597 protected static class CircleElementFactory implements ElementFactory {
598 public CircleElementFactory() {}
599
602 public Element create(String prefix, Document doc) {
603 return new SVGOMCircleElement(prefix, (AbstractDocument)doc);
604 }
605 }
606
607
610 protected static class ClipPathElementFactory implements ElementFactory {
611 public ClipPathElementFactory() {}
612
615 public Element create(String prefix, Document doc) {
616 return new SVGOMClipPathElement(prefix, (AbstractDocument)doc);
617 }
618 }
619
620
623 protected static class ColorProfileElementFactory
624 implements ElementFactory {
625 public ColorProfileElementFactory() {}
626
629 public Element create(String prefix, Document doc) {
630 return new SVGOMColorProfileElement(prefix, (AbstractDocument)doc);
631 }
632 }
633
634
637 protected static class CursorElementFactory implements ElementFactory {
638 public CursorElementFactory() {}
639
642 public Element create(String prefix, Document doc) {
643 return new SVGOMCursorElement(prefix, (AbstractDocument)doc);
644 }
645 }
646
647
650 protected static class DefinitionSrcElementFactory
651 implements ElementFactory {
652 public DefinitionSrcElementFactory() {}
653
656 public Element create(String prefix, Document doc) {
657 return new SVGOMDefinitionSrcElement(prefix,
658 (AbstractDocument)doc);
659 }
660 }
661
662
665 protected static class DefsElementFactory implements ElementFactory {
666 public DefsElementFactory() {}
667
670 public Element create(String prefix, Document doc) {
671 return new SVGOMDefsElement(prefix, (AbstractDocument)doc);
672 }
673 }
674
675
678 protected static class DescElementFactory implements ElementFactory {
679 public DescElementFactory() {}
680
683 public Element create(String prefix, Document doc) {
684 return new SVGOMDescElement(prefix, (AbstractDocument)doc);
685 }
686 }
687
688
691 protected static class EllipseElementFactory implements ElementFactory {
692 public EllipseElementFactory() {}
693
696 public Element create(String prefix, Document doc) {
697 return new SVGOMEllipseElement(prefix, (AbstractDocument)doc);
698 }
699 }
700
701
704 protected static class FeBlendElementFactory implements ElementFactory {
705 public FeBlendElementFactory() {}
706
709 public Element create(String prefix, Document doc) {
710 return new SVGOMFEBlendElement(prefix, (AbstractDocument)doc);
711 }
712 }
713
714
717 protected static class FeColorMatrixElementFactory
718 implements ElementFactory {
719 public FeColorMatrixElementFactory() {}
720
723 public Element create(String prefix, Document doc) {
724 return new SVGOMFEColorMatrixElement(prefix,
725 (AbstractDocument)doc);
726 }
727 }
728
729
732 protected static class FeComponentTransferElementFactory
733 implements ElementFactory {
734 public FeComponentTransferElementFactory() {}
735
738 public Element create(String prefix, Document doc) {
739 return new SVGOMFEComponentTransferElement(prefix,
740 (AbstractDocument)doc);
741 }
742 }
743
744
747 protected static class FeCompositeElementFactory
748 implements ElementFactory {
749 public FeCompositeElementFactory() {}
750
753 public Element create(String prefix, Document doc) {
754 return new SVGOMFECompositeElement(prefix, (AbstractDocument)doc);
755 }
756 }
757
758
761 protected static class FeConvolveMatrixElementFactory
762 implements ElementFactory {
763 public FeConvolveMatrixElementFactory() {}
764
767 public Element create(String prefix, Document doc) {
768 return new SVGOMFEConvolveMatrixElement(prefix,
769 (AbstractDocument)doc);
770 }
771 }
772
773
776 protected static class FeDiffuseLightingElementFactory
777 implements ElementFactory {
778 public FeDiffuseLightingElementFactory() {}
779
782 public Element create(String prefix, Document doc) {
783 return new SVGOMFEDiffuseLightingElement(prefix,
784 (AbstractDocument)doc);
785 }
786 }
787
788
791 protected static class FeDisplacementMapElementFactory
792 implements ElementFactory {
793 public FeDisplacementMapElementFactory() {}
794
797 public Element create(String prefix, Document doc) {
798 return new SVGOMFEDisplacementMapElement(prefix,
799 (AbstractDocument)doc);
800 }
801 }
802
803
806 protected static class FeDistantLightElementFactory
807 implements ElementFactory {
808 public FeDistantLightElementFactory() {}
809
812 public Element create(String prefix, Document doc) {
813 return new SVGOMFEDistantLightElement(prefix,
814 (AbstractDocument)doc);
815 }
816 }
817
818
821 protected static class FeFloodElementFactory implements ElementFactory {
822 public FeFloodElementFactory() {}
823
826 public Element create(String prefix, Document doc) {
827 return new SVGOMFEFloodElement(prefix, (AbstractDocument)doc);
828 }
829 }
830
831
834 protected static class FeFuncAElementFactory implements ElementFactory {
835 public FeFuncAElementFactory() {}
836
839 public Element create(String prefix, Document doc) {
840 return new SVGOMFEFuncAElement(prefix, (AbstractDocument)doc);
841 }
842 }
843
844
847 protected static class FeFuncRElementFactory implements ElementFactory {
848 public FeFuncRElementFactory() {}
849
852 public Element create(String prefix, Document doc) {
853 return new SVGOMFEFuncRElement(prefix, (AbstractDocument)doc);
854 }
855 }
856
857
860 protected static class FeFuncGElementFactory implements ElementFactory {
861 public FeFuncGElementFactory() {}
862
865 public Element create(String prefix, Document doc) {
866 return new SVGOMFEFuncGElement(prefix, (AbstractDocument)doc);
867 }
868 }
869
870
871
874 protected static class FeFuncBElementFactory
875 implements ElementFactory {
876 public FeFuncBElementFactory() {}
877
880 public Element create(String prefix, Document doc) {
881 return new SVGOMFEFuncBElement(prefix, (AbstractDocument)doc);
882 }
883 }
884
885
888 protected static class FeGaussianBlurElementFactory
889 implements ElementFactory {
890 public FeGaussianBlurElementFactory() {}
891
894 public Element create(String prefix, Document doc) {
895 return new SVGOMFEGaussianBlurElement(prefix,
896 (AbstractDocument)doc);
897 }
898 }
899
900
903 protected static class FeImageElementFactory implements ElementFactory {
904 public FeImageElementFactory() {}
905
908 public Element create(String prefix, Document doc) {
909 return new SVGOMFEImageElement(prefix, (AbstractDocument)doc);
910 }
911 }
912
913
916 protected static class FeMergeElementFactory
917 implements ElementFactory {
918 public FeMergeElementFactory() {}
919
922 public Element create(String prefix, Document doc) {
923 return new SVGOMFEMergeElement(prefix, (AbstractDocument)doc);
924 }
925 }
926
927
930 protected static class FeMergeNodeElementFactory
931 implements ElementFactory {
932 public FeMergeNodeElementFactory() {}
933
936 public Element create(String prefix, Document doc) {
937 return new SVGOMFEMergeNodeElement(prefix, (AbstractDocument)doc);
938 }
939 }
940
941
944 protected static class FeMorphologyElementFactory
945 implements ElementFactory {
946 public FeMorphologyElementFactory() {}
947
950 public Element create(String prefix, Document doc) {
951 return new SVGOMFEMorphologyElement(prefix,
952 (AbstractDocument)doc);
953 }
954 }
955
956
959 protected static class FeOffsetElementFactory implements ElementFactory {
960 public FeOffsetElementFactory() {}
961
964 public Element create(String prefix, Document doc) {
965 return new SVGOMFEOffsetElement(prefix, (AbstractDocument)doc);
966 }
967 }
968
969
972 protected static class FePointLightElementFactory
973 implements ElementFactory {
974 public FePointLightElementFactory() {}
975
978 public Element create(String prefix, Document doc) {
979 return new SVGOMFEPointLightElement(prefix, (AbstractDocument)doc);
980 }
981 }
982
983
986 protected static class FeSpecularLightingElementFactory
987 implements ElementFactory {
988 public FeSpecularLightingElementFactory() {}
989
992 public Element create(String prefix, Document doc) {
993 return new SVGOMFESpecularLightingElement(prefix,
994 (AbstractDocument)doc);
995 }
996 }
997
998
1001 protected static class FeSpotLightElementFactory
1002 implements ElementFactory {
1003 public FeSpotLightElementFactory() {}
1004
1007 public Element create(String prefix, Document doc) {
1008 return new SVGOMFESpotLightElement(prefix, (AbstractDocument)doc);
1009 }
1010 }
1011
1012
1015 protected static class FeTileElementFactory implements ElementFactory {
1016 public FeTileElementFactory() {}
1017
1020 public Element create(String prefix, Document doc) {
1021 return new SVGOMFETileElement(prefix, (AbstractDocument)doc);
1022 }
1023 }
1024
1025
1028 protected static class FeTurbulenceElementFactory
1029 implements ElementFactory{
1030 public FeTurbulenceElementFactory() {}
1031
1034 public Element create(String prefix, Document doc) {
1035 return new SVGOMFETurbulenceElement(prefix, (AbstractDocument)doc);
1036 }
1037 }
1038
1039
1042 protected static class FilterElementFactory implements ElementFactory {
1043 public FilterElementFactory() {}
1044
1047 public Element create(String prefix, Document doc) {
1048 return new SVGOMFilterElement(prefix, (AbstractDocument)doc);
1049 }
1050 }
1051
1052
1055 protected static class FontElementFactory implements ElementFactory {
1056 public FontElementFactory() {}
1057
1060 public Element create(String prefix, Document doc) {
1061 return new SVGOMFontElement(prefix, (AbstractDocument)doc);
1062 }
1063 }
1064
1065
1068 protected static class FontFaceElementFactory implements ElementFactory {
1069 public FontFaceElementFactory() {}
1070
1073 public Element create(String prefix, Document doc) {
1074 return new SVGOMFontFaceElement(prefix, (AbstractDocument)doc);
1075 }
1076 }
1077
1078
1081 protected static class FontFaceFormatElementFactory
1082 implements ElementFactory {
1083 public FontFaceFormatElementFactory() {}
1084
1087 public Element create(String prefix, Document doc) {
1088 return new SVGOMFontFaceFormatElement(prefix,
1089 (AbstractDocument)doc);
1090 }
1091 }
1092
1093
1096 protected static class FontFaceNameElementFactory
1097 implements ElementFactory {
1098 public FontFaceNameElementFactory() {}
1099
1102 public Element create(String prefix, Document doc) {
1103 return new SVGOMFontFaceNameElement(prefix, (AbstractDocument)doc);
1104 }
1105 }
1106
1107
1110 protected static class FontFaceSrcElementFactory
1111 implements ElementFactory {
1112 public FontFaceSrcElementFactory() {}
1113
1116 public Element create(String prefix, Document doc) {
1117 return new SVGOMFontFaceSrcElement(prefix, (AbstractDocument)doc);
1118 }
1119 }
1120
1121
1124 protected static class FontFaceUriElementFactory
1125 implements ElementFactory {
1126 public FontFaceUriElementFactory() {}
1127
1130 public Element create(String prefix, Document doc) {
1131 return new SVGOMFontFaceUriElement(prefix, (AbstractDocument)doc);
1132 }
1133 }
1134
1135
1138 protected static class ForeignObjectElementFactory
1139 implements ElementFactory {
1140 public ForeignObjectElementFactory() {}
1141
1144 public Element create(String prefix, Document doc) {
1145 return new SVGOMForeignObjectElement(prefix,
1146 (AbstractDocument)doc);
1147 }
1148 }
1149
1150
1153 protected static class GElementFactory implements ElementFactory {
1154 public GElementFactory() {}
1155
1158 public Element create(String prefix, Document doc) {
1159 return new SVGOMGElement(prefix, (AbstractDocument)doc);
1160 }
1161 }
1162
1163
1166 protected static class GlyphElementFactory implements ElementFactory {
1167 public GlyphElementFactory() {}
1168
1171 public Element create(String prefix, Document doc) {
1172 return new SVGOMGlyphElement(prefix, (AbstractDocument)doc);
1173 }
1174 }
1175
1176
1179 protected static class GlyphRefElementFactory implements ElementFactory {
1180 public GlyphRefElementFactory() {}
1181
1184 public Element create(String prefix, Document doc) {
1185 return new SVGOMGlyphRefElement(prefix, (AbstractDocument)doc);
1186 }
1187 }
1188
1189
1192 protected static class HkernElementFactory implements ElementFactory {
1193 public HkernElementFactory() {}
1194
1197 public Element create(String prefix, Document doc) {
1198 return new SVGOMHKernElement(prefix, (AbstractDocument)doc);
1199 }
1200 }
1201
1202
1205 protected static class ImageElementFactory implements ElementFactory {
1206 public ImageElementFactory() {}
1207
1210 public Element create(String prefix, Document doc) {
1211 return new SVGOMImageElement(prefix, (AbstractDocument)doc);
1212 }
1213 }
1214
1215
1218 protected static class LineElementFactory implements ElementFactory {
1219 public LineElementFactory() {}
1220
1223 public Element create(String prefix, Document doc) {
1224 return new SVGOMLineElement(prefix, (AbstractDocument)doc);
1225 }
1226 }
1227
1228
1231 protected static class LinearGradientElementFactory
1232 implements ElementFactory {
1233 public LinearGradientElementFactory() {}
1234
1237 public Element create(String prefix, Document doc) {
1238 return new SVGOMLinearGradientElement(prefix,
1239 (AbstractDocument)doc);
1240 }
1241 }
1242
1243
1246 protected static class MarkerElementFactory implements ElementFactory {
1247 public MarkerElementFactory() {}
1248
1251 public Element create(String prefix, Document doc) {
1252 return new SVGOMMarkerElement(prefix, (AbstractDocument)doc);
1253 }
1254 }
1255
1256
1259 protected static class MaskElementFactory implements ElementFactory {
1260 public MaskElementFactory() {}
1261
1264 public Element create(String prefix, Document doc) {
1265 return new SVGOMMaskElement(prefix, (AbstractDocument)doc);
1266 }
1267 }
1268
1269
1272 protected static class MetadataElementFactory implements ElementFactory {
1273 public MetadataElementFactory() {}
1274
1277 public Element create(String prefix, Document doc) {
1278 return new SVGOMMetadataElement(prefix, (AbstractDocument)doc);
1279 }
1280 }
1281
1282
1285 protected static class MissingGlyphElementFactory
1286 implements ElementFactory {
1287 public MissingGlyphElementFactory() {}
1288
1291 public Element create(String prefix, Document doc) {
1292 return new SVGOMMissingGlyphElement(prefix, (AbstractDocument)doc);
1293 }
1294 }
1295
1296
1299 protected static class MpathElementFactory implements ElementFactory {
1300 public MpathElementFactory() {}
1301
1304 public Element create(String prefix, Document doc) {
1305 return new SVGOMMPathElement(prefix, (AbstractDocument)doc);
1306 }
1307 }
1308
1309
1312 protected static class PathElementFactory implements ElementFactory {
1313 public PathElementFactory() {}
1314
1317 public Element create(String prefix, Document doc) {
1318 return new SVGOMPathElement(prefix, (AbstractDocument)doc);
1319 }
1320 }
1321
1322
1325 protected static class PatternElementFactory implements ElementFactory {
1326 public PatternElementFactory() {}
1327
1330 public Element create(String prefix, Document doc) {
1331 return new SVGOMPatternElement(prefix, (AbstractDocument)doc);
1332 }
1333 }
1334
1335
1338 protected static class PolygonElementFactory implements ElementFactory {
1339 public PolygonElementFactory() {}
1340
1343 public Element create(String prefix, Document doc) {
1344 return new SVGOMPolygonElement(prefix, (AbstractDocument)doc);
1345 }
1346 }
1347
1348
1351 protected static class PolylineElementFactory implements ElementFactory {
1352 public PolylineElementFactory() {}
1353
1356 public Element create(String prefix, Document doc) {
1357 return new SVGOMPolylineElement(prefix, (AbstractDocument)doc);
1358 }
1359 }
1360
1361
1364 protected static class RadialGradientElementFactory
1365 implements ElementFactory {
1366 public RadialGradientElementFactory() {}
1367
1370 public Element create(String prefix, Document doc) {
1371 return new SVGOMRadialGradientElement(prefix,
1372 (AbstractDocument)doc);
1373 }
1374 }
1375
1376
1379 protected static class RectElementFactory implements ElementFactory {
1380 public RectElementFactory() {}
1381
1384 public Element create(String prefix, Document doc) {
1385 return new SVGOMRectElement(prefix, (AbstractDocument)doc);
1386 }
1387 }
1388
1389
1392 protected static class ScriptElementFactory implements ElementFactory {
1393 public ScriptElementFactory() {}
1394
1397 public Element create(String prefix, Document doc) {
1398 return new SVGOMScriptElement(prefix, (AbstractDocument)doc);
1399 }
1400 }
1401
1402
1405 protected static class SetElementFactory implements ElementFactory {
1406 public SetElementFactory() {}
1407
1410 public Element create(String prefix, Document doc) {
1411 return new SVGOMSetElement(prefix, (AbstractDocument)doc);
1412 }
1413 }
1414
1415
1418 protected static class StopElementFactory implements ElementFactory {
1419 public StopElementFactory() {}
1420
1423 public Element create(String prefix, Document doc) {
1424 return new SVGOMStopElement(prefix, (AbstractDocument)doc);
1425 }
1426 }
1427
1428
1431 protected static class StyleElementFactory implements ElementFactory {
1432 public StyleElementFactory() {}
1433
1436 public Element create(String prefix, Document doc) {
1437 return new SVGOMStyleElement(prefix, (AbstractDocument)doc);
1438 }
1439 }
1440
1441
1444 protected static class SvgElementFactory implements ElementFactory {
1445 public SvgElementFactory() {}
1446
1449 public Element create(String prefix, Document doc) {
1450 return new SVGOMSVGElement(prefix, (AbstractDocument)doc);
1451 }
1452 }
1453
1454
1457 protected static class SwitchElementFactory implements ElementFactory {
1458 public SwitchElementFactory() {}
1459
1462 public Element create(String prefix, Document doc) {
1463 return new SVGOMSwitchElement(prefix, (AbstractDocument)doc);
1464 }
1465 }
1466
1467
1470 protected static class SymbolElementFactory implements ElementFactory {
1471 public SymbolElementFactory() {}
1472
1475 public Element create(String prefix, Document doc) {
1476 return new SVGOMSymbolElement(prefix, (AbstractDocument)doc);
1477 }
1478 }
1479
1480
1483 protected static class TextElementFactory implements ElementFactory {
1484 public TextElementFactory() {}
1485
1488 public Element create(String prefix, Document doc) {
1489 return new SVGOMTextElement(prefix, (AbstractDocument)doc);
1490 }
1491 }
1492
1493
1496 protected static class TextPathElementFactory implements ElementFactory {
1497 public TextPathElementFactory() {}
1498
1501 public Element create(String prefix, Document doc) {
1502 return new SVGOMTextPathElement(prefix, (AbstractDocument)doc);
1503 }
1504 }
1505
1506
1509 protected static class TitleElementFactory implements ElementFactory {
1510 public TitleElementFactory() {}
1511
1514 public Element create(String prefix, Document doc) {
1515 return new SVGOMTitleElement(prefix, (AbstractDocument)doc);
1516 }
1517 }
1518
1519
1522 protected static class TrefElementFactory implements ElementFactory {
1523 public TrefElementFactory() {}
1524
1527 public Element create(String prefix, Document doc) {
1528 return new SVGOMTRefElement(prefix, (AbstractDocument)doc);
1529 }
1530 }
1531
1532
1535 protected static class TspanElementFactory implements ElementFactory {
1536 public TspanElementFactory() {}
1537
1540 public Element create(String prefix, Document doc) {
1541 return new SVGOMTSpanElement(prefix, (AbstractDocument)doc);
1542 }
1543 }
1544
1545
1548 protected static class UseElementFactory implements ElementFactory {
1549 public UseElementFactory() {}
1550
1553 public Element create(String prefix, Document doc) {
1554 return new SVGOMUseElement(prefix, (AbstractDocument)doc);
1555 }
1556 }
1557
1558
1561 protected static class ViewElementFactory implements ElementFactory {
1562 public ViewElementFactory() {}
1563
1566 public Element create(String prefix, Document doc) {
1567 return new SVGOMViewElement(prefix, (AbstractDocument)doc);
1568 }
1569 }
1570
1571
1574 protected static class VkernElementFactory implements ElementFactory {
1575 public VkernElementFactory() {}
1576
1579 public Element create(String prefix, Document doc) {
1580 return new SVGOMVKernElement(prefix, (AbstractDocument)doc);
1581 }
1582 }
1583
1584
1587 protected static final DOMImplementation DOM_IMPLEMENTATION =
1588 new SVGDOMImplementation();
1589
1590 }
1591