]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
updated to java2 collections
authorKeiron Liddle <keiron@apache.org>
Tue, 17 Sep 2002 09:28:59 +0000 (09:28 +0000)
committerKeiron Liddle <keiron@apache.org>
Tue, 17 Sep 2002 09:28:59 +0000 (09:28 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195206 13f79535-47bb-0310-9956-ffa450edef68

src/codegen/code-point-mapping.xsl
src/codegen/foproperties.xml
src/codegen/properties.xsl
src/codegen/t1font-file.xsl
src/codegen/ttffontfile.xsl

index ab4f26da9dea2f736275c30a4b2fbdfd4e6e20f8..32fc7cf9d9594cf21dc044b72342023d9b2954ba 100644 (file)
@@ -6,7 +6,9 @@
 
   <xsl:template match="encoding-set">
 package org.apache.fop.render.pdf;
-import java.util.Hashtable;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collections;
 
 public class CodePointMapping {
     private char[] latin1Map;
@@ -61,9 +63,9 @@ public class CodePointMapping {
         }
     }
 
-    private static Hashtable mappings;
+    private static Map mappings;
     static {
-       mappings = new Hashtable();
+        mappings = Collections.synchronizedMap(new HashMap());
     }
     public static CodePointMapping getMapping(String encoding) {
         CodePointMapping mapping = (CodePointMapping) mappings.get(encoding);
index a9253de3df6146d03179f5f51bfa545a211efff7..f245124bd0f9a5dc400ada1f89530ad0b3f9230b 100644 (file)
         <value const="AUTO">auto</value>
         <value const="FIXED">fixed</value>
         <value const="ABSOLUTE">absolute</value>
-        <value const="INHERIT">inherit</value>
       </enumeration>
     <default>auto</default>
   </property>
   <property>
     <name>caption-side</name>
     <inherited>true</inherited>
-    <datatype>ToBeImplemented</datatype>
+    <datatype>Enum</datatype>
+      <enumeration>
+        <value const="BEFORE">before</value>
+        <value const="AFTER">after</value>
+        <value const="START">start</value>
+        <value const="END">end</value>
+        <value const="TOP">top</value>
+        <value const="BOTTOM">bottom</value>
+        <value const="LEFT">left</value>
+        <value const="RIGHT">right</value>
+      </enumeration>
     <default>before</default>
   </property>
   <property>
index 62d2440c9bec3bd7927766a924974cc9b9d93641..fb7e65be098649974027c5f710b4e06872595e59 100644 (file)
@@ -56,9 +56,9 @@
 <!-- Look for keyword equivalents. Value is the new expression  -->
 <xsl:template match="keyword-equiv[1]">
     // Initialize hashtable of keywords
-    static Hashtable s_htKeywords;
+    static HashMap s_htKeywords;
     static {
-       s_htKeywords = new Hashtable(<xsl:value-of select="count(../keyword-equiv)"/>);
+       s_htKeywords = new HashMap(<xsl:value-of select="count(../keyword-equiv)"/>);
   <xsl:for-each select="../keyword-equiv">
        s_htKeywords.put("<xsl:value-of select="@match"/>", "<xsl:value-of select="."/>");
   </xsl:for-each>
 <redirect:write select="concat($classname, '.java')">
 package org.apache.fop.fo.properties;
 
-import java.util.Hashtable;
+import java.util.HashMap;
 import org.apache.fop.datatypes.*;
 import org.apache.fop.fo.*;
 import org.apache.fop.apps.FOPException;
index 27896d8983a3d06eff30fd057c05514fddcb8f3c..7f306fb07012d59ade9765cdf35cad2778ba97d2 100644 (file)
@@ -27,7 +27,7 @@ import org.apache.fop.pdf.PDFT1Stream;
 import java.io.InputStream;
 import java.io.FileInputStream;
 import java.io.BufferedInputStream;
-import java.util.Hashtable;
+import java.util.HashMap;
 
 public class <xsl:value-of select="class-name"/> extends Font implements FontDescriptor {
     private final static String fontName = "<xsl:value-of select="font-name"/>";
@@ -51,24 +51,24 @@ public class <xsl:value-of select="class-name"/> extends Font implements FontDes
     private final static int firstChar = <xsl:value-of select="first-char"/>;
     private final static int lastChar = <xsl:value-of select="last-char"/>;
     private final static int[] width;
-    private final static Hashtable kerning=new Hashtable();
+    private final static HashMap kerning=new HashMap();
 
     static {
         width = new int[256];
 <xsl:for-each select="widths/char"><xsl:variable name="char-name" select="@name"/><xsl:variable name="char-num" select="document('charlist.xml')/font-mappings/map[@adobe-name=$char-name]/@win-ansi"/><xsl:if test="$char-num!='-1'">        width[<xsl:value-of select="$char-num"/>] = <xsl:value-of select="@width"/>;
 </xsl:if></xsl:for-each>
 
-    Hashtable tmptable;
+    HashMap tmptable;
 <xsl:for-each select="kerning">
 <xsl:variable name="kpx1-name" select="@kpx1"/>
-    tmptable=new Hashtable();<xsl:for-each select="pair"><xsl:variable name="kpx2-name" select="@kpx2"/><xsl:variable name="kern-name" select="@kern"/>
+    tmptable=new HashMap();<xsl:for-each select="pair"><xsl:variable name="kpx2-name" select="@kpx2"/><xsl:variable name="kern-name" select="@kern"/>
     tmptable.put(Glyphs.glyphToString("<xsl:value-of select="$kpx2-name"/>"), new Integer(<xsl:value-of select="$kern-name"/>));</xsl:for-each>
     kerning.put(Glyphs.glyphToString("<xsl:value-of select="$kpx1-name"/>"), tmptable);
 </xsl:for-each>
     }
 
     public final boolean hasKerningInfo() {return kerning.isEmpty();}
-    public final java.util.Hashtable getKerningInfo() {return kerning;}
+    public final java.util.HashMap getKerningInfo() {return kerning;}
     public byte getSubType() {return org.apache.fop.pdf.PDFFont.TYPE1;}
 
     public boolean isEmbeddable() {
index 06930b8c97012ea438154c14171c11b033ff5236..5842d43dcd30d2d8e46783b55297abe9523e5f15 100644 (file)
@@ -27,7 +27,7 @@ import org.apache.fop.pdf.PDFTTFStream;
 import java.io.InputStream;
 import java.io.FileInputStream;
 import java.io.BufferedInputStream;
-import java.util.Hashtable;
+import java.util.HashMap;
 
 public class <xsl:value-of select="class-name"/> extends Font implements FontDescriptor {
     private final static String fontName = "<xsl:value-of select="font-name"/>";
@@ -52,24 +52,24 @@ public class <xsl:value-of select="class-name"/> extends Font implements FontDes
     private final static int firstChar = <xsl:value-of select="first-char"/>;
     private final static int lastChar = <xsl:value-of select="last-char"/>;
     private final static int[] width;
-    private final static Hashtable kerning=new Hashtable();
+    private final static HashMap kerning=new HashMap();
     static {
         width = new int[256];
 <!--<xsl:for-each select="widths/char"><xsl:variable name="char-name" select="@name"/><xsl:variable name="char-num" select="document('charlist.xml')/font-mappings/map[@adobe-name=$char-name]/@win-ansi"/><xsl:if test="$char-num!='-1'">        width[<xsl:value-of select="$char-num"/>] = <xsl:value-of select="@width"/>;</xsl:if>-->
 <xsl:for-each select="widths/char"><xsl:variable name="char-name" select="@name"/>   width[<xsl:value-of select="$char-name"/>] = <xsl:value-of select="@width"/>;
 </xsl:for-each>
 
-    Hashtable tmptable;
+    HashMap tmptable;
 <xsl:for-each select="kerning">
 <xsl:variable name="kpx1-name" select="@kpx1"/>
-    tmptable=new Hashtable();<xsl:for-each select="pair"><xsl:variable name="kpx2-name" select="@kpx2"/><xsl:variable name="kern-name" select="@kern"/>
+    tmptable=new HashMap();<xsl:for-each select="pair"><xsl:variable name="kpx2-name" select="@kpx2"/><xsl:variable name="kern-name" select="@kern"/>
     tmptable.put(Glyphs.glyphToString("<xsl:value-of select="$kpx2-name"/>"), new Integer(<xsl:value-of select="$kern-name"/>));</xsl:for-each>
     kerning.put(Glyphs.glyphToString("<xsl:value-of select="$kpx1-name"/>"), tmptable);
 </xsl:for-each>
     }
 
     public final boolean hasKerningInfo() {return kerning.isEmpty();}
-    public final java.util.Hashtable getKerningInfo() {return kerning;}
+    public final java.util.HashMap getKerningInfo() {return kerning;}
 
     public byte getSubType() {return org.apache.fop.pdf.PDFFont.TRUETYPE;}
     public boolean isEmbeddable() {