FONode fo = (FONode) children.elementAt(i);
if (fo instanceof TableColumn) {
TableColumn c = (TableColumn) fo;
- int num = c.getColumnNumber();
- if (num == 0) {
- num = currentColumnNumber + 1;
+ c.doSetup(areaContainer);
+ int numColumnsRepeated = c.getNumColumnsRepeated();
+ //int currentColumnNumber = c.getColumnNumber();
+
+ for (int j = 0; j < numColumnsRepeated; j++) {
+ currentColumnNumber++;
+ if (currentColumnNumber > columns.size()) {
+ columns.setSize(currentColumnNumber);
+ }
+ columns.setElementAt(c, currentColumnNumber - 1);
+ c.setColumnOffset(offset);
+ c.layout(areaContainer);
+ offset += c.getColumnWidth();
}
- currentColumnNumber = num;
- if (num > columns.size()) {
- columns.setSize(num);
- }
- columns.setElementAt(c, num - 1);
- c.setColumnOffset(offset);
- fo.layout(areaContainer);
- offset += c.getColumnWidth();
}
}
areaContainer.setAllocationWidth(offset);
int columnWidth;
int columnOffset;
+ int numColumnsRepeated;
+
+ boolean setup = false;
AreaContainer areaContainer;
return 0; // not implemented yet
}
+ public int getNumColumnsRepeated() {
+ return numColumnsRepeated;
+ }
+
+ public void doSetup(Area area) throws FOPException {
+
+ this.numColumnsRepeated =
+ this.properties.get("number-columns-repeated").getNumber().intValue();
+
+ this.backgroundColor =
+ this.properties.get("background-color").getColorType();
+
+ this.columnWidth =
+ this.properties.get("column-width").getLength().mvalue();
+
+ // initialize id
+ String id = this.properties.get("id").getString();
+ area.getIDReferences().initializeID(id,area);
+
+ setup = true;
+ }
+
public Status layout(Area area) throws FOPException {
if (this.marker == BREAK_AFTER) {
return new Status(Status.OK);
}
- if (this.marker == START) {
- this.backgroundColor =
- this.properties.get("background-color").getColorType();
-
- this.columnWidth =
- this.properties.get("column-width").getLength().mvalue();
-
- // initialize id
- String id = this.properties.get("id").getString();
- area.getIDReferences().initializeID(id,area);
+ if (this.marker == START) {
+ if (!setup) {
+ doSetup(area);
}
+ }
this.areaContainer =
new AreaContainer(propMgr.getFontState(area.getFontInfo()),