cvs commit: xml-fop/src/java/org/apache/fop/fo FOPropertyMapping.java PropertyManager.java

2004-08-13 Thread bckfnn
bckfnn  2004/08/13 02:05:15

  Modified:src/java/org/apache/fop/fo/properties
CompoundPropertyMaker.java
   src/java/org/apache/fop/fo FOPropertyMapping.java
PropertyManager.java
  Added:   src/java/org/apache/fop/fo/properties
SpacingPropertyMaker.java
  Log:
  Support for [letter|word]-spacing properties with a value of 'normal'.
  The value returned will be an Constants.NORMAL enum.
  
  Revision  ChangesPath
  1.6   +12 -4 
xml-fop/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java
  
  Index: CompoundPropertyMaker.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CompoundPropertyMaker.java18 Jun 2004 17:58:35 -  1.5
  +++ CompoundPropertyMaker.java13 Aug 2004 09:05:15 -  1.6
  @@ -122,10 +122,14 @@
* input value
*/
   protected Property checkEnumValues(String value) {
  +Property result = null;
   if (shorthandMaker != null) {
  -return shorthandMaker.checkEnumValues(value);
  +result = shorthandMaker.checkEnumValues(value);
   }
  -return null;
  +if (result == null) {
  +result = super.checkEnumValues(value);
  +}
  +return result;
   }
   
   /**
  @@ -190,7 +194,11 @@
* @throws FOPException for invalid or inconsisten FO input
*/
   public Property make(PropertyList propertyList) throws FOPException {
  -return makeCompound(propertyList, propertyList.getParentFObj());   
  +if (defaultValue != null) {
  +return make(propertyList, defaultValue, propertyList.getParentFObj());
  +} else {
  +return makeCompound(propertyList, propertyList.getParentFObj());
  +}
   }
   
   /**
  
  
  
  1.1  
xml-fop/src/java/org/apache/fop/fo/properties/SpacingPropertyMaker.java
  
  Index: SpacingPropertyMaker.java
  ===
  /*
   * Copyright 1999-2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the License);
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *  http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an AS IS BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  /* $Id: SpacingPropertyMaker.java,v 1.1 2004/08/13 09:05:15 bckfnn Exp $ */
  
  package org.apache.fop.fo.properties;
  
  import org.apache.fop.apps.FOPException;
  import org.apache.fop.fo.Constants;
  import org.apache.fop.fo.FObj;
  import org.apache.fop.fo.PropertyList;
  
  /**
   * A maker which creates 'letter-spacing' and 'word-spacing' properties.
   * These two properties properties are standard space properties with 
   * additinal support for the 'normal' enum value.
   */
  
  public class SpacingPropertyMaker extends SpaceProperty.Maker {
  /**
   * Create a maker for [letter|word]-spacing.
   * @param propId the id for property.
   */
  public SpacingPropertyMaker(int propId) {
  super(propId);
  }
  
  /**
   * Support for the 'normal' value.
   */
  public Property convertProperty(Property p, 
 PropertyList propertyList,
 FObj fo) throws FOPException {
  if (p.getEnum() == Constants.NORMAL) {
  return p;
  }
  return super.convertProperty(p, propertyList, fo);
  }
  }
  
  
  
  1.13  +10 -4 xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java
  
  Index: FOPropertyMapping.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- FOPropertyMapping.java27 Feb 2004 17:57:40 -  1.12
  +++ FOPropertyMapping.java13 Aug 2004 09:05:15 -  1.13
  @@ -40,6 +40,7 @@
   import org.apache.fop.fo.properties.Property;
   import org.apache.fop.fo.properties.PropertyMaker;
   import org.apache.fop.fo.properties.SpaceProperty;
  +import org.apache.fop.fo.properties.SpacingPropertyMaker;
   import org.apache.fop.fo.properties.StringProperty;
   import org.apache.fop.fo.properties.ToBeImplementedProperty;
   
  @@ -1586,9 +1587,13 @@
   

cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr CharacterLayoutManager.java AddLMVisitor.java

2004-08-13 Thread gmazza
gmazza  2004/08/13 05:29:51

  Modified:src/java/org/apache/fop/fo FObj.java
   src/java/org/apache/fop/fo/flow Character.java
FootnoteBody.java
   src/java/org/apache/fop/layoutmgr AddLMVisitor.java
  Added:   src/java/org/apache/fop/layoutmgr
CharacterLayoutManager.java
  Log:
  1. Character LM initialization moved from AllLMVisitor to fo.Character.
  
  2. Character layout logic moved from AllLMVisitor to new CharacterLayoutManager.
  
  3. validateChildNode() implemented for fo:footnote-body.
  
  Revision  ChangesPath
  1.66  +11 -9 xml-fop/src/java/org/apache/fop/fo/FObj.java
  
  Index: FObj.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FObj.java,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- FObj.java 11 Aug 2004 04:15:25 -  1.65
  +++ FObj.java 13 Aug 2004 12:29:51 -  1.66
  @@ -79,10 +79,12 @@
   if (parent != null  parent instanceof FObj) {
   if (((FObj)parent).getIsOutOfLineFODescendant() == true) {
   isOutOfLineFODescendant = true;
  -} else if (fo:float.equals(getName())
  -|| fo:footnote.equals(getName())
  -|| fo:footnote-body.equals(getName())) {
  -isOutOfLineFODescendant = true;
  +} else {
  +int foID = getNameId();
  +if (foID == FO_FLOAT || foID == FO_FOOTNOTE
  +|| foID == FO_FOOTNOTE_BODY) {
  +isOutOfLineFODescendant = true;
  +}
   }
   }
   
  @@ -114,10 +116,10 @@
   PropertyList parentPL = null;
   
   if (parentFO != null) {
  -parentPL = parentFO.getPropertiesForNamespace(FOElementMapping.URI);
  +parentPL = parentFO.getPropertiesForNamespace(FO_URI);
   }
   
  -propertyList = new PropertyList(this, parentPL, FOElementMapping.URI);
  +propertyList = new PropertyList(this, parentPL, FO_URI);
   propertyList.addAttributesToList(attlist);
   propMgr = new PropertyManager(propertyList);
   setWritingMode();
  @@ -457,7 +459,7 @@
* @return true if a member, false if not
*/
   protected boolean isBlockItem(String nsURI, String lName) {
  -return (nsURI == FOElementMapping.URI  
  +return (nsURI == FO_URI  
   (lName.equals(block) 
   || lName.equals(table) 
   || lName.equals(table-and-caption) 
  @@ -476,7 +478,7 @@
* @return true if a member, false if not
*/
   protected boolean isInlineItem(String nsURI, String lName) {
  -return (nsURI == FOElementMapping.URI  
  +return (nsURI == FO_URI  
   (lName.equals(bidi-override) 
   || lName.equals(character) 
   || lName.equals(external-graphic) 
  @@ -513,7 +515,7 @@
* @return true if a member, false if not
*/
   protected boolean isNeutralItem(String nsURI, String lName) {
  -return (nsURI == FOElementMapping.URI  
  +return (nsURI == FO_URI  
   (lName.equals(multi-switch) 
   || lName.equals(multi-properties)
   || lName.equals(wrapper) 
  
  
  
  1.17  +12 -8 xml-fop/src/java/org/apache/fop/fo/flow/Character.java
  
  Index: Character.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Character.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Character.java11 Aug 2004 04:15:25 -  1.16
  +++ Character.java13 Aug 2004 12:29:51 -  1.17
  @@ -18,6 +18,9 @@
   
   package org.apache.fop.fo.flow;
   
  +// Java
  +import java.util.List;
  +
   // XML
   import org.xml.sax.Attributes;
   import org.xml.sax.Locator;
  @@ -28,8 +31,7 @@
   import org.apache.fop.fo.FONode;
   import org.apache.fop.fo.FObj;
   import org.apache.fop.fo.OneCharIterator;
  -import org.apache.fop.layoutmgr.AddLMVisitor;
  -import org.apache.fop.fo.LMVisited;
  +import org.apache.fop.layoutmgr.CharacterLayoutManager;
   
   /**
* This class represents the flow object 'fo:character'. Its use is defined by
  @@ -44,7 +46,7 @@
* Overrides may be specified in an implementation-specific manner. (6.6.3)
*
*/
  -public class Character extends FObj implements LMVisited {
  +public class Character extends FObj {
   
   /** constant indicating that the character is OK */
   public static final int OK = 0;
  @@ -78,12 +80,14 @@
   }
   
   /**
  - * This is a hook for the AddLMVisitor class to be able to access
  - * this object.
  - * @param aLMV the AddLMVisitor object that can access this object.
  + * @see