]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Use automatically generated mappings
authorKaren Lease <klease@apache.org>
Fri, 10 Nov 2000 22:34:20 +0000 (22:34 +0000)
committerKaren Lease <klease@apache.org>
Fri, 10 Nov 2000 22:34:20 +0000 (22:34 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193776 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/svg/SVGPropertyListMapping.java

index f375e9a58722c7c5213d23fbcb530d964f20bc21..e6b8940e5a1f9a1269097ba75ec968e0d262c97e 100644 (file)
 package org.apache.fop.svg;
 
 import org.apache.fop.fo.*;
-import org.apache.fop.fo.properties.*;
+import org.apache.fop.fo.properties.SVGPropertyMapping;
 import org.apache.fop.dom.svg.SVGDocumentImpl;
 
-import java.util.Hashtable;
+import java.util.Enumeration;
 
 public class SVGPropertyListMapping implements PropertyListMapping {
 
     public void addToBuilder(TreeBuilder builder) {
 
-        String uri = SVGDocumentImpl.namespaceURI;
-        Hashtable propertyTable = new Hashtable();
-        propertyTable.put("height",SVGLengthProperty.maker());
-        propertyTable.put("width",SVGLengthProperty.maker());
-
-        propertyTable.put("x",SVGLengthProperty.maker());
-        propertyTable.put("y",SVGLengthProperty.maker());
-        propertyTable.put("x1",SVGLengthProperty.maker());
-        propertyTable.put("x2",SVGLengthProperty.maker());
-        propertyTable.put("y1",SVGLengthProperty.maker());
-        propertyTable.put("y2",SVGLengthProperty.maker());
-        propertyTable.put("rx",SVGLengthProperty.maker());
-        propertyTable.put("ry",SVGLengthProperty.maker());
-        propertyTable.put("dx",SVGLengthProperty.maker());
-        propertyTable.put("dy",SVGLengthProperty.maker());
-        propertyTable.put("cx",SVGLengthProperty.maker());
-        propertyTable.put("cy",SVGLengthProperty.maker());
-        propertyTable.put("r",SVGLengthProperty.maker());
-        propertyTable.put("fx",SVGLengthProperty.maker());
-        propertyTable.put("fy",SVGLengthProperty.maker());
-        propertyTable.put("refX",SVGLengthProperty.maker());
-        propertyTable.put("refY",SVGLengthProperty.maker());
-        propertyTable.put("markerWidth",SVGLengthProperty.maker());
-        propertyTable.put("markerHeight",SVGLengthProperty.maker());
-        propertyTable.put("offset",SVGLengthProperty.maker());
-
-        /*             propertyTable.put("orient",SVGOrient.maker());*/
-        propertyTable.put("xlink:href",HRef.maker());
-        propertyTable.put("style",SVGStyle.maker());
-        propertyTable.put("transform",SVGTransform.maker());
-        propertyTable.put("d",SVGD.maker());
-        propertyTable.put("points",SVGPoints.maker());
-        propertyTable.put("viewBox",ViewBox.maker());
-        propertyTable.put("xml:space",XMLSpace.maker());
-        propertyTable.put("spreadMethod",SpreadMethod.maker());
-        propertyTable.put("gradientUnits",GradientUnits.maker());
-
-        propertyTable.put("font-family",FontFamily.maker());
-        propertyTable.put("font-style",FontStyle.maker());
-        propertyTable.put("font-weight",FontWeight.maker());
-        propertyTable.put("font-size",FontSize.maker());
-        propertyTable.put("requiredFeatures", RequiredFeatures.maker());
-        propertyTable.put("requiredExtensions", RequiredExtensions.maker());
-        propertyTable.put("systemLanguage", SystemLanguage.maker());
-
-        propertyTable.put("id",Id.maker()); // attribute for objects
-        propertyTable.put("class",ElementClass.maker()); // class for styling
-
-        builder.addPropertyList(uri, propertyTable);
-        propertyTable = new Hashtable();
-        propertyTable.put("x",SVGLengthListProperty.maker());
-        propertyTable.put("y",SVGLengthListProperty.maker());
-        propertyTable.put("dx",SVGLengthListProperty.maker());
-        propertyTable.put("dy",SVGLengthListProperty.maker());
-        builder.addElementPropertyList(uri, "tref", propertyTable);
-        builder.addElementPropertyList(uri, "tspan", propertyTable);
+       String uri = SVGDocumentImpl.namespaceURI;
+        builder.addPropertyList(uri, SVGPropertyMapping.getGenericMappings());
+       /* Add any element mappings */
+       for (Enumeration e = SVGPropertyMapping.getElementMappings();
+            e.hasMoreElements();) {
+         String elem = (String)e.nextElement();
+         builder.addElementPropertyList(uri, elem,
+                 SVGPropertyMapping.getElementMapping(elem));
+       }
     }
 }