aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/layoutmgr/table/Row.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-02-07 11:01:37 +0000
committerJeremias Maerki <jeremias@apache.org>2005-02-07 11:01:37 +0000
commit36a04093061ccc030a667fac652b490409970b40 (patch)
tree67fa2886c1ce425dc0462c6311e9ac7c5502503d /src/java/org/apache/fop/layoutmgr/table/Row.java
parent7cd913f036c369e67e95661467449cd872cb266c (diff)
downloadxmlgraphics-fop-36a04093061ccc030a667fac652b490409970b40.tar.gz
xmlgraphics-fop-36a04093061ccc030a667fac652b490409970b40.zip
Temporary fix for markers (using isBogus() check)
ipd/height and display-align support for table rows and cells. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198387 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr/table/Row.java')
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/Row.java50
1 files changed, 40 insertions, 10 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/table/Row.java b/src/java/org/apache/fop/layoutmgr/table/Row.java
index 49562329f..7233adf27 100644
--- a/src/java/org/apache/fop/layoutmgr/table/Row.java
+++ b/src/java/org/apache/fop/layoutmgr/table/Row.java
@@ -19,17 +19,20 @@
package org.apache.fop.layoutmgr.table;
import org.apache.fop.fo.flow.TableRow;
+import org.apache.fop.fo.properties.LengthRangeProperty;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
import org.apache.fop.layoutmgr.LayoutManager;
import org.apache.fop.layoutmgr.LeafPosition;
import org.apache.fop.layoutmgr.BreakPoss;
import org.apache.fop.layoutmgr.LayoutContext;
+import org.apache.fop.layoutmgr.MinOptMaxUtil;
import org.apache.fop.layoutmgr.PositionIterator;
import org.apache.fop.layoutmgr.BreakPossPosIter;
import org.apache.fop.layoutmgr.Position;
import org.apache.fop.layoutmgr.TraitSetter;
import org.apache.fop.area.Area;
import org.apache.fop.area.Block;
+import org.apache.fop.area.Trait;
import org.apache.fop.traits.MinOptMax;
import java.util.Iterator;
@@ -48,6 +51,7 @@ public class Row extends BlockStackingLayoutManager {
private List cellList = null;
private List columns = null;
+ private int referenceIPD;
private int rowHeight;
private int xoffset;
private int yoffset;
@@ -133,7 +137,7 @@ public class Row extends BlockStackingLayoutManager {
// Set up a LayoutContext
// the ipd is from the current column
- int ipd = context.getRefIPD();
+ referenceIPD = context.getRefIPD();
BreakPoss bp;
LayoutContext childLC = new LayoutContext(0);
@@ -194,9 +198,17 @@ public class Row extends BlockStackingLayoutManager {
breakList.add(childBreaks);
}
- rowHeight = opt;
-
MinOptMax rowSize = new MinOptMax(min, opt, max);
+ LengthRangeProperty specifiedBPD = fobj.getBlockProgressionDimension();
+ if (specifiedBPD.getEnum() != EN_AUTO) {
+ if ((specifiedBPD.getMaximum().getEnum() != EN_AUTO)
+ && (specifiedBPD.getMaximum().getLength().getValue() < rowSize.min)) {
+ log.warn("maximum height of row is smaller than the minimum "
+ + "height of its contents");
+ }
+ MinOptMaxUtil.restrict(rowSize, specifiedBPD);
+ }
+ rowHeight = rowSize.opt;
boolean fin = true;
cellcount = 0;
@@ -278,14 +290,27 @@ public class Row extends BlockStackingLayoutManager {
public void addAreas(PositionIterator parentIter,
LayoutContext layoutContext) {
getParentArea(null);
- addID(fobj.getId());
+ BreakPoss bp1 = (BreakPoss)parentIter.peekNext();
+ bBogus = !bp1.generatesAreas();
+ if (!isBogus()) {
+ addID(fobj.getId());
+ }
Cell childLM;
int iStartPos = 0;
LayoutContext lc = new LayoutContext(0);
while (parentIter.hasNext()) {
RowPosition lfp = (RowPosition) parentIter.next();
- // Add the block areas to Area
+
+ //area exclusively for painting the row background
+ Block rowArea = getRowArea();
+ if (rowArea != null) {
+ rowArea.setBPD(rowHeight);
+ rowArea.setIPD(referenceIPD);
+ rowArea.setXOffset(xoffset);
+ rowArea.setYOffset(yoffset);
+ parentLM.addChild(rowArea);
+ }
int cellcount = 0;
int x = this.xoffset;
@@ -316,7 +341,6 @@ public class Row extends BlockStackingLayoutManager {
}
flush();
-
}
/**
@@ -374,10 +398,16 @@ public class Row extends BlockStackingLayoutManager {
*
* @return the row area
*/
- public Area getRowArea() {
- Area block = new Block();
- TraitSetter.addBackground(block, fobj.getCommonBorderPaddingBackground());
- return block;
+ public Block getRowArea() {
+ if (fobj.getCommonBorderPaddingBackground().hasBackground()) {
+ Block block = new Block();
+ block.addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE);
+ block.setPositioning(Block.ABSOLUTE);
+ TraitSetter.addBackground(block, fobj.getCommonBorderPaddingBackground());
+ return block;
+ } else {
+ return null;
+ }
}
}