Ejemplo n.º 1
0
 /**
  * Resolve collapsing borders for the given cell. Used in case of the collapsing border model.
  *
  * @param other neighbouring grid unit
  * @param side the side to resolve (one of CommonBorderPaddingBackground.BEFORE|AFTER|START|END)
  */
 void resolveBorder(GridUnit other, int side) {
   switch (side) {
     case CommonBorderPaddingBackground.BEFORE:
       borderBefore.resolve(other.borderAfter, true, false, false);
       break;
     case CommonBorderPaddingBackground.AFTER:
       borderAfter.resolve(other.borderBefore, true, false, false);
       break;
     case CommonBorderPaddingBackground.START:
       BorderSpecification resolvedBorder =
           collapsingBorderModel.determineWinner(borderStart, other.borderEnd);
       if (resolvedBorder != null) {
         this.borderStart = resolvedBorder;
         other.borderEnd = resolvedBorder;
       }
       break;
     case CommonBorderPaddingBackground.END:
       resolvedBorder = collapsingBorderModel.determineWinner(borderEnd, other.borderStart);
       if (resolvedBorder != null) {
         this.borderEnd = resolvedBorder;
         other.borderStart = resolvedBorder;
       }
       break;
     default:
       assert false;
   }
 }
Ejemplo n.º 2
0
 /**
  * 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;
 }
Ejemplo n.º 3
0
 /**
  * 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;
 }
Ejemplo n.º 4
0
 /**
  * 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;
 }
Ejemplo n.º 5
0
 /**
  * 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;
 }