You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by bc...@apache.org on 2004/10/20 13:50:05 UTC

cvs commit: xml-fop/src/java/org/apache/fop/fo/properties CommonAccessibility.java CommonHyphenation.java CommonMarginBlock.java CommonRelativePosition.java

bckfnn      2004/10/20 04:50:05

  Modified:    src/java/org/apache/fop/fo/properties
                        CommonAccessibility.java CommonHyphenation.java
                        CommonMarginBlock.java CommonRelativePosition.java
  Log:
  Third phase of performance improvement.
  - Follow the spec for property types and names.
  
  PR: 31699
  
  Revision  Changes    Path
  1.3       +26 -2     xml-fop/src/java/org/apache/fop/fo/properties/CommonAccessibility.java
  
  Index: CommonAccessibility.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonAccessibility.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CommonAccessibility.java	27 Feb 2004 17:45:44 -0000	1.2
  +++ CommonAccessibility.java	20 Oct 2004 11:50:04 -0000	1.3
  @@ -18,16 +18,40 @@
   
   package org.apache.fop.fo.properties;
   
  +import org.apache.fop.fo.Constants;
  +import org.apache.fop.fo.PropertyList;
  +
   /**
    * Store all common accessibility properties.
    * See Sec 7.4 of the XSL-FO Standard.
    * Public "structure" allows direct member access.
    */
   public class CommonAccessibility {
  +    /**
  +     * The "source-doc" property.
  +     */
       public String sourceDoc = null;
  +
  +    /**
  +     * The "role" property.
  +     */
       public String role = null;
   
  -    public CommonAccessibility() {
  +    /**
  +     * Create a CommonAbsolutePosition object.
  +     * @param pList The PropertyList with propery values.
  +     */
  +    public CommonAccessibility(PropertyList pList) {
  +        sourceDoc = pList.get(Constants.PR_SOURCE_DOCUMENT).getString();
  +        if ("none".equals(sourceDoc)) {
  +            sourceDoc = null;
  +        }
  +        role = pList.get(Constants.PR_ROLE).getString();
  +        if ("none".equals(role)) {
  +            role = null;
  +        }
  +        
       }
  +
   
   }
  
  
  
  1.3       +51 -5     xml-fop/src/java/org/apache/fop/fo/properties/CommonHyphenation.java
  
  Index: CommonHyphenation.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonHyphenation.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CommonHyphenation.java	27 Feb 2004 17:45:44 -0000	1.2
  +++ CommonHyphenation.java	20 Oct 2004 11:50:04 -0000	1.3
  @@ -18,18 +18,64 @@
   
   package org.apache.fop.fo.properties;
   
  +import org.apache.fop.fo.Constants;
  +import org.apache.fop.fo.PropertyList;
  +
   /**
    * Store all common hyphenation properties.
    * See Sec. 7.9 of the XSL-FO Standard.
    * Public "structure" allows direct member access.
    */
   public class CommonHyphenation {
  +    /**
  +     * The "language" property.
  +     */
  +    public String language;
  +
  +    /**
  +     * The "country" property.
  +     */
  +    public String country;
  +
  +    /**
  +     * The "script" property.
  +     */
  +    public String script;
  +
  +    /**
  +     * The "hyphenate" property.
  +     */
  +    public int hyphenate;
   
  -    public int hyphenate;      // Enum true or false: store as boolean!
  -    public char hyphenationChar;
  +    /**
  +     * The "hyphenation-character" property.
  +     */
  +    public char hyphenationCharacter;
  +
  +    /**
  +     * The "hyphenation-push-character" property.
  +     */
       public int hyphenationPushCharacterCount;
  +
  +    /**
  +     * The "hyphenation-remain-character-count" property.
  +     */
       public int hyphenationRemainCharacterCount;
  -    public String language;    // Language code or enum "NONE"
  -    public String country;     // Country code or enum "NONE"
  +
  +    /**
  +     * Create a CommonHyphenation object.
  +     * @param pList The PropertyList with propery values.
  +     */
  +    public CommonHyphenation(PropertyList pList) {
  +        language = pList.get(Constants.PR_LANGUAGE).getString();
  +        country = pList.get(Constants.PR_COUNTRY).getString();
  +        hyphenate = pList.get(Constants.PR_HYPHENATE).getEnum();
  +        hyphenationCharacter = pList.get(Constants.PR_HYPHENATION_CHARACTER).getCharacter();
  +        hyphenationPushCharacterCount = 
  +            pList.get(Constants.PR_HYPHENATION_PUSH_CHARACTER_COUNT).getNumber().intValue();
  +        hyphenationRemainCharacterCount = 
  +            pList.get(Constants.PR_HYPHENATION_REMAIN_CHARACTER_COUNT).getNumber().intValue();
  +
  +    }
   
   }
  
  
  
  1.3       +59 -9     xml-fop/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java
  
  Index: CommonMarginBlock.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CommonMarginBlock.java	27 Feb 2004 17:45:44 -0000	1.2
  +++ CommonMarginBlock.java	20 Oct 2004 11:50:04 -0000	1.3
  @@ -18,20 +18,70 @@
   
   package org.apache.fop.fo.properties;
   
  +import org.apache.fop.datatypes.Length;
  +import org.apache.fop.fo.Constants;
  +import org.apache.fop.fo.PropertyList;
  +
   /**
    * Store all common margin properties for blocks.
    * See Sec. 7.10 of the XSL-FO Standard.
    * Public "structure" allows direct member access.
    */
   public class CommonMarginBlock {
  +    /**
  +     * The "margin-top" property.
  +     */
  +    public Length marginTop;
  +
  +    /**
  +     * The "margin-bottom" property.
  +     */
  +    public Length marginBottom;
  +
  +    /**
  +     * The "margin-left" property.
  +     */
  +    public Length marginLeft;
  +
  +    /**
  +     * The "margin-right" property.
  +     */
  +    public Length marginRight;
  +
  +    /**
  +     * The "space-before" property.
  +     */
  +    public SpaceProperty spaceBefore;
  +
  +    /**
  +     * The "space-after" property.
  +     */
  +    public SpaceProperty spaceAfter;
  +
  +    /**
  +     * The "start-indent" property.
  +     */
  +    public Length startIndent;
  +
  +    /**
  +     * The "end-indent" property.
  +     */
  +    public Length endIndent;
  +
  +    /**
  +     * Create a CommonMarginBlock object.
  +     * @param pList The PropertyList with propery values.
  +     */
  +    public CommonMarginBlock(PropertyList pList) {
  +        marginTop = pList.get(Constants.PR_MARGIN_TOP).getLength();
  +        marginBottom = pList.get(Constants.PR_MARGIN_BOTTOM).getLength();
  +        marginLeft = pList.get(Constants.PR_MARGIN_LEFT).getLength();
  +        marginRight = pList.get(Constants.PR_MARGIN_RIGHT).getLength();
   
  -    public int marginTop;
  -    public int marginBottom;
  -    public int marginLeft;
  -    public int marginRight;
  -    public int spaceBefore;
  -    public int spaceAfter;
  -    public int startIndent;
  -    public int endIndent;
  +        spaceBefore = pList.get(Constants.PR_SPACE_BEFORE).getSpace();
  +        spaceAfter = pList.get(Constants.PR_SPACE_AFTER).getSpace();
   
  +        startIndent = pList.get(Constants.PR_START_INDENT).getLength();
  +        endIndent = pList.get(Constants.PR_END_INDENT).getLength();
  +    }
   }
  
  
  
  1.3       +40 -9     xml-fop/src/java/org/apache/fop/fo/properties/CommonRelativePosition.java
  
  Index: CommonRelativePosition.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonRelativePosition.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CommonRelativePosition.java	27 Feb 2004 17:45:44 -0000	1.2
  +++ CommonRelativePosition.java	20 Oct 2004 11:50:04 -0000	1.3
  @@ -18,20 +18,51 @@
   
   package org.apache.fop.fo.properties;
   
  +import org.apache.fop.datatypes.Length;
  +import org.apache.fop.fo.Constants;
  +import org.apache.fop.fo.PropertyList;
  +
   /**
    * Store all common relative position properties.
    * See Sec 7.12 of the XSL-FO Standard.
    * Public "structure" allows direct member access.
    */
   public class CommonRelativePosition {
  +    /**
  +     * The "relative-position" property.
  +     */
  +    public int relativePosition;
  +    
  +    /**
  +     * The "top" property.
  +     */
  +    public Length top;
  +
  +    /**
  +     * The "right" property.
  +     */
  +    public Length right;
  +    
  +    /**
  +     * The "bottom" property.
  +     */
  +    public Length bottom;
  +    
  +    /**
  +     * The "left" property.
  +     */
  +    public Length left;
   
  -    public int marginTop;
  -    public int marginBottom;
  -    public int marginLeft;
  -    public int marginRight;
  -    public int spaceBefore;
  -    public int spaceAfter;
  -    public int startIndent;
  -    public int endIndent;
  +    /**
  +     * Create a CommonRelativePosition object.
  +     * @param pList The PropertyList with propery values.
  +     */
  +    public CommonRelativePosition(PropertyList pList) {
  +        relativePosition = pList.get(Constants.PR_RELATIVE_POSITION).getEnum();
  +        top = pList.get(Constants.PR_TOP).getLength();
  +        bottom = pList.get(Constants.PR_BOTTOM).getLength();
  +        left = pList.get(Constants.PR_LEFT).getLength();
  +        right = pList.get(Constants.PR_RIGHT).getLength();      
  +    }
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org