]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Adds textdeko.fo file example. Applies Art Welch's JDK 1.1.x compatibility
authorSteve Coffman <gears@apache.org>
Thu, 26 Oct 2000 14:33:37 +0000 (14:33 +0000)
committerSteve Coffman <gears@apache.org>
Thu, 26 Oct 2000 14:33:37 +0000 (14:33 +0000)
fixes.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193739 13f79535-47bb-0310-9956-ffa450edef68

build.xml
docs/examples/fo/textdeko.fo [new file with mode: 0644]
lib/CompileXMLFiles.java
src/org/apache/fop/dom/css/CSSStyleRuleImpl.java
src/org/apache/fop/dom/css/CSSStyleSheetImpl.java
src/org/apache/fop/image/analyser/ImageReaderFactory.java
src/org/apache/fop/messaging/MessageHandler.java
src/org/apache/fop/svg/Symbol.java

index 0247fd7b27e90830ddb1b67d4dd1ce995fb085db..8d52fa12cbcfa8b7c57611db2f709c5318d0b1cf 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -157,9 +157,9 @@ Sometimes ant gives out this warnings, but the build is finished without any pro
 
     <property name="ignore_jdk11"
               value="org/apache/fop/render/awt/**
-                     ,org/apache/fop/image/analyzer/*
                      ,org/apache/fop/viewer/**
-                     ,org/apache/fop/image/*
+                     ,**/GifJpegImage.java
+                     ,**/JimiImage.java
                      ,**/PrintCommandLine.java
                      ,**/AWTCommandLine.java"/>
 
diff --git a/docs/examples/fo/textdeko.fo b/docs/examples/fo/textdeko.fo
new file mode 100644 (file)
index 0000000..24f5513
--- /dev/null
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- simple example for text-decoration -->
+
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+
+  <fo:layout-master-set>
+
+    <!-- layout for the first page -->
+    <fo:simple-page-master master-name="first"
+                  page-height="29.7cm" 
+                  page-width="21cm"
+                  margin-top="1cm" 
+                  margin-bottom="2cm" 
+                  margin-left="2.5cm" 
+                  margin-right="2.5cm">
+      <fo:region-body margin-top="3cm"/>
+      <fo:region-before extent="3cm"/>
+      <fo:region-after extent="1.5cm"/>
+    </fo:simple-page-master>
+
+    <!-- layout for the other pages -->
+    <fo:simple-page-master master-name="rest"
+                  page-height="29.7cm" 
+                  page-width="21cm"
+                  margin-top="1cm" 
+                  margin-bottom="2cm" 
+                  margin-left="2.5cm" 
+                  margin-right="2.5cm">
+      <fo:region-body margin-top="2.5cm"/>
+      <fo:region-before extent="2.5cm"/>
+      <fo:region-after extent="1.5cm"/>
+    </fo:simple-page-master>
+
+<fo:page-sequence-master master-name="basicPSM" >
+       <fo:repeatable-page-master-alternatives>
+               <fo:conditional-page-master-reference master-name="first"
+                       page-position="first" />
+               <fo:conditional-page-master-reference master-name="rest"
+                       page-position="rest" />
+               <!-- recommended fallback procedure -->
+               <fo:conditional-page-master-reference master-name="rest" />
+       </fo:repeatable-page-master-alternatives>
+</fo:page-sequence-master>
+
+  </fo:layout-master-set>
+  <!-- end: defines page layout -->
+
+  <!-- actual layout -->
+  <fo:page-sequence master-name="basicPSM">
+
+    <fo:flow flow-name="xsl-region-body">
+
+      <fo:block font-size="18pt" font-family="sans-serif" line-height="24pt" space-after.optimum="15pt"
+            background-color="blue" color="white" text-align="center" padding-top="3pt">
+      Simple example for text-decoration
+      </fo:block>
+
+      <fo:block font-size="12pt" font-family="sans-serif" line-height="15pt" text-align="justify" space-after.optimum="10pt">
+      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.
+      </fo:block>
+
+      <fo:block font-size="12pt" font-family="sans-serif" line-height="15pt" space-after.optimum="3pt">
+      Example: <fo:inline text-decoration="underline">underline</fo:inline>
+      </fo:block>
+
+      <fo:block font-size="12pt" font-family="sans-serif" line-height="15pt" space-after.optimum="10pt">
+      <fo:inline font-family="monospace"><![CDATA[<fo:inline text-decoration="underline">underline</fo:inline>]]></fo:inline>
+      </fo:block>
+
+      <fo:block font-size="12pt" 
+                font-family="serif" 
+                line-height="15pt"
+                space-after.optimum="10pt"
+                text-align="start">
+        This is simple test of the text-decoration<fo:inline text-decoration="underline">underline</fo:inline>.
+      </fo:block>
+      <fo:block font-size="22pt" 
+                font-family="sans-serif" 
+                line-height="15pt"
+                space-after.optimum="10pt"
+                text-align="start">
+        This is simple test with a <fo:inline text-decoration="underline">bigger</fo:inline> font-size.
+      </fo:block>
+      <fo:block font-size="12pt" 
+                font-family="monospace" 
+                line-height="15pt"
+                space-after.optimum="20pt"
+                text-align="start">
+        This is simple test with a <fo:inline text-decoration="underline">monospaced</fo:inline> font.
+
+      </fo:block>
+
+      <fo:block font-size="12pt" font-family="sans-serif" line-height="15pt" text-align="justify" space-after.optimum="3pt">
+      The following text decorations are defined in the WD:
+      </fo:block>
+
+      <fo:list-block>
+
+        <fo:list-item>
+          <fo:list-item-label>
+            <fo:block>&#x2022;</fo:block>
+          </fo:list-item-label>
+          <fo:list-item-body>
+            <fo:block>
+              <fo:inline text-decoration="none">none</fo:inline>
+            </fo:block>
+          </fo:list-item-body>
+        </fo:list-item>
+
+        <fo:list-item>
+          <fo:list-item-label>
+            <fo:block>&#x2022;</fo:block>
+          </fo:list-item-label>
+          <fo:list-item-body>
+            <fo:block>
+              <fo:inline text-decoration="underline">underline</fo:inline>
+            </fo:block>
+          </fo:list-item-body>
+        </fo:list-item>
+
+        <fo:list-item>
+          <fo:list-item-label>
+            <fo:block>&#x2022;</fo:block>
+          </fo:list-item-label>
+          <fo:list-item-body>
+            <fo:block>
+              <fo:inline text-decoration="overline">overline</fo:inline>
+            </fo:block>
+          </fo:list-item-body>
+        </fo:list-item>
+
+        <fo:list-item>
+          <fo:list-item-label>
+            <fo:block>&#x2022;</fo:block>
+          </fo:list-item-label>
+          <fo:list-item-body>
+            <fo:block>
+              <fo:inline text-decoration="line-through">line-through</fo:inline>
+            </fo:block>
+          </fo:list-item-body>
+        </fo:list-item>
+
+        <fo:list-item>
+          <fo:list-item-label>
+            <fo:block>&#x2022;</fo:block>
+          </fo:list-item-label>
+          <fo:list-item-body>
+            <fo:block>
+              <fo:inline text-decoration="blink">blink</fo:inline>
+            </fo:block>
+          </fo:list-item-body>
+        </fo:list-item>
+
+      </fo:list-block>
+
+    </fo:flow>
+  </fo:page-sequence>
+</fo:root>
index 714b228f4479fe433bb594fe2948dd8a385c9a03..531e7d36b5a12c69b5cbd29f7c8d12d9661302f9 100644 (file)
@@ -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
                 "<!DOCTYPE documentation [\n" +
                 "<!ENTITY nbsp \" \">\n" +
                 "]>\n<documentation>");
-      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)
index c035f6084429aec8e1d794223a5ea0e6d52eaf3b..5d6e37a3592965f1604fd9b769458d3b5cf30e2f 100644 (file)
@@ -188,7 +188,7 @@ public class CSSStyleRuleImpl implements CSSStyleRule {
                 }
             }
             if(current != null)
-                selectors.add(current);
+                selectors.addElement(current);
         }
     }
 
index 87c347e5edf0a26b920e958827b3e7d7e1caefc2..97ee8ef3f75f486827e2553e380e35bd43e8b656 100644 (file)
@@ -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()
index f4f36a6df5e337ad8ca443c9410c641cea2990e7..d811eacb6120ffa47b377f0523ebf0b7bd8ccdd6 100644 (file)
@@ -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;
         }
index 5fe7f758b9a3a716545c63b5483db010233a5a16..981cf5b0eb59f2cfc32739559e7c2f35126a485c 100644 (file)
@@ -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
index 5463055ff3b3f43a321b85682596a5d4065144ed..f119e220e130acebbcb6d084420fd35cb563d706 100644 (file)
@@ -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) {
                }