gmazza      2003/10/27 20:22:14

  Modified:    src/java/org/apache/fop/area/inline InlineAreaVisitor.java
                        UnresolvedPageNumber.java
               src/java/org/apache/fop/layoutmgr AddLMVisitor.java
                        TextLayoutManager.java
               src/java/org/apache/fop/render AbstractRenderer.java
                        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
  Added:       src/java/org/apache/fop/area/inline TextArea.java
  Removed:     src/java/org/apache/fop/area/inline Word.java
  Log:
  renamed org.apache.fop.area.inline.Word to .TextArea (.Text not used to avoid
  conflicts with org.w3c.dom.Text)
  changed Renderer.renderWord() method to renderText().
  
  Revision  Changes    Path
  1.2       +4 -4      
xml-fop/src/java/org/apache/fop/area/inline/InlineAreaVisitor.java
  
  Index: InlineAreaVisitor.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/area/inline/InlineAreaVisitor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InlineAreaVisitor.java    10 Sep 2003 18:42:22 -0000      1.1
  +++ InlineAreaVisitor.java    28 Oct 2003 04:22:13 -0000      1.2
  @@ -66,11 +66,11 @@
       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.
  
  
  
  1.2       +3 -3      
xml-fop/src/java/org/apache/fop/area/inline/UnresolvedPageNumber.java
  
  Index: UnresolvedPageNumber.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/area/inline/UnresolvedPageNumber.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- UnresolvedPageNumber.java 11 Mar 2003 13:05:40 -0000      1.1
  +++ UnresolvedPageNumber.java 28 Oct 2003 04:22:13 -0000      1.2
  @@ -60,7 +60,7 @@
    * 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 UnresolvedPageNumber(String id) {
           pageRefId = id;
  -        word = "?";
  +        text = "?";
       }
   
       /**
  @@ -98,7 +98,7 @@
           if (pages != null) {
               PageViewport page = (PageViewport)pages.get(0);
               String str = page.getPageNumber();
  -            word = str;
  +            text = str;
   
               /[EMAIL PROTECTED] Update IPD ??? */
           }
  
  
  
  1.1                  xml-fop/src/java/org/apache/fop/area/inline/TextArea.java
  
  Index: TextArea.java
  ===================================================================
  /*
   * $Id: TextArea.java,v 1.1 2003/10/28 04:22:13 gmazza 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
   *    [EMAIL PROTECTED]
   *
   * 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 <[EMAIL PROTECTED]>. 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;
      }
  }
  
  
  
  
  1.22      +13 -13    xml-fop/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java
  
  Index: AddLMVisitor.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- AddLMVisitor.java 12 Oct 2003 20:06:57 -0000      1.21
  +++ AddLMVisitor.java 28 Oct 2003 04:22:13 -0000      1.22
  @@ -71,7 +71,7 @@
   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 @@
            } 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 @@
                }
                FilledArea fa = new FilledArea();
                fa.setUnitWidth(width);
  -             fa.addChild(w);
  +             fa.addChild(t);
                if (spacer != null) {
                    fa.addChild(spacer);
                }
  @@ -738,14 +738,14 @@
            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 @@
            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());
  
  
  
  1.6       +8 -8      xml-fop/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java
  
  Index: TextLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TextLayoutManager.java    10 Oct 2003 15:56:57 -0000      1.5
  +++ TextLayoutManager.java    28 Oct 2003 04:22:13 -0000      1.6
  @@ -56,7 +56,7 @@
   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 @@
   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 @@
               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 @@
        * @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()));
  
  
  
  1.16      +9 -9      xml-fop/src/java/org/apache/fop/render/AbstractRenderer.java
  
  Index: AbstractRenderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/AbstractRenderer.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- AbstractRenderer.java     19 Sep 2003 16:46:43 -0000      1.15
  +++ AbstractRenderer.java     28 Oct 2003 04:22:13 -0000      1.16
  @@ -90,7 +90,7 @@
   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 @@
               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 @@
       }
   
       /** @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 @@
       }
   
       /**
  -     * 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);
       }
   
       /**
  
  
  
  1.6       +4 -4      xml-fop/src/java/org/apache/fop/render/Renderer.java
  
  Index: Renderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/Renderer.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Renderer.java     19 Sep 2003 16:46:43 -0000      1.5
  +++ Renderer.java     28 Oct 2003 04:22:14 -0000      1.6
  @@ -66,7 +66,7 @@
   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 @@
       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.
  
  
  
  1.16      +10 -10    xml-fop/src/java/org/apache/fop/render/awt/AWTRenderer.java
  
  Index: AWTRenderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/awt/AWTRenderer.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- AWTRenderer.java  2 Oct 2003 00:32:02 -0000       1.15
  +++ AWTRenderer.java  28 Oct 2003 04:22:14 -0000      1.16
  @@ -85,7 +85,7 @@
   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 @@
       }
       
       /**
  -     * @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 @@
               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();
       }
   }
  
  
  
  1.20      +12 -12    xml-fop/src/java/org/apache/fop/render/pdf/PDFRenderer.java
  
  Index: PDFRenderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/pdf/PDFRenderer.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- PDFRenderer.java  26 Oct 2003 19:29:14 -0000      1.19
  +++ PDFRenderer.java  28 Oct 2003 04:22:14 -0000      1.20
  @@ -83,7 +83,7 @@
   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 @@
       }
   
       /**
  -     * @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 @@
           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 @@
           // 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 @@
                   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 @@
   
           currentStream.add(pdf.toString());
   
  -        super.renderWord(word);
  +        super.renderText(text);
       }
   
       /**
  
  
  
  1.17      +5 -5      xml-fop/src/java/org/apache/fop/render/ps/PSRenderer.java
  
  Index: PSRenderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/ps/PSRenderer.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- PSRenderer.java   19 Sep 2003 16:51:16 -0000      1.16
  +++ PSRenderer.java   28 Oct 2003 04:22:14 -0000      1.17
  @@ -69,7 +69,7 @@
   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 @@
       }
   
       /**
  -     * @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 @@
   
           useFont(fontname, fontsize);
   
  -        paintText(rx, bl, area.getWord(), f);
  +        paintText(rx, bl, area.getTextArea(), f);
   
   /*
           String psString = null;
  @@ -514,7 +514,7 @@
               write("OLE");
           this.currentXPosition += area.getContentWidth();
           */
  -        super.renderWord(area); //Updates IPD
  +        super.renderText(area); //Updates IPD
       }
   
   
  
  
  
  1.10      +9 -10     xml-fop/src/java/org/apache/fop/render/svg/SVGRenderer.java
  
  Index: SVGRenderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/svg/SVGRenderer.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SVGRenderer.java  28 Aug 2003 17:27:42 -0000      1.9
  +++ SVGRenderer.java  28 Oct 2003 04:22:14 -0000      1.10
  @@ -55,7 +55,7 @@
   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.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 @@
       }
   
       /**
  -     * @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);
       }
   
       /**
  
  
  
  1.11      +7 -7      xml-fop/src/java/org/apache/fop/render/xml/XMLRenderer.java
  
  Index: XMLRenderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/xml/XMLRenderer.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- XMLRenderer.java  10 Sep 2003 18:42:22 -0000      1.10
  +++ XMLRenderer.java  28 Oct 2003 04:22:14 -0000      1.11
  @@ -91,7 +91,7 @@
   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 @@
       }
   
       /**
  -     * @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);
       }
   
       /**
  
  
  
  1.10      +13 -13    xml-fop/src/java/org/apache/fop/tools/AreaTreeBuilder.java
  
  Index: AreaTreeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/tools/AreaTreeBuilder.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- AreaTreeBuilder.java      6 Oct 2003 16:38:48 -0000       1.9
  +++ AreaTreeBuilder.java      28 Oct 2003 04:22:14 -0000      1.10
  @@ -99,7 +99,7 @@
   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 @@
                   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 @@
           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;
       }
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to