Browse Source

Addition to r670217

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@670323 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-1_0
Andreas L. Delmelle 16 years ago
parent
commit
72c8655231

+ 25
- 0
src/java/org/apache/fop/fo/flow/table/TableBody.java View File

@@ -20,6 +20,7 @@
package org.apache.fop.fo.flow.table;

import org.apache.fop.fo.FONode;
import org.apache.fop.apps.FOPException;

/**
* Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_table-body">
@@ -36,4 +37,28 @@ public class TableBody extends TablePart {
super(parent);
}

/** {@inheritDoc} */
public void startOfNode() throws FOPException {
super.startOfNode();
getFOEventHandler().startBody(this);
}

/** {@inheritDoc} */
public void endOfNode() throws FOPException {
super.endOfNode();
getFOEventHandler().endBody(this);
}

/** {@inheritDoc} */
public String getLocalName() {
return "table-body";
}

/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_TABLE_BODY}
*/
public int getNameId() {
return FO_TABLE_BODY;
}
}

+ 3
- 5
src/java/org/apache/fop/fo/flow/table/TableFooter.java View File

@@ -43,15 +43,13 @@ public class TableFooter extends TablePart {
/** {@inheritDoc} */
public void startOfNode() throws FOPException {
super.startOfNode();
getFOEventHandler().startFooter(this);
}

/** {@inheritDoc} */
public void endOfNode() throws FOPException {
if (!(tableRowsFound || tableCellsFound)) {
missingChildElementError("marker* (table-row+|table-cell+)");
} else {
finishLastRowGroup();
}
super.endOfNode();
getFOEventHandler().endFooter(this);
}

/** {@inheritDoc} */

+ 3
- 5
src/java/org/apache/fop/fo/flow/table/TableHeader.java View File

@@ -42,15 +42,13 @@ public class TableHeader extends TablePart {
/** {@inheritDoc} */
public void startOfNode() throws FOPException {
super.startOfNode();
getFOEventHandler().startHeader(this);
}

/** {@inheritDoc} */
public void endOfNode() throws FOPException {
if (!(tableRowsFound || tableCellsFound)) {
missingChildElementError("marker* (table-row+|table-cell+)");
} else {
finishLastRowGroup();
}
super.endOfNode();
getFOEventHandler().endHeader(this);
}

/** {@inheritDoc} */

+ 3
- 37
src/java/org/apache/fop/fo/flow/table/TablePart.java View File

@@ -58,9 +58,6 @@ public abstract class TablePart extends TableCellContainer {

private boolean lastCellEndsRow = true;

/** The last encountered table-row. */
private TableRow lastRow;

private List rowGroups = new LinkedList();

/**
@@ -82,6 +79,7 @@ public abstract class TablePart extends TableCellContainer {
public void processNode(String elementName, Locator locator,
Attributes attlist, PropertyList pList)
throws FOPException {

if (!inMarker()) {
Table t = getTable();
if (t.hasExplicitColumns()) {
@@ -96,35 +94,17 @@ public abstract class TablePart extends TableCellContainer {
columnNumberManager = new ColumnNumberManager();
}
super.processNode(elementName, locator, attlist, pList);
}

/** {@inheritDoc} */
public void startOfNode() throws FOPException {
super.startOfNode();
if (this instanceof TableHeader) {
getFOEventHandler().startHeader((TableHeader)this);
} else if (this instanceof TableFooter) {
getFOEventHandler().startFooter((TableFooter)this);
} else {
getFOEventHandler().startBody((TableBody)this);
}
}

/** {@inheritDoc} */
public void endOfNode() throws FOPException {
super.endOfNode();
if (!inMarker()) {
pendingSpans = null;
columnNumberManager = null;
}

if (this instanceof TableHeader) {
getFOEventHandler().endHeader((TableHeader)this);
} else if (this instanceof TableFooter) {
getFOEventHandler().endFooter((TableFooter)this);
} else {
getFOEventHandler().endBody((TableBody)this);
}

if (!(tableRowsFound || tableCellsFound)) {
missingChildElementError("marker* (table-row+|table-cell+)", true);
getParent().removeChild(this);
@@ -198,8 +178,7 @@ public abstract class TablePart extends TableCellContainer {
getTable().getRowGroupBuilder().endTableRow();
}
rowsStarted = true;
lastRow = (TableRow) child;
getTable().getRowGroupBuilder().startTableRow(lastRow);
getTable().getRowGroupBuilder().startTableRow((TableRow)child);
break;
case FO_TABLE_CELL:
if (!rowsStarted) {
@@ -239,19 +218,6 @@ public abstract class TablePart extends TableCellContainer {
return commonBorderPaddingBackground;
}

/** {@inheritDoc} */
public String getLocalName() {
return "table-body";
}

/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_TABLE_BODY}
*/
public int getNameId() {
return FO_TABLE_BODY;
}

/**
* @param obj table row in question
* @return true if the given table row is the first row of this body.

Loading…
Cancel
Save