keiron 2002/09/17 02:29:00
Modified: src/codegen code-point-mapping.xsl foproperties.xml
properties.xsl t1font-file.xsl ttffontfile.xsl
Log:
updated to java2 collections
Revision Changes Path
1.8 +5 -3 xml-fop/src/codegen/code-point-mapping.xsl
Index: code-point-mapping.xsl
===================================================================
RCS file: /home/cvs/xml-fop/src/codegen/code-point-mapping.xsl,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- code-point-mapping.xsl 28 Jun 2002 07:52:53 -0000 1.7
+++ code-point-mapping.xsl 17 Sep 2002 09:28:59 -0000 1.8
@@ -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 @@
}
}
- 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);
1.34 +11 -2 xml-fop/src/codegen/foproperties.xml
Index: foproperties.xml
===================================================================
RCS file: /home/cvs/xml-fop/src/codegen/foproperties.xml,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- foproperties.xml 23 Jul 2002 11:07:59 -0000 1.33
+++ foproperties.xml 17 Sep 2002 09:28:59 -0000 1.34
@@ -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>
1.17 +3 -3 xml-fop/src/codegen/properties.xsl
Index: properties.xsl
===================================================================
RCS file: /home/cvs/xml-fop/src/codegen/properties.xsl,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- properties.xsl 25 Jul 2002 09:32:26 -0000 1.16
+++ properties.xsl 17 Sep 2002 09:28:59 -0000 1.17
@@ -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;
1.4 +5 -5 xml-fop/src/codegen/t1font-file.xsl
Index: t1font-file.xsl
===================================================================
RCS file: /home/cvs/xml-fop/src/codegen/t1font-file.xsl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- t1font-file.xsl 5 Feb 2001 08:35:25 -0000 1.3
+++ t1font-file.xsl 17 Sep 2002 09:28:59 -0000 1.4
@@ -27,7 +27,7 @@
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 @@
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() {
1.2 +5 -5 xml-fop/src/codegen/ttffontfile.xsl
Index: ttffontfile.xsl
===================================================================
RCS file: /home/cvs/xml-fop/src/codegen/ttffontfile.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ttffontfile.xsl 5 Feb 2001 08:35:25 -0000 1.1
+++ ttffontfile.xsl 17 Sep 2002 09:28:59 -0000 1.2
@@ -27,7 +27,7 @@
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 @@
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() {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]