예제 #1
0
파일: GridUnit.java 프로젝트: JuliaIva/hq
 /**
  * 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;
   }
 }
예제 #2
0
파일: EffRow.java 프로젝트: JuliaIva/hq
 /**
  * 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;
 }
예제 #3
0
파일: EffRow.java 프로젝트: JuliaIva/hq
 /**
  * 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;
 }
예제 #4
0
파일: EffRow.java 프로젝트: JuliaIva/hq
 /**
  * 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;
 }
예제 #5
0
파일: EffRow.java 프로젝트: JuliaIva/hq
 /**
  * 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;
 }