vmote       2003/07/17 09:38:17

  Modified:    src/java/org/apache/fop/fo FOText.java
                        InlineCharIterator.java KeepProperty.java
  Log:
  style changes only
  
  Revision  Changes    Path
  1.6       +49 -31    xml-fop/src/java/org/apache/fop/fo/FOText.java
  
  Index: FOText.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOText.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FOText.java       29 Jun 2003 19:34:33 -0000      1.5
  +++ FOText.java       17 Jul 2003 16:38:17 -0000      1.6
  @@ -76,15 +76,18 @@
    */
   public class FOText extends FObj {
   
  -    protected char[] ca;
  -    protected int start;
  -    protected int length;
  -    TextInfo textInfo;
  -    TextState ts;
  +    private char[] ca;
  +    private int start;
  +    private int length;
  +    private TextInfo textInfo;
  +    private TextState ts;
   
       /**
        * Keeps track of the last FOText object created within the current
        * block. This is used to create pointers between such objects.
  +     * TODO: As soon as the control hierarchy is straightened out, this static
  +     * variable needs to become an instance variable in some parent object,
  +     * probably the page-sequence.
        */
       private static FOText lastFOTextProcessed = null;
   
  @@ -106,10 +109,19 @@
        */
       private Block ancestorBlock = null;
   
  -    public static final int IS_WORD_CHAR_FALSE = 0;
  -    public static final int IS_WORD_CHAR_TRUE = 1;
  -    public static final int IS_WORD_CHAR_MAYBE = 2;
  +    private static final int IS_WORD_CHAR_FALSE = 0;
  +    private static final int IS_WORD_CHAR_TRUE = 1;
  +    private static final int IS_WORD_CHAR_MAYBE = 2;
   
  +    /**
  +     *
  +     * @param chars array of chars which contains the text in this object (may
  +     * be a superset of the text in this object
  +     * @param s starting index into char[] for the text in this object
  +     * @param e ending index into char[] for the text in this object
  +     * @param ti TextInfo object for the text in this object
  +     * @param parent FONode that is the parent of this object
  +     */
       public FOText(char[] chars, int s, int e, TextInfo ti, FONode parent) {
           super(parent);
           this.start = 0;
  @@ -169,6 +181,9 @@
           list.add(lm);
       }
   
  +    /**
  +     * @return a new TextCharIterator
  +     */
       public CharIterator charIterator() {
           return new TextCharIterator();
       }
  @@ -231,12 +246,11 @@
               }
           }
           // if the last FOText is a sibling, point to it, and have it point here
  -        if ( lastFOTextProcessed != null) {
  +        if (lastFOTextProcessed != null) {
               if (lastFOTextProcessed.ancestorBlock == this.ancestorBlock) {
                   prevFOTextThisBlock = lastFOTextProcessed;
                   prevFOTextThisBlock.nextFOTextThisBlock = this;
  -            }
  -            else {
  +            } else {
                   prevFOTextThisBlock = null;
               }
           }
  @@ -266,7 +280,7 @@
        * well, such as word-spacing. The definition of "word" is somewhat ambiguous
        * and appears to be definable by the user agent.
        *
  -     * @param (int i) with index to ca[]
  +     * @param i index into ca[]
        *
        * @return True if the character at this location is the start of a new
        * word.
  @@ -309,13 +323,13 @@
        * block as one unit, allowing text in adjoining FOText objects to be
        * returned if the parameters are outside of the current object.
        *
  -     * @param (int i) with the index for ca[]
  -     * @param (int offset) signed integer with relative position within the
  +     * @param i index into ca[]
  +     * @param offset signed integer with relative position within the
        *   block of the character to return. To return the character immediately
        *   preceding i, pass -1. To return the character immediately after i,
        *   pass 1.
  -     * @return char the character in the offset position within the block.
  -     * @return \u0000 if the offset points to an area outside of the block.
  +     * @return the character in the offset position within the block; \u0000 if
  +     * the offset points to an area outside of the block.
        */
       public char getRelativeCharInBlock(int i, int offset) {
           // The easy case is where the desired character is in the same FOText
  @@ -331,7 +345,7 @@
           char charToReturn = '\u0000';
           FOText nodeToTest = this;
           int remainingOffset = offset + i;
  -        while (! foundChar) {
  +        while (!foundChar) {
               if (nodeToTest.prevFOTextThisBlock == null) {
                   foundChar = true;
                   break;
  @@ -340,8 +354,7 @@
               if ((nodeToTest.ca.length + remainingOffset) >= 0) {
                   charToReturn = nodeToTest.ca[nodeToTest.ca.length + 
remainingOffset];
                   foundChar = true;
  -            }
  -            else {
  +            } else {
                   remainingOffset = remainingOffset + nodeToTest.ca.length;
               }
           }
  @@ -349,17 +362,17 @@
       }
   
       /**
  -     * @return The previous FOText node in this Block.
  -     * @return null, if this is the first FOText in this Block.
  +     * @return The previous FOText node in this Block; null, if this is the
  +     * first FOText in this Block.
        */
       public FOText getPrevFOTextThisBlock () {
           return prevFOTextThisBlock;
       }
   
       /**
  -     * @return The next FOText node in this Block.
  -     * @return null, if this is the last FOText in this Block, or if subsequent
  -     * FOText nodes have not yet been processed.
  +     * @return The next FOText node in this Block; null if this is the last
  +     * FOText in this Block; null if subsequent FOText nodes have not yet been
  +     * processed.
        */
       public FOText getNextFOTextThisBlock () {
           return nextFOTextThisBlock;
  @@ -375,7 +388,7 @@
       /**
        * Transforms one character in ca[] using the text-transform property.
        *
  -     * @param int with index for ca[]
  +     * @param i the index into ca[]
        * @return char with transformed value
        */
       public char charTransform(int i) {
  @@ -396,8 +409,7 @@
                    are capitalized. We will try to let Java handle this.
                   */
                   return Character.toTitleCase(ca[i]);
  -            }
  -            else {
  +            } else {
                   return Character.toLowerCase(ca[i]);
               }
           default:
  @@ -414,7 +426,7 @@
        * We have not found a definition of "word" in the standard (1.0), so the
        * logic used here is based on the programmer's best guess.
        *
  -     * @param char inputChar: the character to be tested.
  +     * @param inputChar the character to be tested.
        * @return int IS_WORD_CHAR_TRUE, IS_WORD_CHAR_FALSE, or IS_WORD_CHAR_MAYBE,
        * depending on whether the character should be considered part of a word
        * or not.
  @@ -430,14 +442,18 @@
           case Character.CURRENCY_SYMBOL:
               return IS_WORD_CHAR_TRUE;
           case Character.DASH_PUNCTUATION:
  -            if (inputChar == '-') return IS_WORD_CHAR_TRUE; //hyphen
  +            if (inputChar == '-') {
  +                return IS_WORD_CHAR_TRUE; //hyphen
  +            }
               return IS_WORD_CHAR_FALSE;
           case Character.DECIMAL_DIGIT_NUMBER:
               return IS_WORD_CHAR_TRUE;
           case Character.ENCLOSING_MARK:
               return IS_WORD_CHAR_FALSE;
           case Character.END_PUNCTUATION:
  -            if (inputChar == '\u2019') return IS_WORD_CHAR_MAYBE; //apostrophe, 
right single quote
  +            if (inputChar == '\u2019') {
  +                return IS_WORD_CHAR_MAYBE; //apostrophe, right single quote
  +            }
               return IS_WORD_CHAR_FALSE;
           case Character.FORMAT:
               return IS_WORD_CHAR_FALSE;
  @@ -460,7 +476,9 @@
           case Character.OTHER_NUMBER:
               return IS_WORD_CHAR_TRUE;
           case Character.OTHER_PUNCTUATION:
  -            if (inputChar == '\'') return IS_WORD_CHAR_MAYBE; //ASCII apostrophe
  +            if (inputChar == '\'') {
  +                return IS_WORD_CHAR_MAYBE; //ASCII apostrophe
  +            }
               return IS_WORD_CHAR_FALSE;
           case Character.OTHER_SYMBOL:
               return IS_WORD_CHAR_TRUE;
  
  
  
  1.2       +22 -10    xml-fop/src/java/org/apache/fop/fo/InlineCharIterator.java
  
  Index: InlineCharIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/InlineCharIterator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InlineCharIterator.java   11 Mar 2003 13:05:19 -0000      1.1
  +++ InlineCharIterator.java   17 Jul 2003 16:38:17 -0000      1.2
  @@ -3,34 +3,34 @@
    * ============================================================================
    *                    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
  @@ -42,12 +42,12 @@
    * (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.fo;
   
   import org.apache.fop.layout.BorderAndPadding;
  @@ -59,6 +59,11 @@
       private boolean bStartBoundary = false;
       private boolean bEndBoundary = false;
   
  +    /**
  +     * @param fobj the object for whose character contents and for whose
  +     * descendant's character contents should be iterated
  +     * @param bap
  +     */
       public InlineCharIterator(FObj fobj, BorderAndPadding bap) {
           super(fobj);
           checkBoundaries(bap);
  @@ -73,6 +78,9 @@
                        || bap.getPaddingRight(false) > 0);
       }
   
  +    /**
  +     * @return true if there are more characters
  +     */
       public boolean hasNext() {
           if (bStartBoundary) {
               return true;
  @@ -84,6 +92,10 @@
            */
       }
   
  +    /**
  +     * @return the next character
  +     * @throws NoSuchElementException if there are no more characters
  +     */
       public char nextChar() throws NoSuchElementException {
           if (bStartBoundary) {
               bStartBoundary = false;
  
  
  
  1.2       +28 -10    xml-fop/src/java/org/apache/fop/fo/KeepProperty.java
  
  Index: KeepProperty.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/KeepProperty.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- KeepProperty.java 11 Mar 2003 13:05:19 -0000      1.1
  +++ KeepProperty.java 17 Jul 2003 16:38:17 -0000      1.2
  @@ -3,34 +3,34 @@
    * ============================================================================
    *                    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
  @@ -42,20 +42,29 @@
    * (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.fo;
   
   import org.apache.fop.datatypes.Keep;
   
  +/**
  + * Superclass for properties that wrap Keep values
  + */
   public class KeepProperty extends Property {
   
  +    /**
  +     * Inner class for creating instances of KeepProperty
  +     */
       public static class Maker extends Property.Maker {
   
  +        /**
  +         * @param name name of property for which Maker should be created
  +         */
           protected Maker(String name) {
               super(name);
           }
  @@ -64,14 +73,23 @@
   
       private Keep keep;
   
  +    /**
  +     * @param keep Keep value to wrap in this Property
  +     */
       public KeepProperty(Keep keep) {
           this.keep = keep;
       }
   
  +    /**
  +     * @return this.keep
  +     */
       public Keep getKeep() {
           return this.keep;
       }
   
  +    /**
  +     * @return this.keep cast as Object
  +     */
       public Object getObject() {
           return this.keep;
       }
  
  
  

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

Reply via email to