vmote       2003/07/16 10:36:24

  Modified:    src/java/org/apache/fop/fo PropertyList.java
                        PropertyListBuilder.java PropertyManager.java
  Log:
  style changes only
  
  Revision  Changes    Path
  1.2       +68 -17    xml-fop/src/java/org/apache/fop/fo/PropertyList.java
  
  Index: PropertyList.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/PropertyList.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PropertyList.java 11 Mar 2003 13:05:19 -0000      1.1
  +++ PropertyList.java 16 Jul 2003 17:36:23 -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,33 +42,52 @@
    * (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 java.util.HashMap;
   import org.apache.fop.fo.properties.WritingMode;
   import org.apache.fop.apps.FOPException;
   
  +/**
  + * Class containing the collection of properties for a given FObj.
  + */
   public class PropertyList extends HashMap {
   
  -    private byte[] wmtable = null;    // writing-mode values
  +    // writing-mode values
  +    private byte[] wmtable = null;
  +
  +    // absolute directions and dimensions
  +    /** constant for direction "left" */
       public static final int LEFT = 0;
  +    /** constant for direction "right" */
       public static final int RIGHT = 1;
  +    /** constant for direction "top" */
       public static final int TOP = 2;
  +    /** constant for direction "bottom" */
       public static final int BOTTOM = 3;
  +    /** constant for dimension "height" */
       public static final int HEIGHT = 4;
  +    /** constant for dimension "width" */
       public static final int WIDTH = 5;
   
  +    // directions relative to writing-mode
  +    /** constant for direction "start" */
       public static final int START = 0;
  +    /** constant for direction "end" */
       public static final int END = 1;
  +    /** constant for direction "before" */
       public static final int BEFORE = 2;
  +    /** constant for direction "after" */
       public static final int AFTER = 3;
  +    /** constant for dimension "block-progression-dimension" */
       public static final int BLOCKPROGDIM = 4;
  +    /** constant for dimension "inline-progression-dimension" */
       public static final int INLINEPROGDIM = 5;
   
       private static final String[] ABS_NAMES = new String[] {
  @@ -102,6 +121,13 @@
       private String element = "";
       private FObj fobj = null;
   
  +    /**
  +     * Basic constructor.
  +     * @param parentPropertyList the PropertyList belongin to the new objects
  +     * parent
  +     * @param space name of namespace
  +     * @param el name of element
  +     */
       public PropertyList(PropertyList parentPropertyList, String space,
                           String el) {
           this.parentPropertyList = parentPropertyList;
  @@ -109,14 +135,23 @@
           this.element = el;
       }
   
  +    /**
  +     * @param fobj the FObj object to which this propertyList should be attached
  +     */
       public void setFObj(FObj fobj) {
           this.fobj = fobj;
       }
   
  +    /**
  +     * @return the FObj object to which this propertyList is attached
  +     */
       public FObj getFObj() {
           return this.fobj;
       }
   
  +    /**
  +     * @return the FObj object attached to the parentPropetyList
  +     */
       public FObj getParentFObj() {
           if (parentPropertyList != null) {
               return parentPropertyList.getFObj();
  @@ -253,6 +288,8 @@
       /**
        * Return the property on the current FlowObject if it is specified, or if a
        * corresponding property is specified. If neither is specified, it returns 
null.
  +     * @param propertyName name of property
  +     * @return the Property corresponding to that name
        */
       public Property getSpecified(String propertyName) {
           return get(propertyName, false, false);
  @@ -264,6 +301,8 @@
        * this will try to compute it based on other properties, or if it is
        * inheritable, to return the inherited value. If all else fails, it returns
        * the default value.
  +     * @param propertyName property name
  +     * @return the Property corresponding to that name
        */
       public Property get(String propertyName) {
           return get(propertyName, true, true);
  @@ -315,14 +354,24 @@
           }
       }
   
  +    /**
  +     *
  +     * @param builder the PropertyListBuilder to attache to this object
  +     */
       public void setBuilder(PropertyListBuilder builder) {
           this.builder = builder;
       }
   
  +    /**
  +     * @return the namespace of this element
  +     */
       public String getNameSpace() {
           return namespace;
       }
   
  +    /**
  +     * @return element name for this
  +     */
       public String getElement() {
           return element;
       }
  @@ -377,9 +426,10 @@
       }
   
       /**
  -     * Given an absolute direction (top, bottom, left, right),
  -     * return the corresponding writing model relative direction name
  -     * for the flow object. Uses the stored writingMode.
  +     * Uses the stored writingMode.
  +     * @param absdir an absolute direction (top, bottom, left, right)
  +     * @return the corresponding writing model relative direction name
  +     * for the flow object.
        */
       public String wmAbsToRel(int absdir) {
           if (wmtable != null) {
  @@ -390,9 +440,9 @@
       }
   
       /**
  -     * Given a writing mode relative direction (start, end, before, after)
  -     * return the corresponding absolute direction name
  -     * for the flow object. Uses the stored writingMode.
  +     * Uses the stored writingMode.
  +     * @param reldir a writing mode relative direction (start, end, before, after)
  +     * @return the corresponding absolute direction name for the flow object.
        */
       public String wmRelToAbs(int reldir) {
           if (wmtable != null) {
  @@ -407,6 +457,7 @@
   
       /**
        * Set the writing mode traits for the FO with this property list.
  +     * @param writingMode the writing-mode property to be set for this object
        */
       public void setWritingMode(int writingMode) {
           this.wmtable = (byte[])WRITING_MODE_TABLES.get(new Integer(writingMode));
  
  
  
  1.13      +68 -2     xml-fop/src/java/org/apache/fop/fo/PropertyListBuilder.java
  
  Index: PropertyListBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/PropertyListBuilder.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- PropertyListBuilder.java  4 Jul 2003 19:59:40 -0000       1.12
  +++ PropertyListBuilder.java  16 Jul 2003 17:36:23 -0000      1.13
  @@ -58,6 +58,10 @@
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.fo.Property.Maker;
   
  +/**
  + * Class for managing the PropertyList objects, including adding items to them
  + * and retrieving items from them.
  + */
   public class PropertyListBuilder {
   
       /**
  @@ -68,19 +72,40 @@
       private HashMap propertyListTable;
       private HashMap elementTable;
   
  +    /**
  +     * Basic Constructor, initialized the tables.
  +     */
       public PropertyListBuilder() {
           this.propertyListTable = new HashMap();
           this.elementTable = new HashMap();
       }
   
  +    /**
  +     * Add the entire propertyListTable to the list
  +     * @param list list to which the elements of propertyListTable should be
  +     * added
  +     */
       public void addList(HashMap list) {
           propertyListTable.putAll(list);
       }
   
  +    /**
  +     * Adds a single element to the list
  +     * @param element name of element to add
  +     * @param list list to which the element should be added
  +     */
       public void addElementList(String element, HashMap list) {
           elementTable.put(element, list);
       }
   
  +    /**
  +     *
  +     * @param propertyList collection of properties
  +     * @param space namespace of element
  +     * @param element name of element
  +     * @param propertyName name of property
  +     * @return the requested Property object
  +     */
       public Property computeProperty(PropertyList propertyList, String space,
                                       String element, String propertyName) {
   
  @@ -103,6 +128,13 @@
           return p;
       }
   
  +    /**
  +     *
  +     * @param space namespace of element
  +     * @param element name of element
  +     * @param propertyName name of property
  +     * @return isInherited value from the requested Property.Maker
  +     */
       public boolean isInherited(String space, String element,
                                  String propertyName) {
           boolean b;
  @@ -280,6 +312,14 @@
           return subPropName;
       }
   
  +    /**
  +     * @param space namespace of element
  +     * @param element name of element
  +     * @param propertyName name of property
  +     * @param p a Property object
  +     * @param subpropName name of the sub-property to get
  +     * @return the sub-property
  +     */
       public Property getSubpropValue(String space, String element,
                                       String propertyName, Property p,
                                       String subpropName) {
  @@ -291,7 +331,13 @@
           }
       }
   
  -
  +    /**
  +     * @param propertyList collection of properties
  +     * @param space namespace of element
  +     * @param element name of element
  +     * @param propertyName name of property
  +     * @return value from the appropriate Property.Maker
  +     */
       public boolean isCorrespondingForced(PropertyList propertyList,
                                            String space, String element,
                                            String propertyName) {
  @@ -305,6 +351,13 @@
           return false;
       }
   
  +    /**
  +     * @param propertyList collection of properties
  +     * @param space namespace of element
  +     * @param element name of element
  +     * @param propertyName name of property
  +     * @return new Property object
  +     */
       public Property getShorthand(PropertyList propertyList, String space,
                                    String element, String propertyName) {
           Property.Maker propertyMaker = findMaker(space, element,
  @@ -317,7 +370,14 @@
           }
       }
   
  -
  +    /**
  +     * @param propertyList collection of properties
  +     * @param space namespace of element
  +     * @param element name of element
  +     * @param propertyName name of property
  +     * @return new Property object
  +     * @throws FOPException for errors in the input
  +     */
       public Property makeProperty(PropertyList propertyList, String space,
                                    String element,
                                    String propertyName) throws FOPException {
  @@ -335,6 +395,12 @@
           return p;
       }
   
  +    /**
  +     * @param space namespace of element
  +     * @param elementName name of element
  +     * @param propertyName name of property
  +     * @return the Property.Maker for this property
  +     */
       protected Property.Maker findMaker(String space, String elementName,
                                          String propertyName) {
           return findMaker((HashMap)elementTable.get(elementName),
  
  
  
  1.3       +1 -1      xml-fop/src/java/org/apache/fop/fo/PropertyManager.java
  
  Index: PropertyManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/PropertyManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PropertyManager.java      25 Mar 2003 23:34:11 -0000      1.2
  +++ PropertyManager.java      16 Jul 2003 17:36:23 -0000      1.3
  @@ -154,7 +154,7 @@
                   try {
                       fontWeight = Integer.parseInt(fw);
                   } catch (NumberFormatException nfe) {
  -                } /[EMAIL PROTECTED] log that exception */
  +                } /** TODO: log that exception */
               }
               fontWeight = ((int) fontWeight / 100) * 100;
               if (fontWeight < 100) {
  
  
  

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

Reply via email to