/** * Returns the break class for this row. This is a combination of break-after set on the last * children of any cells ending on this row. * * <p><strong>Note:</strong> this method doesn't take into account break-after set on the * enclosing fo:table-row element, if any, as it must be ignored if the row belongs to a group of * spanned rows (see XSL-FO 1.1, 7.20.1). * * <p><strong>Note:</strong> this works only after getNextKuthElements on the corresponding * TableCellLM have been called! * * @return one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN}, {@link * Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE}, {@link Constants#EN_ODD_PAGE} */ public int getBreakAfter() { int breakAfter = Constants.EN_AUTO; for (Iterator iter = gridUnits.iterator(); iter.hasNext(); ) { GridUnit gu = (GridUnit) iter.next(); if (!gu.isEmpty() && gu.getColSpanIndex() == 0 && gu.isLastGridUnitRowSpan()) { breakAfter = BreakUtil.compareBreakClasses(breakAfter, gu.getPrimary().getBreakAfter()); } } return breakAfter; }
/** * Returns the break class for this row. This is a combination of break-before set on the first * children of any cells starting on this row. * * <p><strong>Note:</strong> this method doesn't take into account break-before set on the * enclosing fo:table-row element, if any, as it must be ignored if the row belongs to a group of * spanned rows (see XSL-FO 1.1, 7.20.2). * * <p><strong>Note:</strong> this works only after getNextKuthElements on the corresponding * TableCellLM have been called! * * @return one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN}, {@link * Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE}, {@link Constants#EN_ODD_PAGE} */ public int getBreakBefore() { int breakBefore = Constants.EN_AUTO; for (Iterator iter = gridUnits.iterator(); iter.hasNext(); ) { GridUnit gu = (GridUnit) iter.next(); if (gu.isPrimary()) { breakBefore = BreakUtil.compareBreakClasses(breakBefore, gu.getPrimary().getBreakBefore()); } } return breakBefore; }
/** * Returns the strength of the keep constraint if the enclosing (if any) fo:table-row element of * this row, or if any of the cells ending on this row, have keep-with-next set. * * @return the strength of the keep-with-next constraint */ public Keep getKeepWithNext() { Keep keep = Keep.KEEP_AUTO; TableRow row = getTableRow(); if (row != null) { keep = Keep.getKeep(row.getKeepWithNext()); } for (Iterator iter = gridUnits.iterator(); iter.hasNext(); ) { GridUnit gu = (GridUnit) iter.next(); if (!gu.isEmpty() && gu.getColSpanIndex() == 0 && gu.isLastGridUnitRowSpan()) { keep = keep.compare(gu.getPrimary().getKeepWithNext()); } } return keep; }
/** * Returns the strength of the keep constraint if the enclosing (if any) fo:table-row element of * this row, or if any of the cells starting on this row, have keep-with-previous set. * * @return the strength of the keep-with-previous constraint */ public Keep getKeepWithPrevious() { Keep keep = Keep.KEEP_AUTO; TableRow row = getTableRow(); if (row != null) { keep = Keep.getKeep(row.getKeepWithPrevious()); } for (Iterator iter = gridUnits.iterator(); iter.hasNext(); ) { GridUnit gu = (GridUnit) iter.next(); if (gu.isPrimary()) { keep = keep.compare(gu.getPrimary().getKeepWithPrevious()); } } return keep; }