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 ge...@locus.apache.org on 2000/11/08 23:07:40 UTC
cvs commit: xml-fop/src/org/apache/fop/fo/flow TableCell.java TableColumn.java TableRow.java
gears 00/11/08 14:07:36
Modified: src/org/apache/fop/fo/flow TableCell.java TableColumn.java
TableRow.java
Log:
Corinna Hischke's excellent table padding and partial border fixes. Very
Cool!
Revision Changes Path
1.17 +5 -1 xml-fop/src/org/apache/fop/fo/flow/TableCell.java
Index: TableCell.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/TableCell.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- TableCell.java 2000/11/03 19:51:12 1.16
+++ TableCell.java 2000/11/08 22:07:24 1.17
@@ -1,4 +1,4 @@
-/*-- $Id: TableCell.java,v 1.16 2000/11/03 19:51:12 gears Exp $ --
+/*-- $Id: TableCell.java,v 1.17 2000/11/08 22:07:24 gears Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -259,6 +259,10 @@
}
areaContainer.end();
area.addChild(areaContainer);
+
+ area.setHeight(getHeight());
+ // reset absoluteHeight to beginning of row
+ area.setAbsoluteHeight(areaContainer.getAbsoluteHeight());
return new Status(Status.OK);
}
1.10 +23 -1 xml-fop/src/org/apache/fop/fo/flow/TableColumn.java
Index: TableColumn.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/TableColumn.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- TableColumn.java 2000/11/03 19:51:14 1.9
+++ TableColumn.java 2000/11/08 22:07:26 1.10
@@ -1,4 +1,4 @@
-/*-- $Id: TableColumn.java,v 1.9 2000/11/03 19:51:14 gears Exp $ --
+/*-- $Id: TableColumn.java,v 1.10 2000/11/08 22:07:26 gears Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -74,6 +74,11 @@
ColorType borderRightColor;
int borderRightWidth;
int borderRightStyle;
+ int paddingTop;
+ int paddingBottom;
+ int paddingLeft;
+ int paddingRight;
+
int columnWidth;
int columnOffset;
@@ -167,6 +172,21 @@
this.borderRightStyle =
this.properties.get("border-right-style").getEnum();
}
+ this.paddingTop =
+ this.properties.get("padding").getLength().mvalue();
+ this.paddingLeft = this.paddingTop;
+ this.paddingRight = this.paddingTop;
+ this.paddingBottom = this.paddingTop;
+ if (this.paddingTop == 0) {
+ this.paddingTop =
+ this.properties.get("padding-top").getLength().mvalue();
+ this.paddingLeft =
+ this.properties.get("padding-left").getLength().mvalue();
+ this.paddingBottom =
+ this.properties.get("padding-bottom").getLength().mvalue();
+ this.paddingRight =
+ this.properties.get("padding-right").getLength().mvalue();
+ }
this.columnWidth =
this.properties.get("column-width").getLength().mvalue();
@@ -179,6 +199,8 @@
new AreaContainer(fs, columnOffset - area.borderWidthLeft, -area.borderWidthTop, columnWidth,
area.getHeight(), Position.RELATIVE);
areaContainer.setPage(area.getPage());
+ areaContainer.setPadding(paddingTop, paddingLeft, paddingBottom,
+ paddingRight);
areaContainer.setBackgroundColor(backgroundColor);
areaContainer.setBorderStyle(borderTopStyle, borderLeftStyle,
borderBottomStyle, borderRightStyle);
1.20 +27 -2 xml-fop/src/org/apache/fop/fo/flow/TableRow.java
Index: TableRow.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/TableRow.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- TableRow.java 2000/11/03 19:51:16 1.19
+++ TableRow.java 2000/11/08 22:07:27 1.20
@@ -1,4 +1,4 @@
-/*-- $Id: TableRow.java,v 1.19 2000/11/03 19:51:16 gears Exp $ --
+/*-- $Id: TableRow.java,v 1.20 2000/11/08 22:07:27 gears Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -93,6 +93,10 @@
ColorType borderRightColor;
int borderRightWidth;
int borderRightStyle;
+ int paddingTop;
+ int paddingBottom;
+ int paddingLeft;
+ int paddingRight;
int widthOfCellsSoFar = 0;
int largestCellHeight = 0;
@@ -178,6 +182,21 @@
this.borderRightStyle =
this.properties.get("border-right-style").getEnum();
}
+ this.paddingTop =
+ this.properties.get("padding").getLength().mvalue();
+ this.paddingLeft = this.paddingTop;
+ this.paddingRight = this.paddingTop;
+ this.paddingBottom = this.paddingTop;
+ if (this.paddingTop == 0) {
+ this.paddingTop =
+ this.properties.get("padding-top").getLength().mvalue();
+ this.paddingLeft =
+ this.properties.get("padding-left").getLength().mvalue();
+ this.paddingBottom =
+ this.properties.get("padding-bottom").getLength().mvalue();
+ this.paddingRight =
+ this.properties.get("padding-right").getLength().mvalue();
+ }
this.id=
this.properties.get("id").getString();
@@ -205,6 +224,8 @@
area.getAllocationWidth(),
area.spaceLeft(), Position.RELATIVE);
areaContainer.setPage(area.getPage());
+ areaContainer.setPadding(paddingTop, paddingLeft, paddingBottom,
+ paddingRight);
areaContainer.setBackgroundColor(backgroundColor);
areaContainer.setBorderStyle(borderTopStyle, borderLeftStyle, borderBottomStyle, borderRightStyle);
areaContainer.setBorderWidth(borderTopWidth, borderLeftWidth, borderBottomWidth, borderRightWidth);
@@ -265,7 +286,11 @@
area.addChild(areaContainer);
areaContainer.end();
- area.addDisplaySpace(largestCellHeight);
+ area.addDisplaySpace(largestCellHeight
+ + areaContainer.getPaddingTop()
+ + areaContainer.borderWidthTop
+ + areaContainer.getPaddingBottom()
+ + areaContainer.borderWidthBottom);
// bug fix from Eric Schaeffer
//area.increaseHeight(largestCellHeight);