pbwest      2002/11/13 15:22:16

  Modified:    src/org/apache/fop/fo/flow Tag: FOP_0-20-0_Alt-Design
                        FoBidiOverride.java FoBlock.java
                        FoBlockContainer.java
  Log:
  Generate children according to content model.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.5   +35 -7     xml-fop/src/org/apache/fop/fo/flow/Attic/FoBidiOverride.java
  
  Index: FoBidiOverride.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Attic/FoBidiOverride.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- FoBidiOverride.java       13 Nov 2002 04:13:04 -0000      1.1.2.4
  +++ FoBidiOverride.java       13 Nov 2002 23:22:06 -0000      1.1.2.5
  @@ -15,12 +15,15 @@
   import org.apache.fop.fo.FObjectNames;
   import org.apache.fop.fo.FONode;
   import org.apache.fop.fo.FOTree;
  +import org.apache.fop.fo.FObjects;
   import org.apache.fop.fo.expr.PropertyException;
   import org.apache.fop.xml.FoXMLEvent;
  +import org.apache.fop.xml.UnexpectedStartElementException;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.datastructs.TreeException;
   import org.apache.fop.datatypes.PropertyValue;
   import org.apache.fop.datatypes.Ints;
  +import org.apache.fop.messaging.MessageHandler;
   
   import java.util.HashMap;
   import java.util.BitSet;
  @@ -81,20 +84,45 @@
       }
   
       /**
  +     * Construct an fo:bidi-override node, and build the
  +     * fo:bidi-override subtree.
  +     * <p>Content model for fo:bidi-override: (#PCDATA|%inline;|%block;)*
        * @param foTree the FO tree being built
        * @param parent the parent FONode of this node
        * @param event the <tt>FoXMLEvent</tt> that triggered the creation of
        * this node
  -     * @param attrSet the index of the attribute set applying to the node.
  +     * @param stateFlags - passed down from the parent.  Includes the
  +     * attribute set information.
        */
       public FoBidiOverride
  -                (FOTree foTree, FONode parent, FoXMLEvent event, int attrSet)
  +            (FOTree foTree, FONode parent, FoXMLEvent event, int stateFlags)
           throws TreeException, FOPException
       {
           super(foTree, FObjectNames.BIDI_OVERRIDE, parent, event,
  -                          attrSet, sparsePropsMap, sparseIndices);
  -        FoXMLEvent ev;
  -        String nowProcessing;
  +                          stateFlags, sparsePropsMap, sparseIndices);
  +        xmlevents = foTree.getXmlevents();
  +        FoXMLEvent ev = null;
  +        do {
  +            try {
  +                if ((stateFlags & FONode.OUT_OF_LINE) == 0)
  +                    ev = xmlevents.expectPcdataOrInlineOrBlock();
  +                else
  +                    ev = xmlevents.expectOutOfLinePcdataOrInlineOrBlock();
  +                if (ev != null) {
  +                    // Generate the flow object
  +                    FObjects.fobjects.makeFlowObject
  +                                (foTree, this, ev, stateFlags);
  +                    if (ev.getFoType() != FObjectNames.PCDATA)
  +                        ev = xmlevents.getEndElement(ev);
  +                }
  +            } catch(UnexpectedStartElementException e) {
  +                MessageHandler.logln
  +                        ("Ignoring unexpected Start Element: "
  +                                                         + ev.getQName());
  +                ev = xmlevents.getStartElement();
  +                ev = xmlevents.getEndElement(ev);
  +            }
  +        } while (ev != null);
   
           makeSparsePropsSet();
       }
  
  
  
  1.1.2.5   +35 -10    xml-fop/src/org/apache/fop/fo/flow/Attic/FoBlock.java
  
  Index: FoBlock.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Attic/FoBlock.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- FoBlock.java      13 Nov 2002 04:13:04 -0000      1.1.2.4
  +++ FoBlock.java      13 Nov 2002 23:22:06 -0000      1.1.2.5
  @@ -15,12 +15,15 @@
   import org.apache.fop.fo.FObjectNames;
   import org.apache.fop.fo.FONode;
   import org.apache.fop.fo.FOTree;
  +import org.apache.fop.fo.FObjects;
   import org.apache.fop.fo.expr.PropertyException;
   import org.apache.fop.xml.FoXMLEvent;
  +import org.apache.fop.xml.UnexpectedStartElementException;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.datastructs.TreeException;
   import org.apache.fop.datatypes.PropertyValue;
   import org.apache.fop.datatypes.Ints;
  +import org.apache.fop.messaging.MessageHandler;
   
   import java.util.HashMap;
   import java.util.BitSet;
  @@ -50,7 +53,6 @@
   
       static {
           // Collect the sets of properties that apply
  -        System.out.println("In static block of FoBlock.");
           BitSet propsets = new BitSet();
           propsets.or(PropertySets.accessibilitySet);
           propsets.or(PropertySets.auralSet);
  @@ -105,25 +107,48 @@
               sparsePropsMap.put
                           (Ints.consts.get(next), Ints.consts.get(propx++));
           }
  -        System.out.println("End of static block of FoBlock.");
       }
   
       /**
  +     * Construct an fo:block node, and build the fo:block subtree.
  +     * <p>Content model for fo:title: (#PCDATA|%inline;|%block;)*
        * @param foTree the FO tree being built
        * @param parent the parent FONode of this node
        * @param event the <tt>FoXMLEvent</tt> that triggered the creation of
        * this node
  -     * @param attrSet the index of the attribute set applying to the node.
  +     * @param stateFlags - passed down from the parent.  Includes the
  +     * attribute set information.
        */
       public FoBlock
  -                (FOTree foTree, FONode parent, FoXMLEvent event, int attrSet)
  +            (FOTree foTree, FONode parent, FoXMLEvent event, int stateFlags)
           throws TreeException, FOPException
       {
           super(foTree, FObjectNames.BLOCK, parent, event,
  -                          attrSet, sparsePropsMap, sparseIndices);
  -        System.out.println("Back from super constructor of FoBlock.");
  -        FoXMLEvent ev;
  -        String nowProcessing;
  +                          stateFlags, sparsePropsMap, sparseIndices);
  +        xmlevents = foTree.getXmlevents();
  +        FoXMLEvent ev = null;
  +        do {
  +            try {
  +                if ((stateFlags & FONode.OUT_OF_LINE) == 0)
  +                    ev = xmlevents.expectPcdataOrInlineOrBlock();
  +                else
  +                    ev = xmlevents.expectOutOfLinePcdataOrInlineOrBlock();
  +                if (ev != null) {
  +                    // Generate the flow object
  +                    //System.out.println("Generating flow object for " + ev);
  +                    FObjects.fobjects.makeFlowObject
  +                                (foTree, this, ev, stateFlags);
  +                    if (ev.getFoType() != FObjectNames.PCDATA)
  +                        ev = xmlevents.getEndElement(ev);
  +                }
  +            } catch(UnexpectedStartElementException e) {
  +                MessageHandler.logln
  +                        ("Ignoring unexpected Start Element: "
  +                                                         + ev.getQName());
  +                ev = xmlevents.getStartElement();
  +                ev = xmlevents.getEndElement(ev);
  +            }
  +        } while (ev != null);
   
           makeSparsePropsSet();
       }
  
  
  
  1.1.2.5   +35 -7     xml-fop/src/org/apache/fop/fo/flow/Attic/FoBlockContainer.java
  
  Index: FoBlockContainer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Attic/FoBlockContainer.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- FoBlockContainer.java     13 Nov 2002 04:13:04 -0000      1.1.2.4
  +++ FoBlockContainer.java     13 Nov 2002 23:22:06 -0000      1.1.2.5
  @@ -15,12 +15,15 @@
   import org.apache.fop.fo.FObjectNames;
   import org.apache.fop.fo.FONode;
   import org.apache.fop.fo.FOTree;
  +import org.apache.fop.fo.FObjects;
   import org.apache.fop.fo.expr.PropertyException;
   import org.apache.fop.xml.FoXMLEvent;
  +import org.apache.fop.xml.UnexpectedStartElementException;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.datastructs.TreeException;
   import org.apache.fop.datatypes.PropertyValue;
   import org.apache.fop.datatypes.Ints;
  +import org.apache.fop.messaging.MessageHandler;
   
   import java.util.HashMap;
   import java.util.BitSet;
  @@ -93,20 +96,45 @@
       }
   
       /**
  +     * Construct an fo:block-container node, and build the
  +     * fo:block-container subtree.
  +     * <p>Content model for fo:title: (#PCDATA|%inline;|%block;)*
        * @param foTree the FO tree being built
        * @param parent the parent FONode of this node
        * @param event the <tt>FoXMLEvent</tt> that triggered the creation of
        * this node
  -     * @param attrSet the index of the attribute set applying to the node.
  +     * @param stateFlags - passed down from the parent.  Includes the
  +     * attribute set information.
        */
       public FoBlockContainer
  -                (FOTree foTree, FONode parent, FoXMLEvent event, int attrSet)
  +            (FOTree foTree, FONode parent, FoXMLEvent event, int stateFlags)
           throws TreeException, FOPException
       {
           super(foTree, FObjectNames.BLOCK_CONTAINER, parent, event,
  -                          attrSet, sparsePropsMap, sparseIndices);
  -        FoXMLEvent ev;
  -        String nowProcessing;
  +                          stateFlags, sparsePropsMap, sparseIndices);
  +        xmlevents = foTree.getXmlevents();
  +        FoXMLEvent ev = null;
  +        do {
  +            try {
  +                if ((stateFlags & FONode.OUT_OF_LINE) == 0)
  +                    ev = xmlevents.expectPcdataOrInlineOrBlock();
  +                else
  +                    ev = xmlevents.expectOutOfLinePcdataOrInlineOrBlock();
  +                if (ev != null) {
  +                    // Generate the flow object
  +                    FObjects.fobjects.makeFlowObject
  +                                (foTree, this, ev, stateFlags);
  +                    if (ev.getFoType() != FObjectNames.PCDATA)
  +                        ev = xmlevents.getEndElement(ev);
  +                }
  +            } catch(UnexpectedStartElementException e) {
  +                MessageHandler.logln
  +                        ("Ignoring unexpected Start Element: "
  +                                                         + ev.getQName());
  +                ev = xmlevents.getStartElement();
  +                ev = xmlevents.getEndElement(ev);
  +            }
  +        } while (ev != null);
   
           makeSparsePropsSet();
       }
  
  
  

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

Reply via email to