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 ke...@apache.org on 2002/08/19 10:01:57 UTC
cvs commit: xml-fop/src/org/apache/fop/layoutmgr AbstractBPLayoutManager.java AbstractLayoutManager.java BlockStackingLayoutManager.java LayoutManager.java PageLayoutManager.java SplitContext.java
keiron 2002/08/19 01:01:57
Modified: src/org/apache/fop/layoutmgr AbstractBPLayoutManager.java
AbstractLayoutManager.java
BlockStackingLayoutManager.java LayoutManager.java
PageLayoutManager.java
Removed: src/org/apache/fop/layoutmgr SplitContext.java
Log:
removed split context
set ipd for static content
Revision Changes Path
1.7 +4 -2 xml-fop/src/org/apache/fop/layoutmgr/AbstractBPLayoutManager.java
Index: AbstractBPLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/AbstractBPLayoutManager.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- AbstractBPLayoutManager.java 9 Aug 2002 07:11:15 -0000 1.6
+++ AbstractBPLayoutManager.java 19 Aug 2002 08:01:56 -0000 1.7
@@ -100,7 +100,9 @@
}
m_childLMiter.next(); // Otherwise next returns same object
}
- m_curChildLM.resetPosition(pos);
+ if(m_curChildLM != null) {
+ m_curChildLM.resetPosition(pos);
+ }
if (isFinished()) {
setFinished(false);
}
1.9 +1 -6 xml-fop/src/org/apache/fop/layoutmgr/AbstractLayoutManager.java
Index: AbstractLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/AbstractLayoutManager.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- AbstractLayoutManager.java 9 Aug 2002 07:11:15 -0000 1.8
+++ AbstractLayoutManager.java 19 Aug 2002 08:01:56 -0000 1.9
@@ -91,10 +91,5 @@
*/
abstract public boolean addChild(Area childArea);
- /** Do nothing */
- public boolean splitArea(Area areaToSplit, SplitContext context) {
- context.nextArea = areaToSplit;
- return false;
- }
}
1.8 +1 -68 xml-fop/src/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
Index: BlockStackingLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- BlockStackingLayoutManager.java 9 Aug 2002 07:11:15 -0000 1.7
+++ BlockStackingLayoutManager.java 19 Aug 2002 08:01:56 -0000 1.8
@@ -30,72 +30,6 @@
super(fobj);
}
- public boolean splitArea(Area area, SplitContext splitContext) {
- // Divide area so that it will be within targetLength if possible
- // If not, it can be shorter, but not longer.
- /* Iterate over contents of the area. *
-
- // Need to figure out if we can do this generically
- // Logically a BlockStacking LM only handles Block-type areas
- if (!(area instanceof BlockParent)) {
- return false;
- }
- Iterator areaIter = ((BlockParent) area).getChildAreas().iterator();
-
-
- BreakCost minBreakCost = null;
- MinOptMax remainBPD = splitContext.targetBPD;
- splitContext.nextArea = area;
-
- while (areaIter.hasNext()) {
- Area childArea = (Area) areaIter.next();
- if (remainBPD.max < childArea.getAllocationBPD().min) {
- // Past the end point: try to break it
- // TODO: get a LayoutManager to do the split of the child
- // area, either Area => LM or Area => gen FO => LM
- LayoutManager childLM =
- childArea.getGeneratingFObj(). getLayoutManager();
- splitContext.targetBPD = remainBPD;
- if (childLM.splitArea(childArea, splitContext) == false) {
- // Can't split, so must split this area before childArea
- // Can we pass the iter?
- // If already saw several a potential break, use it
- if (minBreakCost != null) {
- /* Split 'area', placing all children after
- * minBreakCost.getArea() into a new area,
- * which we store in the splitContext.
- *
- // splitContext.nextArea = area.splitAfter(minBreakCost.getArea());
- } else {
- /* This area will be shorter than the desired minimum.
- * Split before the current childArea (which will be
- * the first area in the newly created Area.
- *
- //splitContext.nextArea = area.splitBefore(childArea);
- }
- } else
- return true; // childLM has done the work for us!
- // Set cost, dimension ???
- break;
- } else {
- remainBPD.subtract(childArea.getAllocationBPD());
- if (remainBPD.min < 0) {
- // Potential breakpoint: remember break Position and
- // break "cost" (constraint violation)
- BreakCost breakCost =
- evaluateBreakCost(area, childArea);
- minBreakCost = breakCost.chooseLowest(minBreakCost);
- }
- }
- //Note: size of area when split can depend on conditional
- // space, border and padding of the split area!!!
- }
- // True if some part of area can be placed, false if none is placed
- return (splitContext.nextArea != area);
- */
- return false;
- }
-
private BreakCost evaluateBreakCost(Area parent, Area child) {
return new BreakCost(child, 0);
}
@@ -157,7 +91,6 @@
flush(); // hand off current area to parent
// Probably need something like max BPD so we don't get into
// infinite loops with large unbreakable chunks
- //SplitContext splitContext = new SplitContext(targetDim);
/*LayoutManager childLM =
childArea.getGeneratingFObj(). getLayoutManager();
1.7 +1 -2 xml-fop/src/org/apache/fop/layoutmgr/LayoutManager.java
Index: LayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/LayoutManager.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- LayoutManager.java 9 Aug 2002 07:11:15 -0000 1.6
+++ LayoutManager.java 19 Aug 2002 08:01:56 -0000 1.7
@@ -17,7 +17,6 @@
public boolean generatesInlineAreas();
public Area getParentArea (Area childArea);
public boolean addChild (Area childArea);
- public boolean splitArea(Area areaToSplit, SplitContext context);
public void setParentLM(LayoutManager lm);
public int getContentIPD();
}
1.13 +3 -1 xml-fop/src/org/apache/fop/layoutmgr/PageLayoutManager.java
Index: PageLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/PageLayoutManager.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- PageLayoutManager.java 18 Aug 2002 13:47:13 -0000 1.12
+++ PageLayoutManager.java 19 Aug 2002 08:01:56 -0000 1.13
@@ -239,6 +239,8 @@
lm.setParentLM(this);
LayoutContext childLC = new LayoutContext(0);
childLC.setStackLimit(new MinOptMax((int)curPage.getViewArea().getHeight()));
+ childLC.setRefIPD((int)reg.getViewArea().getWidth());
+
while (!lm.isFinished()) {
BreakPoss bp = lm.getNextBreakPoss(childLC, null);
if (bp != null) {
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org