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 je...@apache.org on 2005/06/29 14:59:32 UTC
svn commit: r202364 - in
/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr:
FlowLayoutManager.java LayoutContext.java
Author: jeremias
Date: Wed Jun 29 05:59:31 2005
New Revision: 202364
URL: http://svn.apache.org/viewcvs?rev=202364&view=rev
Log:
Span change detection and infastructure for signalling it.
Modified:
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/LayoutContext.java
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java?rev=202364&r1=202363&r2=202364&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java Wed Jun 29 05:59:31 2005
@@ -41,11 +41,7 @@
/** Array of areas currently being filled stored by area class */
private BlockParent[] currentAreas = new BlockParent[Area.CLASS_MAX];
- /**
- * Used to count the number of subsequent times to layout child areas on
- * multiple pages.
- */
- private int numSubsequentOverflows = 0;
+ private int currentSpan = EN_NONE;
/**
* This is the top level layout manager.
@@ -72,8 +68,6 @@
// currently active LM
BlockLevelLayoutManager curLM;
- BlockLevelLayoutManager prevLM = null;
- //MinOptMax stackSize = new MinOptMax();
LinkedList returnedList;
LinkedList returnList = new LinkedList();
@@ -84,6 +78,19 @@
continue;
}
+ int span = EN_NONE;
+ if (curLM instanceof BlockLayoutManager) {
+ span = ((BlockLayoutManager)curLM).getBlockFO().getSpan();
+ } else if (curLM instanceof BlockContainerLayoutManager) {
+ span = ((BlockContainerLayoutManager)curLM).getBlockContainerFO().getSpan();
+ }
+ if (currentSpan != span) {
+ log.debug("span change from " + currentSpan + " to " + span);
+ context.signalSpanChange(span);
+ currentSpan = span;
+ return returnList;
+ }
+
// Set up a LayoutContext
//MinOptMax bpd = context.getStackLimit();
@@ -142,7 +149,6 @@
childLC.setFlags(LayoutContext.KEEP_WITH_NEXT_PENDING, false);
context.setFlags(LayoutContext.KEEP_WITH_NEXT_PENDING);
}
- prevLM = curLM;
}
setFinished(true);
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/LayoutContext.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/LayoutContext.java?rev=202364&r1=202363&r2=202364&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/LayoutContext.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/LayoutContext.java Wed Jun 29 05:59:31 2005
@@ -18,6 +18,7 @@
package org.apache.fop.layoutmgr;
+import org.apache.fop.fo.Constants;
import org.apache.fop.traits.MinOptMax;
@@ -74,8 +75,8 @@
*/
MinOptMax stackLimit;
- /** True if current top-level reference area is spanning. */
- boolean bIsSpan;
+ /** True if current element list is spanning in multi-column layout. */
+ private int nextSpan = Constants.NOT_SET;
/** inline-progression-dimension of nearest ancestor reference area */
int refIPD;
@@ -294,6 +295,29 @@
iSpaceAfter = sp;
}
+ /**
+ * @return true if the current element list ends early because of a span change
+ * in multi-column layout.
+ */
+ public int getNextSpan() {
+ return nextSpan;
+ }
+
+ /**
+ * Used to signal the PSLM that the element list ends early because of a span change in
+ * multi-column layout.
+ * @param span the new span value (legal values: NOT_SET, EN_NONE, EN_ALL)
+ */
+ public void signalSpanChange(int span) {
+ if (span == Constants.NOT_SET || span == Constants.EN_NONE || span == Constants.EN_ALL) {
+ this.nextSpan = span;
+ } else {
+ throw new IllegalArgumentException("Illegal value on signalSpanChange() for span: "
+ + span);
+ }
+ }
+
+ /** @see java.lang.Object#toString() */
public String toString() {
return "Layout Context:" +
"\nStack Limit: \t" + (getStackLimit() == null ? "null" : getStackLimit().toString()) +
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org