aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/fo/flow/TableRow.java
diff options
context:
space:
mode:
authorfotis <fotis@unknown>2000-03-07 09:47:35 +0000
committerfotis <fotis@unknown>2000-03-07 09:47:35 +0000
commit5e545d73c8c069df21aa55d45766442a3f4c2fae (patch)
treee641bfb80b05beade6dc02c6c16bd17661be5e65 /src/org/apache/fop/fo/flow/TableRow.java
parent99aca1e1efffb3e2824ba70454a51f6a9fb83336 (diff)
downloadxmlgraphics-fop-5e545d73c8c069df21aa55d45766442a3f4c2fae.tar.gz
xmlgraphics-fop-5e545d73c8c069df21aa55d45766442a3f4c2fae.zip
Support for absolute positioning and borders (contributed by Jon Smirl)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193285 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/fo/flow/TableRow.java')
-rw-r--r--src/org/apache/fop/fo/flow/TableRow.java60
1 files changed, 33 insertions, 27 deletions
diff --git a/src/org/apache/fop/fo/flow/TableRow.java b/src/org/apache/fop/fo/flow/TableRow.java
index 3c8b53ce6..5fd80a5ad 100644
--- a/src/org/apache/fop/fo/flow/TableRow.java
+++ b/src/org/apache/fop/fo/flow/TableRow.java
@@ -75,18 +75,20 @@ public class TableRow extends FObj {
}
FontState fs;
- int startIndent;
- int endIndent;
int spaceBefore;
int spaceAfter;
ColorType backgroundColor;
+
+ ColorType borderColor;
+ int borderWidth;
+ int borderStyle;
int widthOfCellsSoFar = 0;
int largestCellHeight = 0;
Vector columns;
- BlockArea blockArea;
+ AreaContainer areaContainer;
public TableRow(FObj parent, PropertyList propertyList) {
super(parent, propertyList);
@@ -114,25 +116,23 @@ public class TableRow extends FObj {
this.fs = new FontState(area.getFontInfo(), fontFamily,
fontStyle, fontWeight, fontSize);
- this.startIndent =
- this.properties.get("start-indent").getLength().mvalue();
- this.endIndent =
- this.properties.get("end-indent").getLength().mvalue();
this.spaceBefore =
this.properties.get("space-before.optimum").getLength().mvalue();
this.spaceAfter =
this.properties.get("space-after.optimum").getLength().mvalue();
this.backgroundColor =
this.properties.get("background-color").getColorType();
+ this.borderColor =
+ this.properties.get("border-color").getColorType();
+ this.borderWidth =
+ this.properties.get("border-width").getLength().mvalue();
+ this.borderStyle =
+ this.properties.get("border-style").getEnum();
if (area instanceof BlockArea) {
area.end();
}
- //if (this.isInListBody) {
- //startIndent += bodyIndent + distanceBetweenStarts;
- //}
-
this.marker = 0;
}
@@ -141,13 +141,16 @@ public class TableRow extends FObj {
area.addDisplaySpace(spaceBefore);
}
- this.blockArea =
- new BlockArea(fs, area.getAllocationWidth(),
- area.spaceLeft(), startIndent, endIndent, 0,
- 0, 0, 0);
- blockArea.setPage(area.getPage());
- blockArea.setBackgroundColor(backgroundColor);
- blockArea.start();
+ this.areaContainer =
+ new AreaContainer(fs, -area.borderWidthLeft, -area.borderWidthTop,
+ area.getAllocationWidth(),
+ area.spaceLeft(), Position.RELATIVE);
+ areaContainer.setPage(area.getPage());
+ areaContainer.setBackgroundColor(backgroundColor);
+ areaContainer.setBorderStyle(borderStyle, borderStyle, borderStyle, borderStyle);
+ areaContainer.setBorderWidth(borderWidth, borderWidth, borderWidth, borderWidth);
+ areaContainer.setBorderColor(borderColor, borderColor, borderColor, borderColor);
+ areaContainer.start();
int numChildren = this.children.size();
if (numChildren != columns.size()) {
@@ -175,27 +178,30 @@ public class TableRow extends FObj {
widthOfCellsSoFar += width;
Status status;
- if ((status = cell.layout(blockArea)).isIncomplete()) {
+ if ((status = cell.layout(areaContainer)).isIncomplete()) {
this.marker = i;
if ((i != 0) && (status.getCode() == Status.AREA_FULL_NONE)) {
status = new Status(Status.AREA_FULL_SOME);
}
- //blockArea.end();
- area.addChild(blockArea);
- area.increaseHeight(blockArea.getHeight());
+ area.addChild(areaContainer);
+ //areaContainer.end();
+ area.increaseHeight(areaContainer.getHeight());
return status;
}
int h = cell.getHeight();
- blockArea.addDisplaySpace(-h);
if (h > largestCellHeight) {
largestCellHeight = h;
}
-
+ }
+ for (int i = 0; i < numChildren; i++) {
+ TableCell cell = (TableCell)children.elementAt(i);
+ cell.setHeight(largestCellHeight);
}
- blockArea.end();
- area.addChild(blockArea);
+ area.addChild(areaContainer);
+ areaContainer.end();
+ area.setHeight(largestCellHeight);
area.addDisplaySpace(largestCellHeight);
// bug fix from Eric Schaeffer
//area.increaseHeight(largestCellHeight);
@@ -212,6 +218,6 @@ public class TableRow extends FObj {
}
public int getAreaHeight() {
- return blockArea.getHeight();
+ return areaContainer.getHeight();
}
}