*/
protected void endOfNode() throws FOPException {
if (!tableBodyFound) {
- missingChildElementError("(marker*,table-column*,table-header?,table-footer?,table-body+)");
+ missingChildElementError(
+ "(marker*,table-column*,table-header?,table-footer?,table-body+)");
}
getFOEventHandler().endTable(this);
return this.defaultColumn;
}
+ /** @return the list of table-column elements. */
public List getColumns() {
return columns;
}
return (TableBody)childNodes.get(index);
}
+ /** @return the body for the table-header. */
public TableBody getTableHeader() {
return tableHeader;
}
+ /** @return the body for the table-footer. */
public TableBody getTableFooter() {
return tableFooter;
}
return keepTogether;
}
+ /**
+ * Convenience method to check if a keep-together constraint is specified.
+ * @return true if keep-together is active.
+ */
+ public boolean mustKeepTogether() {
+ return !getKeepTogether().getWithinPage().isAuto()
+ || !getKeepTogether().getWithinColumn().isAuto();
+ }
+
/** @return the "border-collapse" property. */
public int getBorderCollapse() {
return borderCollapse;
}
if (pgu.isLastGridUnitRowSpan() && pgu.getRow() != null) {
makeBoxForWholeRow |= pgu.getRow().mustKeepTogether();
+ makeBoxForWholeRow |= pgu.getTable().mustKeepTogether();
}
if (makeBoxForWholeRow) {
List list = new java.util.ArrayList(1);
penaltyPos.footerElements = tclm.getFooterElements();
}
}
- returnList.add(new KnuthPenalty(effPenaltyLen, 0, false, penaltyPos, false));
+ int p = 0;
+ if (getTableLM().mustKeepTogether()) {
+ p = KnuthPenalty.INFINITE;
+ }
+ returnList.add(new KnuthPenalty(effPenaltyLen, p, false, penaltyPos, false));
log.debug("step=" + step + " (+" + increase + ")"
+ " box=" + boxLen