if (!gu.hasBorders()) {
continue;
}
//Blocks for painting grid unit borders
Block block = new Block();
block.addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE);
block.setPositioning(Block.ABSOLUTE);
int bpd = getContentHeight(rowHeight, gu);
if (isSeparateBorderModel()) {
bpd += (gu.getBorders().getBorderBeforeWidth(false));
bpd += (gu.getBorders().getBorderAfterWidth(false));
} else {
bpd += gridUnit.getHalfMaxBeforeBorderWidth()
- (gu.getBorders().getBorderBeforeWidth(false) / 2);
bpd += gridUnit.getHalfMaxAfterBorderWidth()
- (gu.getBorders().getBorderAfterWidth(false) / 2);
}
block.setBPD(bpd);
lastRowHeight = rowHeight;
int ipd = gu.getColumn().getColumnWidth().getValue(this);
int borderStartWidth = gu.getBorders().getBorderStartWidth(false) / 2;
ipd -= borderStartWidth;
ipd -= gu.getBorders().getBorderEndWidth(false) / 2;
block.setIPD(ipd);
block.setXOffset(dx + borderStartWidth);
int halfCollapsingBorderHeight = 0;
if (!isSeparateBorderModel()) {
halfCollapsingBorderHeight
+= gu.getBorders().getBorderBeforeWidth(false) / 2;
}
block.setYOffset(dy - halfCollapsingBorderHeight);
TraitSetter.addCollapsingBorders(block, gu.getBorders(), outer, this);
parentLM.addChildArea(block);
dx += gu.getColumn().getColumnWidth().getValue(this);
}
dy += lastRowHeight;
}
log.warn("TODO Add collapsed border painting for spanned cells");
}
}
//Handle display-align
int contentBPD = getContentHeight(rowHeight, gridUnit);
if (usedBPD < contentBPD) {
if (getTableCell().getDisplayAlign() == EN_CENTER) {
Block space = new Block();
space.setBPD((contentBPD - usedBPD) / 2);
curBlockArea.addBlock(space);
} else if (getTableCell().getDisplayAlign() == EN_AFTER) {
Block space = new Block();
space.setBPD((contentBPD - usedBPD));
curBlockArea.addBlock(space);
}
}
AreaAdditionUtil.addAreas(this, parentIter, layoutContext);