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 gm...@apache.org on 2005/06/02 00:41:17 UTC
cvs commit: xml-fop/src/java/org/apache/fop/fo/pagination PageSequence.java
gmazza 2005/06/01 15:41:17
Modified: src/java/org/apache/fop/layoutmgr
PageSequenceLayoutManager.java
LayoutManagerMapping.java LayoutManagerMaker.java
FlowLayoutManager.java
src/java/org/apache/fop/fo/pagination PageSequence.java
Log:
Constructor for FLM now takes parent as parameter,
also setting of Reference Area dimensions moved to
FLM.
Revision Changes Path
1.61 +3 -11 xml-fop/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
Index: PageSequenceLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- PageSequenceLayoutManager.java 1 Jun 2005 04:22:18 -0000 1.60
+++ PageSequenceLayoutManager.java 1 Jun 2005 22:41:17 -0000 1.61
@@ -28,8 +28,6 @@
import org.apache.fop.area.LineArea;
import org.apache.fop.area.Resolvable;
-import org.apache.fop.datatypes.PercentBase;
-
import org.apache.fop.fo.Constants;
import org.apache.fop.fo.flow.Marker;
import org.apache.fop.fo.flow.RetrieveMarker;
@@ -131,9 +129,8 @@
curPV = makeNewPage(false, true, false);
Flow mainFlow = pageSeq.getMainFlow();
- childFLM = (FlowLayoutManager)
- getLayoutManagerMaker().makeLayoutManager(mainFlow);
- childFLM.setParent(this);
+ childFLM = getLayoutManagerMaker().
+ makeFlowLayoutManager(this, mainFlow);
PageBreaker breaker = new PageBreaker(this);
int flowBPD = (int) curPV.getBodyRegion().getBPD();
@@ -325,11 +322,6 @@
LayoutContext childLC = new LayoutContext(0);
childLC.setStackLimit(context.getStackLimit());
childLC.setRefIPD(context.getRefIPD());
-
- int flowIPD = curPV.getCurrentSpan().getColumnWidth();
- int flowBPD = (int) curPV.getBodyRegion().getBPD();
- pageSeq.setLayoutDimension(PercentBase.REFERENCE_AREA_IPD, flowIPD);
- pageSeq.setLayoutDimension(PercentBase.REFERENCE_AREA_BPD, flowBPD);
returnedList = childFLM.getNextKnuthElements(childLC, alignment);
if (returnedList != null) {
1.12 +11 -10 xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java
Index: LayoutManagerMapping.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- LayoutManagerMapping.java 18 May 2005 06:35:39 -0000 1.11
+++ LayoutManagerMapping.java 1 Jun 2005 22:41:17 -0000 1.12
@@ -114,7 +114,6 @@
makers.put(TableCell.class, new Maker());
makers.put(TableFooter.class, new Maker());
makers.put(TableHeader.class, new Maker());
- makers.put(Flow.class, new FlowLayoutManagerMaker());
makers.put(Wrapper.class, new WrapperLayoutManagerMaker());
makers.put(Title.class, new InlineLayoutManagerMaker());
}
@@ -155,7 +154,15 @@
}
/*
- * @see org.apache.fop.layoutmgr.LayoutManagerMaker#makeStaticContentLayoutManager(org.apache.fop.layoutmgr.PageSequenceLayoutManager, org.apache.fop.fo.pagination.StaticContent, org.apache.fop.fo.pagination.Region)
+ * @see org.apache.fop.layoutmgr.LayoutManagerMaker#makeFlowLayoutManager(PageSequenceLayoutManager, Flow)
+ */
+ public FlowLayoutManager makeFlowLayoutManager(
+ PageSequenceLayoutManager pslm, Flow flow) {
+ return new FlowLayoutManager(pslm, flow);
+ }
+
+ /*
+ * @see org.apache.fop.layoutmgr.LayoutManagerMaker#makeStaticContentLayoutManager(PageSequenceLayoutManager, StaticContent, Region)
*/
public StaticContentLayoutManager makeStaticContentLayoutManager(
PageSequenceLayoutManager pslm, StaticContent sc, SideRegion reg) {
@@ -163,7 +170,7 @@
}
/*
- * @see org.apache.fop.layoutmgr.LayoutManagerMaker#makeStaticContentLayoutManager(org.apache.fop.layoutmgr.PageSequenceLayoutManager, org.apache.fop.fo.pagination.StaticContent, org.apache.fop.area.Block)
+ * @see org.apache.fop.layoutmgr.LayoutManagerMaker#makeStaticContentLayoutManager(PageSequenceLayoutManager, StaticContent, Block)
*/
public StaticContentLayoutManager makeStaticContentLayoutManager(
PageSequenceLayoutManager pslm, StaticContent sc, org.apache.fop.area.Block block) {
@@ -323,12 +330,6 @@
}
}
- public static class FlowLayoutManagerMaker extends Maker {
- public void make(FONode node, List lms) {
- lms.add(new FlowLayoutManager((Flow) node));
- }
- }
-
public class WrapperLayoutManagerMaker extends Maker {
public void make(FONode node, List lms) {
Iterator baseIter;
1.6 +11 -1 xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java
Index: LayoutManagerMaker.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- LayoutManagerMaker.java 17 May 2005 14:30:33 -0000 1.5
+++ LayoutManagerMaker.java 1 Jun 2005 22:41:17 -0000 1.6
@@ -19,6 +19,7 @@
import java.util.List;
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.pagination.Flow;
import org.apache.fop.fo.pagination.PageSequence;
import org.apache.fop.fo.pagination.SideRegion;
import org.apache.fop.fo.pagination.StaticContent;
@@ -58,6 +59,15 @@
AreaTreeHandler ath, PageSequence ps);
/**
+ * Make a FlowLayoutManager object.
+ * @param pslm the parent PageSequenceLayoutManager object
+ * @param flow the fo:flow object this FLM will process
+ * @return The created FlowLayoutManager object
+ */
+ public FlowLayoutManager makeFlowLayoutManager(
+ PageSequenceLayoutManager pslm, Flow flow);
+
+ /**
* Make a StaticContentLayoutManager object.
* @param pslm the parent PageSequenceLayoutManager object
* @param sc the fo:static-content object this SCLM will process
1.19 +8 -1 xml-fop/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
Index: FlowLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- FlowLayoutManager.java 30 May 2005 09:11:09 -0000 1.18
+++ FlowLayoutManager.java 1 Jun 2005 22:41:17 -0000 1.19
@@ -50,16 +50,23 @@
/**
* This is the top level layout manager.
* It is created by the PageSequence FO.
+ * @param pslm parent PageSequenceLayoutManager object
* @param node Flow object
*/
- public FlowLayoutManager(Flow node) {
+ public FlowLayoutManager(PageSequenceLayoutManager pslm, Flow node) {
super(node);
fobj = node;
+ setParent(pslm);
}
/** @see org.apache.fop.layoutmgr.LayoutManager */
public LinkedList getNextKnuthElements(LayoutContext context, int alignment) {
+
// set layout dimensions
+ int flowIPD = getCurrentPV().getCurrentSpan().getColumnWidth();
+ int flowBPD = (int) getCurrentPV().getBodyRegion().getBPD();
+ fobj.setLayoutDimension(PercentBase.REFERENCE_AREA_IPD, flowIPD);
+ fobj.setLayoutDimension(PercentBase.REFERENCE_AREA_BPD, flowBPD);
fobj.setLayoutDimension(PercentBase.BLOCK_IPD, context.getRefIPD());
fobj.setLayoutDimension(PercentBase.BLOCK_BPD, context.getStackLimit().opt);
1.60 +0 -1 xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java
Index: PageSequence.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- PageSequence.java 10 Mar 2005 23:32:44 -0000 1.59
+++ PageSequence.java 1 Jun 2005 22:41:17 -0000 1.60
@@ -200,7 +200,6 @@
} else if (childId == FO_FLOW) {
this.mainFlow = (Flow) child;
addFlow(mainFlow);
- super.addChildNode(child); // For getChildren
} else if (childId == FO_STATIC_CONTENT) {
addFlow((StaticContent) child);
String flowName = ((StaticContent) child).getFlowName();
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org