aboutsummaryrefslogtreecommitdiffstats
path: root/src/codegen
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2002-09-17 09:28:59 +0000
committerKeiron Liddle <keiron@apache.org>2002-09-17 09:28:59 +0000
commit92052e54ca7ead14a80359efccf13e42b560d482 (patch)
treec10af58e0b7a3833dddadd4941f73ab11802cb2b /src/codegen
parent6a902da415ee9b89faa2007725e1afe7022c38e4 (diff)
downloadxmlgraphics-fop-92052e54ca7ead14a80359efccf13e42b560d482.tar.gz
xmlgraphics-fop-92052e54ca7ead14a80359efccf13e42b560d482.zip
updated to java2 collections
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195206 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/code-point-mapping.xsl8
-rw-r--r--src/codegen/foproperties.xml13
-rw-r--r--src/codegen/properties.xsl6
-rw-r--r--src/codegen/t1font-file.xsl10
-rw-r--r--src/codegen/ttffontfile.xsl10
5 files changed, 29 insertions, 18 deletions
diff --git a/src/codegen/code-point-mapping.xsl b/src/codegen/code-point-mapping.xsl
index ab4f26da9..32fc7cf9d 100644
--- a/src/codegen/code-point-mapping.xsl
+++ b/src/codegen/code-point-mapping.xsl
@@ -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);
diff --git a/src/codegen/foproperties.xml b/src/codegen/foproperties.xml
index a9253de3d..f245124bd 100644
--- a/src/codegen/foproperties.xml
+++ b/src/codegen/foproperties.xml
@@ -233,7 +233,6 @@
<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>
@@ -1848,7 +1847,17 @@
<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>
diff --git a/src/codegen/properties.xsl b/src/codegen/properties.xsl
index 62d2440c9..fb7e65be0 100644
--- a/src/codegen/properties.xsl
+++ b/src/codegen/properties.xsl
@@ -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>
@@ -207,7 +207,7 @@
<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;
diff --git a/src/codegen/t1font-file.xsl b/src/codegen/t1font-file.xsl
index 27896d898..7f306fb07 100644
--- a/src/codegen/t1font-file.xsl
+++ b/src/codegen/t1font-file.xsl
@@ -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() {
diff --git a/src/codegen/ttffontfile.xsl b/src/codegen/ttffontfile.xsl
index 06930b8c9..5842d43dc 100644
--- a/src/codegen/ttffontfile.xsl
+++ b/src/codegen/ttffontfile.xsl
@@ -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() {