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/10/19 16:00:12 UTC
svn commit: r326562 - in
/xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr:
./ list/ table/
Author: jeremias
Date: Wed Oct 19 06:59:50 2005
New Revision: 326562
URL: http://svn.apache.org/viewcvs?rev=326562&view=rev
Log:
Some code clean up. Not everything about space resolution is purged, yet.
Modified:
xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/FootnoteBodyLayoutManager.java
xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
Modified: xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java?rev=326562&r1=326561&r2=326562&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java Wed Oct 19 06:59:50 2005
@@ -85,6 +85,7 @@
super(node);
}
+ /** @see org.apache.fop.layoutmgr.LayoutManager#initialize() */
public void initialize() {
abProps = getBlockContainerFO().getCommonAbsolutePosition();
foBlockSpaceBefore = new SpaceVal(getBlockContainerFO().getCommonMarginBlock()
@@ -445,7 +446,7 @@
contentRectOffsetX += getBlockContainerFO()
.getCommonMarginBlock().startIndent.getValue(this);
double contentRectOffsetY = offset.getY();
- contentRectOffsetY += getSpaceBefore();
+ contentRectOffsetY += getSpaceBefore(); //TODO Uhm, is that necessary?
contentRectOffsetY += getBlockContainerFO()
.getCommonBorderPaddingBackground().getBorderBeforeWidth(false);
contentRectOffsetY += getBlockContainerFO()
@@ -628,9 +629,7 @@
return new Point(x, y);
}
- /**
- * @see org.apache.fop.layoutmgr.LayoutManager#addAreas(org.apache.fop.layoutmgr.PositionIterator, org.apache.fop.layoutmgr.LayoutContext)
- */
+ /** @see org.apache.fop.layoutmgr.LayoutManager */
public void addAreas(PositionIterator parentIter,
LayoutContext layoutContext) {
getParentArea(null);
@@ -789,12 +788,6 @@
//}
}
- // if adjusted space before
-// if (bSpaceBefore) {
-// addBlockSpacing(0, new MinOptMax(adjustedSpaceBefore));
-// }
- //addBlockSpacing(0, effSpaceBefore);
-
while ((childLM = childPosIter.getNextChildLM()) != null) {
// set last area flag
lc.setFlags(LayoutContext.LAST_AREA,
@@ -804,18 +797,10 @@
childLM.addAreas(childPosIter, lc);
}
} else {
- // if adjusted space before
-// if (bSpaceBefore) {
-// addBlockSpacing(0, new MinOptMax(adjustedSpaceBefore));
-// }
- //addBlockSpacing(0, effSpaceBefore);
//Add child areas inside the reference area
bcpos.getBreaker().addContainedAreas();
}
- //int bIndents = getBlockContainerFO().getCommonBorderPaddingBackground()
- // .getBPPaddingAndBorder(false);
-
if (markers != null) {
getCurrentPV().addMarkers(markers, false, isFirst(firstPos), isLast(lastPos));
}
@@ -824,12 +809,6 @@
effSpaceBefore, effSpaceAfter);
flush();
- // if adjusted space after
-// if (bSpaceAfter) {
-// addBlockSpacing(0, new MinOptMax(adjustedSpaceAfter));
-// }
- //addBlockSpacing(0, effSpaceAfter);
-
viewportBlockArea = null;
referenceArea = null;
resetSpaces();
@@ -951,17 +930,13 @@
}
}
- /**
- * @see org.apache.fop.layoutmgr.BlockLevelLayoutManager#negotiateBPDAdjustment(int, org.apache.fop.layoutmgr.KnuthElement)
- */
+ /** @see org.apache.fop.layoutmgr.BlockLevelLayoutManager */
public int negotiateBPDAdjustment(int adj, KnuthElement lastElement) {
// TODO Auto-generated method stub
return 0;
}
- /**
- * @see org.apache.fop.layoutmgr.BlockLevelLayoutManager#discardSpace(org.apache.fop.layoutmgr.KnuthGlue)
- */
+ /** @see org.apache.fop.layoutmgr.BlockLevelLayoutManager */
public void discardSpace(KnuthGlue spaceGlue) {
// TODO Auto-generated method stub
Modified: xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java?rev=326562&r1=326561&r2=326562&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java Wed Oct 19 06:59:50 2005
@@ -300,12 +300,6 @@
}
getPSLM().addIDToPage(getBlockFO().getId());
- /* TODO remove when markers are really ok
- log.debug("Checking on " + this);
- log.debug("Checking first=" + firstPos);
- log.debug("Checking last=" + lastPos);
- log.debug("->" + isFirst(firstPos) + "/" + isLast(lastPos));
- */
if (markers != null) {
getCurrentPV().addMarkers(markers, true, isFirst(firstPos), isLast(lastPos));
}
@@ -384,15 +378,6 @@
//}
}
- // if adjusted space before
- //double adjust = layoutContext.getSpaceAdjust();
- //addBlockSpacing(adjust, foSpaceBefore);
- //addBlockSpacing(adjust, effSpaceBefore);
- foSpaceBefore = null;
- //if (bSpaceBefore) {
- // addBlockSpacing(0, new MinOptMax(adjustedSpaceBefore));
- //}
-
while ((childLM = childPosIter.getNextChildLM()) != null) {
// set last area flag
lc.setFlags(LayoutContext.LAST_AREA,
@@ -402,9 +387,6 @@
childLM.addAreas(childPosIter, lc);
}
- //int bIndents = getBlockFO().getCommonBorderPaddingBackground()
- // .getBPPaddingAndBorder(false);
-
if (markers != null) {
getCurrentPV().addMarkers(markers, false, isFirst(firstPos), isLast(lastPos));
}
@@ -413,13 +395,6 @@
effSpaceBefore, effSpaceAfter);
flush();
- // if adjusted space after
- //addBlockSpacing(adjust, foSpaceAfter);
- //addBlockSpacing(adjust, effSpaceAfter);
- //if (bSpaceAfter) {
- // addBlockSpacing(0, new MinOptMax(adjustedSpaceAfter));
- //}
-
curBlockArea = null;
resetSpaces();
}
@@ -463,24 +438,6 @@
getBlockFO().getCommonBorderPaddingBackground(),
getBlockFO().getCommonMarginBlock(),
this);
-
- // Set up dimensions
- // Get reference IPD from parentArea
- //int referenceIPD = parentArea.getIPD();
- //curBlockArea.setIPD(referenceIPD);
-
- // Set the width of the block based on the parent block
- // Need to be careful though, if parent is BC then width may not be set
- /* TODO remove if really not used anymore
- int parentwidth = 0;
- if (parentArea instanceof BlockParent) {
- parentwidth = ((BlockParent) parentArea).getIPD();
- }
- if (parentwidth == 0) {
- parentwidth = referenceIPD;
- }
- parentwidth -= getIPIndents();
- */
setCurrentArea(curBlockArea); // ??? for generic operations
}
Modified: xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java?rev=326562&r1=326561&r2=326562&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java Wed Oct 19 06:59:50 2005
@@ -53,8 +53,6 @@
protected int adjustedSpaceAfter = 0;
/** Only used to store the original list when createUnitElements is called */
protected LinkedList storedList = null;
- /** FO node */
- protected FObj fobj;
/** Indicates whether break before has been served or not */
protected boolean bBreakBeforeServed = false;
/** Indicates whether space before has been served or not */
@@ -84,7 +82,6 @@
public BlockStackingLayoutManager(FObj node) {
super(node);
setGeneratesBlockArea(true);
- fobj = node;
}
/**
@@ -103,16 +100,6 @@
this.parentArea = parentArea;
}
- protected MinOptMax resolveSpaceSpecifier(Area nextArea) {
- SpaceSpecifier spaceSpec = new SpaceSpecifier(false);
- // Area prevArea = getCurrentArea().getLast();
- // if (prevArea != null) {
- // spaceSpec.addSpace(prevArea.getSpaceAfter());
- // }
- // spaceSpec.addSpace(nextArea.getSpaceBefore());
- return spaceSpec.resolve(false);
- }
-
/**
* Add a block spacer for space before and space after a block.
* This adds an empty Block area that acts as a block space.
@@ -145,7 +132,6 @@
//log.error("Child not a Block in BlockStackingLM!");
}
- MinOptMax spaceBefore = resolveSpaceSpecifier(childArea);
parentArea.addBlock((Block) childArea);
flush(); // hand off current area to parent
}
Modified: xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java?rev=326562&r1=326561&r2=326562&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java Wed Oct 19 06:59:50 2005
@@ -36,7 +36,6 @@
*/
public class FlowLayoutManager extends BlockStackingLayoutManager
implements BlockLevelLayoutManager {
- private Flow fobj;
/** Array of areas currently being filled stored by area class */
private BlockParent[] currentAreas = new BlockParent[Area.CLASS_MAX];
@@ -51,7 +50,6 @@
*/
public FlowLayoutManager(PageSequenceLayoutManager pslm, Flow node) {
super(node);
- fobj = node;
setParent(pslm);
}
Modified: xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/FootnoteBodyLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/FootnoteBodyLayoutManager.java?rev=326562&r1=326561&r2=326562&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/FootnoteBodyLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/FootnoteBodyLayoutManager.java Wed Oct 19 06:59:50 2005
@@ -23,12 +23,20 @@
import java.util.LinkedList;
+/**
+ * Layout manager for footnote bodies.
+ */
public class FootnoteBodyLayoutManager extends BlockStackingLayoutManager {
+ /**
+ * Creates a new FootnoteBodyLayoutManager.
+ * @param body the footnote-body element
+ */
public FootnoteBodyLayoutManager(FootnoteBody body) {
super(body);
}
+ /** @see org.apache.fop.layoutmgr.LayoutManager */
public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) {
LayoutManager childLM = null;
LayoutManager lastLM = null;
@@ -38,8 +46,6 @@
// and put them in a new list;
LinkedList positionList = new LinkedList();
Position pos;
- boolean bSpaceBefore = false;
- boolean bSpaceAfter = false;
while (parentIter.hasNext()) {
pos = (Position) parentIter.next();
//log.trace("pos = " + pos.getClass().getName() + "; " + pos);
@@ -73,14 +79,13 @@
}
}
+ /** @see org.apache.fop.layoutmgr.LayoutManager#addChildArea(org.apache.fop.area.Area) */
public void addChildArea(Area childArea) {
childArea.setAreaClass(Area.CLASS_FOOTNOTE);
parentLM.addChildArea(childArea);
}
- /**
- * convenience method that returns the FootnoteBody node
- */
+ /** @return the FootnoteBody node */
protected FootnoteBody getFootnodeBodyFO() {
return (FootnoteBody) fobj;
}
Modified: xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java?rev=326562&r1=326561&r2=326562&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java Wed Oct 19 06:59:50 2005
@@ -147,11 +147,6 @@
addBlockSpacing(0.0, new MinOptMax(layoutContext.getSpaceBefore()));
}
- // if adjusted space before
- //double adjust = layoutContext.getSpaceAdjust();
- //addBlockSpacing(adjust, foSpaceBefore);
- foSpaceBefore = null;
-
getPSLM().addIDToPage(getListBlockFO().getId());
// the list block contains areas stacked from each list item
@@ -215,9 +210,6 @@
flush();
- // if adjusted space after
- //addBlockSpacing(adjust, foSpaceAfter);
-
curBlockArea = null;
resetSpaces();
}
Modified: xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java?rev=326562&r1=326561&r2=326562&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java Wed Oct 19 06:59:50 2005
@@ -430,12 +430,6 @@
LayoutContext layoutContext) {
getParentArea(null);
- // if adjusted space before
- //double adjust = layoutContext.getSpaceAdjust();
- //addBlockSpacing(adjust, foSpaceBefore);
- //addBlockSpacing(adjust, effSpaceBefore);
- //foSpaceBefore = null;
-
getPSLM().addIDToPage(getListItemFO().getId());
LayoutContext lc = new LayoutContext(0);
@@ -547,10 +541,6 @@
flush();
- // if adjusted space after
- //addBlockSpacing(adjust, foSpaceAfter);
- //addBlockSpacing(adjust, effSpaceAfter);
-
curBlockArea = null;
resetSpaces();
}
Modified: xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java?rev=326562&r1=326561&r2=326562&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_SpaceResolution/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java Wed Oct 19 06:59:50 2005
@@ -66,10 +66,6 @@
private double tableUnits;
private boolean autoLayout = true;
- //TODO space-before|after: handle space-resolution rules
- private MinOptMax spaceBefore;
- private MinOptMax spaceAfter;
-
private boolean discardBorderBefore;
private boolean discardBorderAfter;
private boolean discardPaddingBefore;
@@ -101,8 +97,8 @@
/** @see org.apache.fop.layoutmgr.LayoutManager#initialize() */
public void initialize() {
- spaceBefore = new SpaceVal(fobj.getCommonMarginBlock().spaceBefore, this).getSpace();
- spaceAfter = new SpaceVal(fobj.getCommonMarginBlock().spaceAfter, this).getSpace();
+ foSpaceBefore = new SpaceVal(fobj.getCommonMarginBlock().spaceBefore, this).getSpace();
+ foSpaceAfter = new SpaceVal(fobj.getCommonMarginBlock().spaceAfter, this).getSpace();
if (!fobj.isAutoLayout()
&& fobj.getInlineProgressionDimension().getOptimum(this).getEnum() != EN_AUTO) {
@@ -160,16 +156,6 @@
log.warn("Allocated IPD exceeds available reference IPD");
}
- //MinOptMax stackSize = new MinOptMax();
- //Add spacing
- /*
- if (spaceAfter != null) {
- stackSize.add(spaceAfter);
- }
- if (spaceBefore != null) {
- stackSize.add(spaceBefore);
- }*/
-
// either works out table of column widths or if proportional-column-width function
// is used works out total factor, so that value of single unit can be computed.
int sumCols = 0;
@@ -318,11 +304,6 @@
getParentArea(null);
getPSLM().addIDToPage(fobj.getId());
- // if adjusted space before
- //double adjust = layoutContext.getSpaceAdjust();
- //addBlockSpacing(adjust, spaceBefore);
- //spaceBefore = null;
-
int startXOffset = fobj.getCommonMarginBlock().startIndent.getValue(this);
// add column, body then row areas
@@ -361,10 +342,6 @@
flush();
- // if adjusted space after
- //addBlockSpacing(adjust, spaceAfter);
-
- //bodyBreaks.clear();
resetSpaces();
curBlockArea = null;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org