Author: adelmelle
Date: Fri Apr 25 01:59:56 2008
New Revision: 651543

URL: http://svn.apache.org/viewvc?rev=651543&view=rev
Log:
Removed TODO: New validation event to generate an error in case an fo:marker 
appears as a child of an fo:block-container with absolutely positioned areas.
Additionally: some javadoc updates in BlockContainer.java

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/events/EventFormatter.xml
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/BlockContainer.java

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/events/EventFormatter.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/events/EventFormatter.xml?rev=651543&r1=651542&r2=651543&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/events/EventFormatter.xml 
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/events/EventFormatter.xml Fri 
Apr 25 01:59:56 2008
@@ -33,6 +33,7 @@
   <message 
key="org.apache.fop.fo.FOValidationEventProducer.missingProperty">Element 
"{elementName}" is missing required property 
"{propertyName}"!{{locator}}</message>
   <message 
key="org.apache.fop.fo.FOValidationEventProducer.idNotUnique">Property ID 
"{id}" (found on "{elementName}") previously used; ID values must be unique 
within a document!{severity,equals,EventSeverity:FATAL,,
 Any reference to it will be considered a reference to the first occurrence in 
the document.}{{locator}}</message>
+  <message 
key="org.apache.fop.fo.FOValidationEventProducer.markerBlockContainerAbsolutePosition">Only
 an fo:block-container that does not generate absolutely positioned areas may 
have one or more fo:markers as its initial children.{{locator}}</message>
   <message 
key="org.apache.fop.fo.FOValidationEventProducer.markerNotInitialChild">fo:marker
 must be an initial child: {mcname}{{locator}}</message>
   <message 
key="org.apache.fop.fo.FOValidationEventProducer.markerNotUniqueForSameParent">fo:marker
 "marker-class-name" must be unique for same parent: 
{mcname}{{locator}}</message>
   <message 
key="org.apache.fop.fo.FOValidationEventProducer.invalidProperty">Invalid 
property encountered on "{elementName}": {attr}{{locator}}</message>

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.java?rev=651543&r1=651542&r2=651543&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.java 
(original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOValidationEventProducer.java 
Fri Apr 25 01:59:56 2008
@@ -150,6 +150,15 @@
             Locator loc) throws ValidationException;
 
     /**
+     * An fo:marker appears as initial descendant in an fo:block-container
+     * that generates absolutely positioned areas
+     * @param source    the event source
+     * @param loc       the location of the error (possibly null)
+     * @event.severity ERROR
+     */
+    void markerBlockContainerAbsolutePosition(Object source, Locator loc);
+
+    /**
      * A marker is not an initial child on a node.
      * @param source the event source
      * @param elementName the name of the context node

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/BlockContainer.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/BlockContainer.java?rev=651543&r1=651542&r2=651543&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/BlockContainer.java 
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/BlockContainer.java 
Fri Apr 25 01:59:56 2008
@@ -35,7 +35,8 @@
 import org.apache.fop.fo.properties.LengthRangeProperty;
 
 /**
- * Class modelling the fo:block-container object.
+ * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_block-container";>
+ * <code>fo:block-container</code></a> object.
  */
 public class BlockContainer extends FObj {
     // The value of properties relevant for fo:block-container.
@@ -66,15 +67,16 @@
     private boolean blockItemFound = false;
 
     /**
-     * @param parent FONode that is the parent of this object
+     * Creates a new BlockContainer instance as a child of
+     * the given [EMAIL PROTECTED] FONode}.
+     * 
+     * @param parent [EMAIL PROTECTED] FONode} that is the parent of this 
object
      */
     public BlockContainer(FONode parent) {
         super(parent);
     }
 
-    /**
-     * [EMAIL PROTECTED]
-     */
+    /** [EMAIL PROTECTED] */
     public void bind(PropertyList pList) throws FOPException {
         super.bind(pList);
         commonAbsolutePosition = pList.getAbsolutePositionProps();
@@ -97,9 +99,7 @@
         writingMode = pList.get(PR_WRITING_MODE).getEnum();
     }
 
-    /**
-     * [EMAIL PROTECTED]
-     */
+    /** [EMAIL PROTECTED] */
     protected void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startBlockContainer(this);
@@ -107,30 +107,34 @@
 
     /**
      * [EMAIL PROTECTED]
-     * XSL Content Model: marker* (%block;)+
-     * But: "In addition an fo:block-container that does not generate an 
+     * <br>XSL Content Model: marker* (%block;)+
+     * <br><i><b>BUT</b>: "In addition an fo:block-container that does not 
generate an 
      * absolutely positioned area may have a sequence of zero or more 
      * fo:markers as its initial children."
-     * @todo - implement above restriction if possible
+     * The latter refers to block-containers with absolute-position="absolute"
+     * or absolute-position="fixed".
      */
     protected void validateChildNode(Locator loc, String nsURI, String 
localName) 
-                throws ValidationException {
+        throws ValidationException {
         if (FO_URI.equals(nsURI)) {
-            if (localName.equals("marker")) {
+            if ("marker".equals(localName)) {
+                if (commonAbsolutePosition.absolutePosition == EN_ABSOLUTE
+                        || commonAbsolutePosition.absolutePosition == 
EN_FIXED) {
+                    getFOValidationEventProducer()
+                            .markerBlockContainerAbsolutePosition(this, 
locator);
+                }
                 if (blockItemFound) {
                    nodesOutOfOrderError(loc, "fo:marker", "(%block;)");
                 }
-            } else if (!isBlockItem(nsURI, localName)) {
-                invalidChildError(loc, nsURI, localName);
+            } else if (!isBlockItem(FO_URI, localName)) {
+                invalidChildError(loc, FO_URI, localName);
             } else {
                 blockItemFound = true;
             }
         }
     }
 
-    /**
-     * [EMAIL PROTECTED]
-     */
+    /** [EMAIL PROTECTED] */
     protected void endOfNode() throws FOPException {
         if (!blockItemFound) {
             missingChildElementError("marker* (%block;)+");
@@ -139,30 +143,22 @@
         getFOEventHandler().endBlockContainer(this);
     }
 
-    /**
-     * @return true (BlockContainer can generate Reference Areas)
-     */
+    /** @return <code>true</code> (BlockContainer can generate Reference 
Areas) */
     public boolean generatesReferenceAreas() {
         return true;
     }
 
-    /**
-     * @return the Common Absolute Position Properties.
-     */
+    /** @return the [EMAIL PROTECTED] CommonAbsolutePosition} */
     public CommonAbsolutePosition getCommonAbsolutePosition() {
         return commonAbsolutePosition;
     }
     
-    /**
-     * @return the Common Margin Properties-Block.
-     */
+    /** @return the [EMAIL PROTECTED] CommonMarginBlock} */
     public CommonMarginBlock getCommonMarginBlock() {
         return commonMarginBlock;
     }
 
-    /**
-     * @return the Common Border, Padding, and Background Properties.
-     */
+    /** @return the [EMAIL PROTECTED] CommonBorderPaddingBackground} */
     public CommonBorderPaddingBackground getCommonBorderPaddingBackground() {
         return commonBorderPaddingBackground;
     }
@@ -174,7 +170,7 @@
         return blockProgressionDimension;
     }
 
-    /** @return the display-align property. */
+    /** @return the "display-align" property. */
     public int getDisplayAlign() {
         return displayAlign;
     }
@@ -204,51 +200,37 @@
         return keepTogether;
     }
 
-    /**
-     * @return the "inline-progression-dimension" property.
-     */
+    /** @return the "inline-progression-dimension" property */
     public LengthRangeProperty getInlineProgressionDimension() {
         return inlineProgressionDimension;
     }
 
-    /**
-     * @return the "overflow" property.
-     */
+    /** @return the "overflow" property */
     public int getOverflow() {
         return overflow;
     }
 
-    /**
-     * @return the "reference-orientation" property.
-     */
+    /** @return the "reference-orientation" property */
     public int getReferenceOrientation() {
         return referenceOrientation.getValue();
     }
 
-    /**
-     * @return the "span" property.
-     */
+    /** @return the "span" property */
     public int getSpan() {
         return this.span;
     }
 
-    /**
-     * @return the "writing-mode" property.
-     */
+    /** @return the "writing-mode" property */
     public int getWritingMode() {
         return writingMode;
     }
     
-    /**
-     * @return the width property
-     */
+    /** @return the "width" property */
     public Length getWidth() {
         return width;
     }
 
-    /**
-     * @return the height property
-     */
+    /** @return the "height" property */
     public Length getHeight() {
         return height;
     }
@@ -260,6 +242,7 @@
     
     /**
      * [EMAIL PROTECTED]
+     * @return [EMAIL PROTECTED] 
org.apache.fop.fo.Constants#FO_BLOCK_CONTAINER}
      */
     public int getNameId() {
         return FO_BLOCK_CONTAINER;



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

Reply via email to