]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
renamed org.apache.fop.area.inline.Word to .TextArea (.Text not used to avoid
authorGlen Mazza <gmazza@apache.org>
Tue, 28 Oct 2003 04:22:14 +0000 (04:22 +0000)
committerGlen Mazza <gmazza@apache.org>
Tue, 28 Oct 2003 04:22:14 +0000 (04:22 +0000)
conflicts with org.w3c.dom.Text)
changed Renderer.renderWord() method to renderText().

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

14 files changed:
src/java/org/apache/fop/area/inline/InlineAreaVisitor.java
src/java/org/apache/fop/area/inline/TextArea.java [new file with mode: 0644]
src/java/org/apache/fop/area/inline/UnresolvedPageNumber.java
src/java/org/apache/fop/area/inline/Word.java [deleted file]
src/java/org/apache/fop/layoutmgr/AddLMVisitor.java
src/java/org/apache/fop/layoutmgr/TextLayoutManager.java
src/java/org/apache/fop/render/AbstractRenderer.java
src/java/org/apache/fop/render/Renderer.java
src/java/org/apache/fop/render/awt/AWTRenderer.java
src/java/org/apache/fop/render/pdf/PDFRenderer.java
src/java/org/apache/fop/render/ps/PSRenderer.java
src/java/org/apache/fop/render/svg/SVGRenderer.java
src/java/org/apache/fop/render/xml/XMLRenderer.java
src/java/org/apache/fop/tools/AreaTreeBuilder.java

index 35e7a4a42ad1fc203b29e0a886457baa5ab459e6..0a5911b390c52890a0a00b4ef7e69c3b6cbae6ea 100644 (file)
@@ -66,11 +66,11 @@ public interface InlineAreaVisitor {
     void serveVisitor(Viewport viewport);
 
     /**
-     * Handle a visitor request to process an inline word.
+     * Handle a visitor request to process inline text.
      *
-     * @param area  The word area
+     * @param area  The text area
      */
-    void serveVisitor(Word area);
+    void serveVisitor(TextArea area);
 
     /**
      * Handle a visitor request to process an inline parent area.
diff --git a/src/java/org/apache/fop/area/inline/TextArea.java b/src/java/org/apache/fop/area/inline/TextArea.java
new file mode 100644 (file)
index 0000000..00e9019
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * $Id$
+ * ============================================================================
+ *                    The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ *    include the following acknowledgment: "This product includes software
+ *    developed by the Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself, if
+ *    and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ *    endorse or promote products derived from this software without prior
+ *    written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ *    "Apache" appear in their name, without prior written permission of the
+ *    Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.area.inline;
+
+/**
+ * A text inline area.
+ */
+public class TextArea extends InlineArea {
+
+    /**
+     * The text for this inline area
+     */
+    protected String text;
+    private int iTSadjust = 0;
+
+    /**
+     * Create a text inline area
+     */
+    public TextArea() {
+    }
+
+    /**
+     * Handle InlineAreaVisitor request by passing this back to it.
+     *
+     * @param visitor the InlineAreaVisitor wishing to process this.
+     * @see org.apache.fop.area.inline.InlineAreaVisitor
+     */
+    public void acceptVisitor(InlineAreaVisitor visitor) {
+        visitor.serveVisitor(this);
+    }
+
+    /**
+     * Set the text string
+     *
+     * @param t the text string
+     */
+    public void setTextArea(String t) {
+        text = t;
+    }
+
+    /**
+     * Get the text string.
+     *
+     * @return the text string
+     */
+    public String getTextArea() {
+        return text;
+    }
+
+    /**
+     * Get text space adjust.
+     *
+     * @return the text space adjustment
+     */
+    public int getTSadjust() {
+        return iTSadjust;
+    }
+
+    /**
+     * Set text space adjust.
+     *
+     * @param iTSadjust the text space adjustment
+     */
+    public void setTSadjust(int iTSadjust) {
+        this.iTSadjust = iTSadjust;
+    }
+}
+
index 0a46d87b178118963db68aaec9b114a1627eb588..657490c5809a00cbc778d122e5767f6c4872d62b 100644 (file)
@@ -60,7 +60,7 @@ import java.util.List;
  * This is a word area that resolves itself to a page number
  * from an id reference.
  */
-public class UnresolvedPageNumber extends Word implements Resolveable {
+public class UnresolvedPageNumber extends TextArea implements Resolveable {
     private boolean resolved = false;
     private String pageRefId;
 
@@ -71,7 +71,7 @@ public class UnresolvedPageNumber extends Word implements Resolveable {
      */
     public UnresolvedPageNumber(String id) {
         pageRefId = id;
-        word = "?";
+        text = "?";
     }
 
     /**
@@ -98,7 +98,7 @@ public class UnresolvedPageNumber extends Word implements Resolveable {
         if (pages != null) {
             PageViewport page = (PageViewport)pages.get(0);
             String str = page.getPageNumber();
-            word = str;
+            text = str;
 
             /**@todo Update IPD ??? */
         }
diff --git a/src/java/org/apache/fop/area/inline/Word.java b/src/java/org/apache/fop/area/inline/Word.java
deleted file mode 100644 (file)
index 462cf0b..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * $Id: Word.java,v 1.10 2003/03/05 16:45:42 jeremias Exp $
- * ============================================================================
- *                    The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- *    include the following acknowledgment: "This product includes software
- *    developed by the Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself, if
- *    and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- *    endorse or promote products derived from this software without prior
- *    written permission. For written permission, please contact
- *    apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- *    "Apache" appear in their name, without prior written permission of the
- *    Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.area.inline;
-
-/**
- * A word inline area.
- * This is really a collection character inline areas collected together
- * into a single word.
- */
-public class Word extends InlineArea {
-    /**
-     * The word for this word area.
-     */
-    protected String word;
-    private int iWSadjust = 0;
-
-    /**
-     * Create a word area.
-     */
-    public Word() {
-    }
-
-    /**
-     * Handle InlineAreaVisitor request by passing this back to it.
-     *
-     * @param visitor the InlineAreaVisitor wishing to process this.
-     * @see org.apache.fop.area.inline.InlineAreaVisitor
-     */
-    public void acceptVisitor(InlineAreaVisitor visitor) {
-        visitor.serveVisitor(this);
-    }
-
-    /**
-     * Set the word.
-     *
-     * @param w the word string
-     */
-    public void setWord(String w) {
-        word = w;
-    }
-
-    /**
-     * Get the word string.
-     *
-     * @return the word string
-     */
-    public String getWord() {
-        return word;
-    }
-
-    /**
-     * Get word space adjust.
-     *
-     * @return the word space adjustment
-     */
-    public int getWSadjust() {
-        return iWSadjust;
-    }
-
-    /**
-     * Set word space adjust.
-     *
-     * @param iWSadjust the word space adjustment
-     */
-    public void setWSadjust(int iWSadjust) {
-        this.iWSadjust = iWSadjust;
-    }
-}
-
index c0908b4a451415a9e27f8636a5bb0ecf77d134d7..6525891729408203269afd4c303cfecca86695e2 100644 (file)
@@ -71,7 +71,7 @@ import org.apache.fop.area.inline.InlineParent;
 import org.apache.fop.area.inline.Space;
 import org.apache.fop.area.inline.UnresolvedPageNumber;
 import org.apache.fop.area.inline.Viewport;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FOText;
@@ -378,15 +378,15 @@ public class AddLMVisitor implements FOTreeVisitor {
          } else if (node.getLeaderPattern() == LeaderPattern.SPACE) {
              leaderArea = new Space();
          } else if (node.getLeaderPattern() == LeaderPattern.DOTS) {
-             Word w = new Word();
+             TextArea t = new TextArea();
              char dot = '.'; // userAgent.getLeaderDotCharacter();
 
-             w.setWord("" + dot);
-             w.addTrait(Trait.FONT_NAME, node.getFontState().getFontName());
-             w.addTrait(Trait.FONT_SIZE,
+             t.setTextArea("" + dot);
+             t.addTrait(Trait.FONT_NAME, node.getFontState().getFontName());
+             t.addTrait(Trait.FONT_SIZE,
                               new Integer(node.getFontState().getFontSize()));
              // set offset of dot within inline parent
-             w.setOffset(node.getFontState().getAscender());
+             t.setOffset(node.getFontState().getAscender());
              int width = node.getFontState().getCharWidth(dot);
              Space spacer = null;
              if (node.getPatternWidth() > width) {
@@ -396,7 +396,7 @@ public class AddLMVisitor implements FOTreeVisitor {
              }
              FilledArea fa = new FilledArea();
              fa.setUnitWidth(width);
-             fa.addChild(w);
+             fa.addChild(t);
              if (spacer != null) {
                  fa.addChild(spacer);
              }
@@ -738,14 +738,14 @@ public class AddLMVisitor implements FOTreeVisitor {
          lm = new LeafNodeLayoutManager() {
                      public InlineArea get(LayoutContext context) {
                          // get page string from parent, build area
-                         Word inline = new Word();
+                         TextArea inline = new TextArea();
                          String str = parentLM.getCurrentPageNumber();
                          int width = 0;
                      for (int count = 0; count < str.length(); count++) {
                              width += node.getFontState().getCharWidth(
                                         str.charAt(count));
                          }
-                         inline.setWord(str);
+                         inline.setTextArea(str);
                          inline.setIPD(width);
                          inline.setHeight(node.getFontState().getAscender()
                                           - node.getFontState().getDescender());
@@ -808,10 +808,10 @@ public class AddLMVisitor implements FOTreeVisitor {
          if (page != null) {
              String str = page.getPageNumber();
              // get page string from parent, build area
-             Word word = new Word();
-             inline = word;
+             TextArea text = new TextArea();
+             inline = text;
              int width = node.getStringWidth(str);
-             word.setWord(str);
+             text.setTextArea(str);
              inline.setIPD(width);
              inline.setHeight(node.getFontState().getAscender()
                               - node.getFontState().getDescender());
index 46a72f224a3d56be0c6dfc6f225127a0351ed927..d10be582fe0caafb5d9a04e1996ef57825ca5b3b 100644 (file)
@@ -56,7 +56,7 @@ import org.apache.fop.fo.TextInfo;
 import org.apache.fop.traits.SpaceVal;
 import org.apache.fop.area.Trait;
 import org.apache.fop.area.inline.InlineArea;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
 import org.apache.fop.area.inline.Space;
 import org.apache.fop.util.CharUtilities;
 import org.apache.fop.traits.MinOptMax;
@@ -68,7 +68,7 @@ import org.apache.fop.traits.MinOptMax;
 public class TextLayoutManager extends AbstractLayoutManager {
 
     /**
-     * Store information about each potential word area.
+     * Store information about each potential text area.
      * Index of character which ends the area, IPD of area, including
      * any word-space and letter-space.
      * Number of word-spaces?
@@ -523,15 +523,15 @@ public class TextLayoutManager extends AbstractLayoutManager {
             word = new Space();
             word.setWidth(ai.ipdArea.opt + iAdjust);
         } else  {
-            Word w = createWord(
+            TextArea t = createText(
                       str,
                       ai.ipdArea.opt + iAdjust, context.getBaseline());
             if (iWScount > 0) {
                 //getLogger().error("Adjustment per word-space= " +
                 //                   iAdjust / iWScount);
-                w.setWSadjust(iAdjust / iWScount);
+                t.setTSadjust(iAdjust / iWScount);
             }
-            word = w;
+            word = t;
         }
         if ((chars[iStart] == SPACE || chars[iStart] == NBSPACE)
                 && context.getLeadingSpace().hasSpaces()) {
@@ -567,15 +567,15 @@ public class TextLayoutManager extends AbstractLayoutManager {
      * @param base the baseline position
      * @return the new word area
      */
-    protected Word createWord(String str, int width, int base) {
-        Word curWordArea = new Word();
+    protected TextArea createText(String str, int width, int base) {
+        TextArea curWordArea = new TextArea();
         curWordArea.setWidth(width);
         curWordArea.setHeight(textInfo.fs.getAscender()
                               - textInfo.fs.getDescender());
         curWordArea.setOffset(textInfo.fs.getAscender());
         curWordArea.setOffset(base);
 
-        curWordArea.setWord(str);
+        curWordArea.setTextArea(str);
         curWordArea.addTrait(Trait.FONT_NAME, textInfo.fs.getFontName());
         curWordArea.addTrait(Trait.FONT_SIZE,
                              new Integer(textInfo.fs.getFontSize()));
index 05f72e9b86520346954362d0644db3902b490466..d15895319f2938d6fd09099455be32cad11e7e7f 100644 (file)
@@ -90,7 +90,7 @@ import org.apache.fop.area.inline.InlineParent;
 import org.apache.fop.area.inline.Leader;
 import org.apache.fop.area.inline.Space;
 import org.apache.fop.area.inline.Viewport;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
 import org.apache.fop.area.inline.Character;
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.fo.FOTreeControl;
@@ -260,8 +260,8 @@ public abstract class AbstractRenderer extends AbstractLogEnabled
             InlineArea inline = (InlineArea) children.get(count);
             if (inline instanceof Character) {
                 sb.append(((Character) inline).getChar());
-            } else if (inline instanceof Word) {
-                sb.append(((Word) inline).getWord());
+            } else if (inline instanceof TextArea) {
+                sb.append(((TextArea) inline).getTextArea());
             } else if (inline instanceof InlineParent) {
                 sb.append(convertToString(
                         ((InlineParent) inline).getChildAreas()));
@@ -653,8 +653,8 @@ public abstract class AbstractRenderer extends AbstractLogEnabled
     }
 
     /** @see org.apache.fop.render.Renderer */
-    public void renderWord(Word word) {
-        currentBlockIPPosition += word.getWidth();
+    public void renderText(TextArea text) {
+        currentBlockIPPosition += text.getWidth();
     }
 
     /** @see org.apache.fop.render.Renderer */
@@ -773,15 +773,15 @@ public abstract class AbstractRenderer extends AbstractLogEnabled
     }
 
     /**
-     * Render the specified Word.
+     * Render the specified Text.
      * Required by InlineAreaVisitor interface, which is used to determine which
      * InlineArea subclass should be rendered.
      *
-     * @param area  The Word area to be rendered
+     * @param area  The Text area to be rendered
      * @see org.apache.fop.area.inline.InlineAreaVisitor
      */
-    public void serveVisitor(Word area) {
-        renderWord(area);
+    public void serveVisitor(TextArea area) {
+        renderText(area);
     }
 
     /**
index 62196726e4dfbe9cfe9aecdc1be6a67b01c1d944..d9d4394583abe1a94aeb3b5187ed0ac1aee7671e 100644 (file)
@@ -66,7 +66,7 @@ import org.apache.fop.area.inline.InlineParent;
 import org.apache.fop.area.inline.Leader;
 import org.apache.fop.area.inline.Space;
 import org.apache.fop.area.inline.Viewport;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
 import org.apache.fop.fo.FOTreeControl;
 import org.apache.fop.apps.FOUserAgent;
 
@@ -227,11 +227,11 @@ public interface Renderer {
     void renderContainer(Container cont);
 
     /**
-     * Tells the renderer to render an inline word.
+     * Tells the renderer to render an inline text area
      *
-     * @param area  The word area
+     * @param area  The text area
      */
-    void renderWord(Word area);
+    void renderText(TextArea area);
 
     /**
      * Tells the renderer to render an inline parent area.
index 01caff77ef62d2ec7dfd2041dccae50ed3de6dfa..0bcd28d38ac402402e8aa17d5d9bcbc9fe23c389 100644 (file)
@@ -85,7 +85,7 @@ import org.apache.fop.area.Page;
 import org.apache.fop.area.PageViewport;
 import org.apache.fop.area.RegionViewport;
 import org.apache.fop.area.Trait;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
 import org.apache.fop.datatypes.ColorType;
 import org.apache.fop.fo.FOTreeControl;
 import org.apache.fop.fo.properties.BackgroundRepeat;
@@ -460,16 +460,16 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable
     }
     
     /**
-     * @see org.apache.fop.render.Renderer#renderWord(Word)
+     * @see org.apache.fop.render.Renderer#renderText(Text)
      */
-    public void renderWord(Word word) {
-        System.out.println("In render word: " + word.getWord());
+    public void renderText(TextArea text) {
+        System.out.println("In render text: " + text.getTextArea());
 
         Graphics2D graphics = currentPageImage.createGraphics();
-        String fontName = (String) word.getTrait(Trait.FONT_NAME);
-        int size = ((Integer) word.getTrait(Trait.FONT_SIZE)).intValue();
+        String fontName = (String) text.getTrait(Trait.FONT_NAME);
+        int size = ((Integer) text.getTrait(Trait.FONT_SIZE)).intValue();
 //      Typeface f = (Typeface) fontInfo.getFonts().get(fontName);
-        ColorType ct = (ColorType) word.getTrait(Trait.COLOR);
+        ColorType ct = (ColorType) text.getTrait(Trait.COLOR);
 
         FontMetricsMapper mapper = (FontMetricsMapper) 
             fontInfo.getMetricsFor(fontName);
@@ -485,16 +485,16 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable
             10));
         
         int rx = currentBlockIPPosition;
-        int bl = currentBPPosition + word.getOffset();
+        int bl = currentBPPosition + text.getOffset();
 
         int newx = (int) (rx + 500) / 1000;
         int newy = (int) (pageHeight - (bl + 500) / 1000);
                 
-        String s = word.getWord();
+        String s = text.getTextArea();
 //      graphics.drawString(s, newx, newy);
         graphics.drawString(s, 220, 200);
 
         // TODO: render text decorations
-        currentBlockIPPosition += word.getWidth();
+        currentBlockIPPosition += text.getWidth();
     }
 }
index bc631660dc69276fbde51d91a7a0d156b043bb20..5fa8ecdcb5aae3a59999bd48d2f7dc5f5435ab77 100644 (file)
@@ -83,7 +83,7 @@ import org.apache.fop.area.Trait;
 import org.apache.fop.area.TreeExt;
 import org.apache.fop.area.extensions.BookmarkData;
 import org.apache.fop.area.inline.Character;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
 import org.apache.fop.area.inline.Viewport;
 import org.apache.fop.area.inline.ForeignObject;
 import org.apache.fop.area.inline.Image;
@@ -889,13 +889,13 @@ public class PDFRenderer extends PrintRenderer {
     }
 
     /**
-     * @see org.apache.fop.render.Renderer#renderWord(Word)
+     * @see org.apache.fop.render.Renderer#renderText(Text)
      */
-    public void renderWord(Word word) {
+    public void renderText(TextArea text) {
         StringBuffer pdf = new StringBuffer();
 
-        String name = (String) word.getTrait(Trait.FONT_NAME);
-        int size = ((Integer) word.getTrait(Trait.FONT_SIZE)).intValue();
+        String name = (String) text.getTrait(Trait.FONT_NAME);
+        int size = ((Integer) text.getTrait(Trait.FONT_SIZE)).intValue();
 
         // This assumes that *all* CIDFonts use a /ToUnicode mapping
         Typeface f = (Typeface) fontInfo.getFonts().get(name);
@@ -906,7 +906,7 @@ public class PDFRenderer extends PrintRenderer {
         String endText = useMultiByte ? "> " : ") ";
 
         updateFont(name, size, pdf);
-        ColorType ct = (ColorType)word.getTrait(Trait.COLOR);
+        ColorType ct = (ColorType) text.getTrait(Trait.COLOR);
         if (ct != null) {
             updateColor(ct, true, pdf);
         }
@@ -915,12 +915,12 @@ public class PDFRenderer extends PrintRenderer {
         // currentBlockIPPosition: 0 for beginning of line; nonzero 
         //  where previous line area failed to take up entire allocated space
         int rx = currentBlockIPPosition + IPMarginOffset;
-        int bl = currentBPPosition + BPMarginOffset + word.getOffset();
+        int bl = currentBPPosition + BPMarginOffset + text.getOffset();
 
 /*      System.out.println("BlockIP Position: " + currentBlockIPPosition +
             "; currentBPPosition: " + currentBPPosition +
-            "; offset: " + word.getOffset() +
-            "; Word = " + word.getWord()); */
+            "; offset: " + text.getOffset() +
+            "; Text = " + text.getTextArea()); */
 
         // Set letterSpacing
         //float ls = fs.getLetterSpacing() / this.currentFontSize;
@@ -952,10 +952,10 @@ public class PDFRenderer extends PrintRenderer {
                 pdf.append(startText);
             }
         }
-        prevWordWidth = word.getWidth();
+        prevWordWidth = text.getWidth();
         prevWordX = rx;
 
-        String s = word.getWord();
+        String s = text.getTextArea();
 
         FontMetrics metrics = fontInfo.getMetricsFor(name);
         Font fs = new Font(name, metrics, size);
@@ -964,7 +964,7 @@ public class PDFRenderer extends PrintRenderer {
 
         currentStream.add(pdf.toString());
 
-        super.renderWord(word);
+        super.renderText(text);
     }
 
     /**
index 67ade71760ef01c93a59814a368d8bcdebe6bc5f..c8b55debb8fa8f59d91d60de58388730b3209feb 100644 (file)
@@ -69,7 +69,7 @@ import org.apache.fop.area.CTM;
 import org.apache.fop.area.PageViewport;
 import org.apache.fop.area.Trait;
 import org.apache.fop.area.inline.ForeignObject;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
 import org.apache.fop.datatypes.ColorType;
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.fonts.Typeface;
@@ -466,9 +466,9 @@ public class PSRenderer extends AbstractRenderer {
     }
 
     /**
-     * @see org.apache.fop.render.Renderer#renderWord(Word)
+     * @see org.apache.fop.render.Renderer#renderText(Text)
      */
-    public void renderWord(Word area) {
+    public void renderText(TextArea area) {
         String fontname = (String)area.getTrait(Trait.FONT_NAME);
         int fontsize = area.getTraitAsInteger(Trait.FONT_SIZE);
 
@@ -481,7 +481,7 @@ public class PSRenderer extends AbstractRenderer {
 
         useFont(fontname, fontsize);
 
-        paintText(rx, bl, area.getWord(), f);
+        paintText(rx, bl, area.getTextArea(), f);
 
 /*
         String psString = null;
@@ -514,7 +514,7 @@ public class PSRenderer extends AbstractRenderer {
             write("OLE");
         this.currentXPosition += area.getContentWidth();
         */
-        super.renderWord(area); //Updates IPD
+        super.renderText(area); //Updates IPD
     }
 
 
index 97a3ee7587129e23d33faabb209a7b4d02114793..117f82a5aac4821a5477906bfb63a6f554bffee4 100644 (file)
@@ -55,7 +55,7 @@ import org.apache.fop.area.PageViewport;
 import org.apache.fop.area.Title;
 import org.apache.fop.area.inline.ForeignObject;
 import org.apache.fop.area.inline.Leader;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
 import org.apache.fop.svg.SVGUtilities;
 import org.apache.fop.apps.Document;
 import org.apache.fop.apps.FOUserAgent;
@@ -67,10 +67,9 @@ import org.w3c.dom.svg.SVGSVGElement;
 import org.w3c.dom.svg.SVGDocument;
 /* org.w3c.dom.Document is not imported to avoid conflict with
    org.apache.fop.control.Document */
-import org.w3c.dom.Element;
 import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Element;
 import org.w3c.dom.Text;
-
 import org.apache.batik.dom.svg.SVGDOMImplementation;
 import org.apache.batik.dom.util.XMLSupport;
 import org.apache.batik.transcoder.svg2svg.SVGTranscoder;
@@ -425,16 +424,16 @@ public class SVGRenderer extends AbstractRenderer implements XMLHandler {
     }
 
     /**
-     * @see org.apache.fop.render.Renderer#renderWord(Word)
+     * @see org.apache.fop.render.Renderer#renderText(Text)
      */
-    public void renderWord(Word word) {
-        Element text = SVGUtilities.createText(svgDocument,
+    public void renderText(TextArea text) {
+        Element textElement = SVGUtilities.createText(svgDocument,
                                                currentBlockIPPosition / 1000,
-                                               (currentBPPosition + word.getOffset()) / 1000,
-                                               word.getWord());
-        currentPageG.appendChild(text);
+                                               (currentBPPosition + text.getOffset()) / 1000,
+                                               text.getTextArea());
+        currentPageG.appendChild(textElement);
 
-        super.renderWord(word);
+        super.renderText(text);
     }
 
     /**
index 1fc28848872a9fb07629fd01411eb806e7193bbe..32eef5f45fdf1266e2ee7c9d047b6867417f6bbe 100644 (file)
@@ -91,7 +91,7 @@ import org.apache.fop.area.inline.InlineParent;
 import org.apache.fop.area.inline.Leader;
 import org.apache.fop.area.inline.Space;
 import org.apache.fop.area.inline.Viewport;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
 import org.apache.fop.fo.properties.RuleStyle;
 import org.apache.fop.fo.FOTreeControl;
 import org.apache.fop.fo.pagination.Region;
@@ -453,17 +453,17 @@ public class XMLRenderer extends AbstractRenderer {
     }
 
     /**
-     * @see org.apache.fop.render.Renderer#renderWord(Word)
+     * @see org.apache.fop.render.Renderer#renderText(Text)
      */
-    public void renderWord(Word word) {
+    public void renderText(TextArea text) {
         String prop = "";
-        Map map = word.getTraits();
+        Map map = text.getTraits();
         if (map != null) {
             prop = " props=\"" + getPropString(map) + "\"";
         }
-        writeElement("<word wsadjust=\"" + word.getWSadjust() + "\""
-             + prop + ">" + word.getWord() + "</word>");
-        super.renderWord(word);
+        writeElement("<text tsadjust=\"" + text.getTSadjust() + "\""
+             + prop + ">" + text.getTextArea() + "</text>");
+        super.renderText(text);
     }
 
     /**
index 2440939904df49a6fe37abeaac184dec4dcb16ea..d0fe8f973fbb9f4a9775f85dd176ea2e87b3cda7 100644 (file)
@@ -99,7 +99,7 @@ import org.apache.fop.area.inline.InlineArea;
 import org.apache.fop.area.inline.Leader;
 import org.apache.fop.area.inline.Space;
 import org.apache.fop.area.inline.Viewport;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
 import org.apache.fop.apps.Document;
 import org.apache.fop.fonts.Font;
 import org.apache.fop.render.Renderer;
@@ -589,13 +589,13 @@ class TreeLoader extends AbstractLogEnabled {
                 FontMetrics metrics = fontInfo.getMetricsFor(fname);
                 currentFontState =
                     new Font(fname, metrics, 12000);
-                Word word = getWord((Element) obj);
+                TextArea text = getText((Element) obj);
 
-                word.addTrait(Trait.FONT_NAME, fname);
-                word.addTrait(Trait.FONT_SIZE, new Integer(12000));
+                text.addTrait(Trait.FONT_NAME, fname);
+                text.addTrait(Trait.FONT_SIZE, new Integer(12000));
 
-                if (word != null) {
-                    list.add(word);
+                if (text != null) {
+                    list.add(text);
                 }
             } else {
             }
@@ -723,19 +723,19 @@ class TreeLoader extends AbstractLogEnabled {
         return leader;
     }
 
-    Word getWord(Element root) {
+    TextArea getText(Element root) {
         String str = getString(root);
-        Word word = new Word();
-        word.setWord(str);
-        addTraits(root, word);
+        TextArea text = new TextArea();
+        text.setTextArea(str);
+        addTraits(root, text);
         int width = 0;
         for (int count = 0; count < str.length(); count++) {
             width += currentFontState.getWidth(str.charAt(count));
         }
-        word.setWidth(width);
-        word.setOffset(currentFontState.getCapHeight());
+        text.setWidth(width);
+        text.setOffset(currentFontState.getCapHeight());
 
-        return word;
+        return text;
     }