From bacbe7a0915fbb7b4c22b623f97a11352cf5d0b1 Mon Sep 17 00:00:00 2001 From: Steve Coffman Date: Thu, 26 Oct 2000 14:33:37 +0000 Subject: [PATCH] Adds textdeko.fo file example. Applies Art Welch's JDK 1.1.x compatibility fixes. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193739 13f79535-47bb-0310-9956-ffa450edef68 --- build.xml | 4 +- docs/examples/fo/textdeko.fo | 163 ++++++++++++++++++ lib/CompileXMLFiles.java | 10 +- .../apache/fop/dom/css/CSSStyleRuleImpl.java | 2 +- .../apache/fop/dom/css/CSSStyleSheetImpl.java | 2 +- .../image/analyser/ImageReaderFactory.java | 24 +-- .../apache/fop/messaging/MessageHandler.java | 2 +- src/org/apache/fop/svg/Symbol.java | 8 +- 8 files changed, 189 insertions(+), 26 deletions(-) create mode 100644 docs/examples/fo/textdeko.fo diff --git a/build.xml b/build.xml index 0247fd7b2..8d52fa12c 100644 --- a/build.xml +++ b/build.xml @@ -157,9 +157,9 @@ Sometimes ant gives out this warnings, but the build is finished without any pro diff --git a/docs/examples/fo/textdeko.fo b/docs/examples/fo/textdeko.fo new file mode 100644 index 000000000..24f55132f --- /dev/null +++ b/docs/examples/fo/textdeko.fo @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simple example for text-decoration + + + + The "text-decoration"-property describes decorations that are added to the text of an element. + If the property is specified for a block-level element, it should affect all inline-level descendants + of the element (does not work yet!). + If it is specified for (or affects) an inline-level + element, it affects all boxes generated by the element. + + + + Example: underline + + + + underline]]> + + + + This is simple test of the text-decorationunderline. + + + This is simple test with a bigger font-size. + + + This is simple test with a monospaced font. + + + + + The following text decorations are defined in the WD: + + + + + + + + + + + none + + + + + + + + + + + underline + + + + + + + + + + + overline + + + + + + + + + + + line-through + + + + + + + + + + + blink + + + + + + + + + diff --git a/lib/CompileXMLFiles.java b/lib/CompileXMLFiles.java index 714b228f4..531e7d36b 100644 --- a/lib/CompileXMLFiles.java +++ b/lib/CompileXMLFiles.java @@ -87,7 +87,7 @@ public class CompileXMLFiles extends Task private String configFile, outFile; private String [] filenameList; private String filenames; - private ArrayList files = new ArrayList(); + private Vector files = new Vector(); //sets name of configuration file, which must //be an xml file conforming to the book.dtd used by xml-site @@ -163,7 +163,7 @@ public class CompileXMLFiles extends Task { String line, filename; BufferedReader in; - Iterator iterator = files.iterator(); + Enumeration iterator = files.elements(); try { BufferedWriter out = new BufferedWriter (new FileWriter("compileXMLFiles-tmp.xml")); @@ -171,8 +171,8 @@ public class CompileXMLFiles extends Task "\n" + "]>\n"); - while (iterator.hasNext()) { - filename = (String) iterator.next(); + while (iterator.hasMoreElements()) { + filename = (String) iterator.nextElement(); in = new BufferedReader(new FileReader(filename)); while ((line = in.readLine()) != null) { //kill the lines pointing to the sbk protocol and the xml declaration @@ -196,7 +196,7 @@ public class CompileXMLFiles extends Task String id, label, source; if (name.equals("document") || name.equals("entry")) { source = atts.getValue("source"); - files.add(source); + files.addElement(source); } } public void endElement (String name) diff --git a/src/org/apache/fop/dom/css/CSSStyleRuleImpl.java b/src/org/apache/fop/dom/css/CSSStyleRuleImpl.java index c035f6084..5d6e37a35 100644 --- a/src/org/apache/fop/dom/css/CSSStyleRuleImpl.java +++ b/src/org/apache/fop/dom/css/CSSStyleRuleImpl.java @@ -188,7 +188,7 @@ public class CSSStyleRuleImpl implements CSSStyleRule { } } if(current != null) - selectors.add(current); + selectors.addElement(current); } } diff --git a/src/org/apache/fop/dom/css/CSSStyleSheetImpl.java b/src/org/apache/fop/dom/css/CSSStyleSheetImpl.java index 87c347e5e..97ee8ef3f 100644 --- a/src/org/apache/fop/dom/css/CSSStyleSheetImpl.java +++ b/src/org/apache/fop/dom/css/CSSStyleSheetImpl.java @@ -115,7 +115,7 @@ public class CSSStyleSheetImpl implements CSSStyleSheet { public void deleteRule(int index) throws DOMException { - rules.remove(index); + rules.removeElementAt(index); } public String getType() diff --git a/src/org/apache/fop/image/analyser/ImageReaderFactory.java b/src/org/apache/fop/image/analyser/ImageReaderFactory.java index f4f36a6df..d811eacb6 100644 --- a/src/org/apache/fop/image/analyser/ImageReaderFactory.java +++ b/src/org/apache/fop/image/analyser/ImageReaderFactory.java @@ -44,8 +44,8 @@ package org.apache.fop.image.analyser; import java.io.InputStream; import java.io.BufferedInputStream; import java.io.IOException; -import java.util.Iterator; -import java.util.ArrayList; +import java.util.Enumeration; +import java.util.Vector; // FOP import org.apache.fop.image.FopImageException; @@ -56,7 +56,7 @@ import org.apache.fop.image.FopImageException; * @version 1.0 */ public class ImageReaderFactory { - static protected ArrayList formats = null; + static protected Vector formats = null; /** * ImageReader maker. @@ -69,20 +69,20 @@ public class ImageReaderFactory { throws FopImageException { // need to use a config file and remove static methods - formats = new ArrayList(); - formats.add(new JPEGReader()); - formats.add(new BMPReader()); - formats.add(new GIFReader()); - formats.add(new PNGReader()); - formats.add(new SVGReader()); + formats = new Vector(); + formats.addElement(new JPEGReader()); + formats.addElement(new BMPReader()); + formats.addElement(new GIFReader()); + formats.addElement(new PNGReader()); + formats.addElement(new SVGReader()); // ImageReader reader; BufferedInputStream bis = new BufferedInputStream(in); - Iterator itr = formats.iterator(); + Enumeration itr = formats.elements(); try { - while (itr.hasNext()) { - reader = (ImageReader) itr.next(); + while (itr.hasMoreElements()) { + reader = (ImageReader) itr.nextElement(); if (reader.verifySignature(bis)) { return reader; } diff --git a/src/org/apache/fop/messaging/MessageHandler.java b/src/org/apache/fop/messaging/MessageHandler.java index 5fe7f758b..981cf5b0e 100644 --- a/src/org/apache/fop/messaging/MessageHandler.java +++ b/src/org/apache/fop/messaging/MessageHandler.java @@ -52,7 +52,7 @@ package org.apache.fop.messaging; import java.io.*; import java.util.*; -import javax.swing.*; +//import javax.swing.*; /** The class MessageHandler contains the static methods log and error which * should be used for any end user information instead of System.out.print() or diff --git a/src/org/apache/fop/svg/Symbol.java b/src/org/apache/fop/svg/Symbol.java index 5463055ff..f119e220e 100644 --- a/src/org/apache/fop/svg/Symbol.java +++ b/src/org/apache/fop/svg/Symbol.java @@ -118,16 +118,16 @@ public class Symbol extends SVGObj { float height = 0; try { if(st.hasMoreTokens()) { - x = Float.parseFloat(st.nextToken()); + x = Double.valueOf(st.nextToken()).floatValue(); } if(st.hasMoreTokens()) { - y = Float.parseFloat(st.nextToken()); + y = Double.valueOf(st.nextToken()).floatValue(); } if(st.hasMoreTokens()) { - width = Float.parseFloat(st.nextToken()); + width = Double.valueOf(st.nextToken()).floatValue(); } if(st.hasMoreTokens()) { - height = Float.parseFloat(st.nextToken()); + height = Double.valueOf(st.nextToken()).floatValue(); } } catch(Exception e) { } -- 2.39.5