From a93ddf92d90ee5ef8a4995488dc330b289bcdde8 Mon Sep 17 00:00:00 2001 From: Glen Mazza Date: Sat, 20 Dec 2003 17:40:01 +0000 Subject: Property Makers now being activated via int constants. (Maker classes themselves, as well as code referencing the properties, still need conversion to int's. Also, HashMaps for String and Integer in FOPropertyMapping and FObj temporarily being retained for troubleshooting purposes.) Contribution mainly from Finn Bock (Bug #25480). git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197043 13f79535-47bb-0310-9956-ffa450edef68 --- src/codegen/fo-property-mapping.xsl | 272 ++++++++++++++++++++++++++++++++++++ src/codegen/propmap.xsl | 164 ---------------------- 2 files changed, 272 insertions(+), 164 deletions(-) create mode 100644 src/codegen/fo-property-mapping.xsl delete mode 100644 src/codegen/propmap.xsl (limited to 'src/codegen') diff --git a/src/codegen/fo-property-mapping.xsl b/src/codegen/fo-property-mapping.xsl new file mode 100644 index 000000000..a6a888898 --- /dev/null +++ b/src/codegen/fo-property-mapping.xsl @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + + + Maker + + + + + Maker + + + + + + + String.put("", .maker("")); + [PR_] =.maker(""); + addPropertyName("", PR_); + + + + + + + + + + + + + + + + + +package org.apache.fop.fo.properties; + +import java.util.HashMap; +import java.util.Set; +import org.apache.fop.fo.Property; +//import org.apache.fop.svg.*; + +public class PropertyMapping implements Constants { + + private static Property.Maker[] s_htGeneric = new Property.Maker[PROPERTY_COUNT+1]; + private static HashMap s_htGenericString = new HashMap(); // temporary + private static HashMap s_htElementStringLists = new HashMap(); // temporary + private static HashMap s_htElementLists = new HashMap(); + private static HashMap s_htSubPropNames = new HashMap(); + private static HashMap s_htPropNames = new HashMap(); + private static HashMap s_htPropIds = new HashMap(); + + private static HashMap s_ht; + + + + public static HashMap getGenericStringMappings() { + return s_htGenericString; + } + + public static Set getElementStringMappings() { + return s_htElementStringLists.keySet(); + } + + public static HashMap getElementStringMapping(String elemName) { + return (HashMap)s_htElementStringLists.get(elemName); + } + + public static Property.Maker[] getGenericMappings() { + return s_htGeneric; + } + + public static Set getElementMappings() { + return s_htElementLists.keySet(); + } + + public static Property.Maker[] getElementMapping(int elemName) { + return (Property.Maker[])s_htElementLists.get(new Integer(elemName)); + } + + public static int getPropertyId(String name) { + Integer i = (Integer) s_htPropNames.get(name); + if (i == null) + return -1; + return i.intValue(); + } + + public static int getSubPropertyId(String name) { + Integer i = (Integer) s_htSubPropNames.get(name); + if (i == null) + return -1; + return i.intValue(); + } + + public static String getPropertyName(int id) { + return (String) s_htPropIds.get(new Integer(id)); + } + + static { + addSubPropertyName("length", CP_LENGTH); + addSubPropertyName("conditionality", CP_CONDITIONALITY); + addSubPropertyName("block-progression-direction", CP_BLOCK_PROGRESSION_DIRECTION); + addSubPropertyName("inline-progression-direction", CP_INLINE_PROGRESSION_DIRECTION); + addSubPropertyName("within-line", CP_WITHIN_LINE); + addSubPropertyName("within-column", CP_WITHIN_COLUMN); + addSubPropertyName("within-page", CP_WITHIN_PAGE); + addSubPropertyName("minimum", CP_MINIMUM); + addSubPropertyName("maximum", CP_MAXIMUM); + addSubPropertyName("optimum", CP_OPTIMUM); + addSubPropertyName("precedence", CP_PRECEDENCE); + + } + + public static void addPropertyName(String name, int id) { + s_htPropNames.put(name, new Integer(id)); + s_htPropIds.put(new Integer(id), name); + } + + public static void addSubPropertyName(String name, int id) { + s_htSubPropNames.put(name, new Integer(id)); + s_htPropIds.put(new Integer(id), name); + } +} + + + + + static { + // Generate the generic mapping + + + + } + + + + + static { + s_ht = new HashMap(); + + s_htElementLists.put("", s_ht); + + + + s_ht + + } + + + + /* PROPCLASS = */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /* PROPCLASS = */ + + + + + diff --git a/src/codegen/propmap.xsl b/src/codegen/propmap.xsl deleted file mode 100644 index c300f5e49..000000000 --- a/src/codegen/propmap.xsl +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - - - - - - - - - - - - - Maker - - - - - Maker - - - - .put("", .maker("")); - - - - - - -package org.apache.fop.fo.properties; - -import java.util.HashMap; -import java.util.Set; -//import org.apache.fop.svg.*; - -public class PropertyMapping { - - private static HashMap s_htGeneric = new HashMap(); - private static HashMap s_htElementLists = new HashMap(); - - private static HashMap s_ht; - - - - public static HashMap getGenericMappings() { - return s_htGeneric; - } - - public static Set getElementMappings() { - return s_htElementLists.keySet(); - } - - public static HashMap getElementMapping(String elemName) { - return (HashMap)s_htElementLists.get(elemName); - } -} - - - - static { - // Generate the generic mapping - - - - } - - - - - static { - s_ht = new HashMap(); - - s_htElementLists.put("", s_ht); - - - - s_ht - - } - - - - - - - - - - - - - - - - - - - - - - - /* PROPCLASS = */ - - - - - -- cgit v1.2.3