xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vhenneb...@apache.org
Subject svn commit: r796350 - in /xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr: AbstractBaseLayoutManager.java BlockLayoutManager.java BlockStackingLayoutManager.java FlowLayoutManager.java LayoutManager.java
Date Tue, 21 Jul 2009 15:31:57 GMT
Author: vhennebert
Date: Tue Jul 21 15:31:56 2009
New Revision: 796350

URL: http://svn.apache.org/viewvc?rev=796350&view=rev
Log:
Moved the IPD-change-related getNextKnuthElements method to the LayoutManager interface.

Modified:
    xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java
    xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
    xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
    xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
    xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/LayoutManager.java

Modified: xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java?rev=796350&r1=796349&r2=796350&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java
(original)
+++ xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java
Tue Jul 21 15:31:56 2009
@@ -19,6 +19,9 @@
 
 package org.apache.fop.layoutmgr;
 
+import java.util.List;
+import java.util.Stack;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -264,4 +267,10 @@
         return false;
     }
 
+    /** {@inheritDoc} */
+    public List getNextKnuthElements(LayoutContext context, int alignment, Stack lmStack,
+            Position positionAtIPDChange, LayoutManager restartAtLM) {
+        throw new UnsupportedOperationException("Not implemented");
+    }
+
 }

Modified: xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java?rev=796350&r1=796349&r2=796350&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
(original)
+++ xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
Tue Jul 21 15:31:56 2009
@@ -116,7 +116,7 @@
     }
 
     /** {@inheritDoc} */
-    List getNextKnuthElements(LayoutContext context, int alignment, Stack lmStack,
+    public List getNextKnuthElements(LayoutContext context, int alignment, Stack lmStack,
             Position restartPosition, LayoutManager restartAtLM) {
         resetSpaces();
         if (lmStack == null) {

Modified: xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java?rev=796350&r1=796349&r2=796350&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
(original)
+++ xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
Tue Jul 21 15:31:56 2009
@@ -358,7 +358,7 @@
     }
 
     /** {@inheritDoc} */
-    List getNextKnuthElements(LayoutContext context, int alignment, Stack lmStack,
+    public List getNextKnuthElements(LayoutContext context, int alignment, Stack lmStack,
             Position restartPosition, LayoutManager restartAtLM) {
         referenceIPD = context.getRefIPD();
         updateContentAreaIPDwithOverconstrainedAdjust();

Modified: xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java?rev=796350&r1=796349&r2=796350&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
(original)
+++ xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
Tue Jul 21 15:31:56 2009
@@ -104,13 +104,9 @@
                 currentChildLM = currentChildLM.getParent();
             }
             setCurrentChildLM(currentChildLM);
-            if (!(currentChildLM instanceof BlockLayoutManager)) {
-                throw new UnsupportedOperationException("TODO: layout manager not restartable");
-            } else {
-                if (addChildElements(elements, currentChildLM, context, alignment, lmStack,
-                        positionAtIPDChange, restartAtLM) != null) {
-                    return elements;
-                }
+            if (addChildElements(elements, currentChildLM, context, alignment, lmStack,
+                    positionAtIPDChange, restartAtLM) != null) {
+                return elements;
             }
         }
 
@@ -192,7 +188,8 @@
     }
 
     private List getNextChildElements(LayoutManager childLM, LayoutContext context,
-            LayoutContext childLC, int alignment, Stack lmStack, Position restartPosition,
LayoutManager restartLM) {
+            LayoutContext childLC, int alignment, Stack lmStack, Position restartPosition,
+            LayoutManager restartLM) {
         childLC.setStackLimitBP(context.getStackLimitBP());
         childLC.setRefIPD(context.getRefIPD());
         childLC.setWritingMode(getCurrentPage().getSimplePageMaster().getWritingMode());
@@ -201,7 +198,7 @@
         if (lmStack == null) {
             childrenElements = childLM.getNextKnuthElements(childLC, alignment);
         } else {
-            childrenElements = ((BlockLayoutManager) childLM).getNextKnuthElements(childLC,
+            childrenElements = childLM.getNextKnuthElements(childLC,
                     alignment, lmStack, restartPosition, restartLM);
         }
         assert !childrenElements.isEmpty();

Modified: xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/LayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/LayoutManager.java?rev=796350&r1=796349&r2=796350&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/LayoutManager.java
(original)
+++ xmlgraphics/fop/branches/Temp_ChangingIPDHack/src/java/org/apache/fop/layoutmgr/LayoutManager.java
Tue Jul 21 15:31:56 2009
@@ -20,6 +20,7 @@
 package org.apache.fop.layoutmgr;
 
 import java.util.List;
+import java.util.Stack;
 
 import org.apache.fop.area.Area;
 import org.apache.fop.datatypes.PercentBaseContext;
@@ -234,4 +235,21 @@
      * change
      */
     boolean isRestartable();
+
+    /**
+     * Returns an updated list of Knuth elements corresponding to this layout
+     * manager, after a change of IPD has been detected.
+     *
+     * @param context the layout context
+     * @param alignment the alignment
+     * @param lmStack the stack of LMs that are active at the IPD change
+     * @param positionAtIPDChange the position corresponding to the element
+     * finishing the page before the IPD change
+     * @param restartAtLM if not null, the layout manager from which to restart.
+     * That is, the IPD change occurs between two block elements and not inside
+     * a paragraph
+     * @return an updated list of elements, taking the new IPD into account
+     */
+    List getNextKnuthElements(LayoutContext context, int alignment, Stack lmStack,
+            Position positionAtIPDChange, LayoutManager restartAtLM);
 }



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


Mime
View raw message