private static void layoutBlockChild0(LayoutContext c, BlockBox parent, BlockBox child, boolean needPageClear, int childOffset, int trimmedPageCount) { child.setNeedPageClear(needPageClear); child.initStaticPos(c, parent, childOffset); child.initContainingLayer(c); child.calcCanvasLocation(); c.translate(0, childOffset); repositionBox(c, child, trimmedPageCount); child.layout(c); c.translate(-child.getX(), -child.getY()); }
private static void layoutBlockChild0(LayoutContext c, BlockBox parent, BlockBox child, boolean needPageClear, int childOffset, int trimmedPageCount) { child.setNeedPageClear(needPageClear); child.initStaticPos(c, parent, childOffset); child.initContainingLayer(c); child.calcCanvasLocation(); c.translate(0, childOffset); repositionBox(c, child, trimmedPageCount); child.layout(c); c.translate(-child.getX(), -child.getY()); }
public void initStaticPos(LayoutContext c, BlockBox parent, int childOffset) { setX(0); TableBox table = getTable(); setY(parent.getHeight() + table.getStyle().getBorderVSpacing(c)); c.translate(0, getY()-childOffset); }
public void initStaticPos(LayoutContext c, BlockBox parent, int childOffset) { setX(0); TableBox table = getTable(); setY(parent.getHeight() + table.getStyle().getBorderVSpacing(c)); c.translate(0, getY()-childOffset); }
private static void repositionBox(LayoutContext c, BlockBox child, int trimmedPageCount) { boolean moved = false; if (child.getStyle().isRelative()) { Dimension delta = child.positionRelative(c); c.translate(delta.width, delta.height); moved = true; } if (c.isPrint()) { boolean pageClear = child.isNeedPageClear() || child.getStyle().isForcePageBreakBefore(); boolean needNewPageContext = child.checkPageContext(c); if (needNewPageContext && trimmedPageCount != NO_PAGE_TRIM) { c.getRootLayer().trimPageCount(trimmedPageCount); } if (pageClear || needNewPageContext) { int delta = child.forcePageBreakBefore( c, child.getStyle().getIdent(CSSName.PAGE_BREAK_BEFORE), needNewPageContext); c.translate(0, delta); moved = true; child.setNeedPageClear(false); } } if (moved) { child.calcCanvasLocation(); } }
private static void repositionBox(LayoutContext c, BlockBox child, int trimmedPageCount) { boolean moved = false; if (child.getStyle().isRelative()) { Dimension delta = child.positionRelative(c); c.translate(delta.width, delta.height); moved = true; } if (c.isPrint()) { boolean pageClear = child.isNeedPageClear() || child.getStyle().isForcePageBreakBefore(); boolean needNewPageContext = child.checkPageContext(c); if (needNewPageContext && trimmedPageCount != NO_PAGE_TRIM) { c.getRootLayer().trimPageCount(trimmedPageCount); } if (pageClear || needNewPageContext) { int delta = child.forcePageBreakBefore( c, child.getStyle().getIdent(CSSName.PAGE_BREAK_BEFORE), needNewPageContext); c.translate(0, delta); moved = true; child.setNeedPageClear(false); } } if (moved) { child.calcCanvasLocation(); } }
private void calcPageClearance(LayoutContext c) { if (c.isPrint() && getStyle().isCollapseBorders()) { PageBox page = c.getRootLayer().getFirstPage(c, this); TableRowBox row = getFirstRow(); if (row != null) { int spill = 0; for (Iterator i = row.getChildIterator(); i.hasNext(); ) { TableCellBox cell = (TableCellBox)i.next(); BorderPropertySet collapsed = cell.getCollapsedPaintingBorder(); int tmp = (int)collapsed.top() / 2; if (tmp > spill) { spill = tmp; } } int borderTop = getAbsY() + (int)getMargin(c).top() - spill; int delta = page.getTop() - borderTop; if (delta > 0) { setY(getY() + delta); setPageClearance(delta); calcCanvasLocation(); c.translate(0, delta); } } } }
private void calcPageClearance(LayoutContext c) { if (c.isPrint() && getStyle().isCollapseBorders()) { PageBox page = c.getRootLayer().getFirstPage(c, this); if (page != null) { TableRowBox row = getFirstRow(); if (row != null) { int spill = 0; for (Iterator i = row.getChildIterator(); i.hasNext(); ) { TableCellBox cell = (TableCellBox)i.next(); BorderPropertySet collapsed = cell.getCollapsedPaintingBorder(); int tmp = (int)collapsed.top() / 2; if (tmp > spill) { spill = tmp; } } int borderTop = getAbsY() + (int)getMargin(c).top() - spill; int delta = page.getTop() - borderTop; if (delta > 0) { setY(getY() + delta); setPageClearance(delta); calcCanvasLocation(); c.translate(0, delta); } } } } }
private void calcExtraPageClearance(LayoutContext c) { if (c.isPageBreaksAllowed() && c.getExtraSpaceTop() > 0 && (getStyle().isSpecifiedAsBlock() || getStyle().isListItem())) { PageBox first = c.getRootLayer().getFirstPage(c, this); if (first != null && first.getTop() + c.getExtraSpaceTop() > getAbsY()) { int diff = first.getTop() + c.getExtraSpaceTop() - getAbsY(); setY(getY() + diff); c.translate(0, diff); calcCanvasLocation(); } } }
private void calcExtraPageClearance(LayoutContext c) { if (c.isPageBreaksAllowed() && c.getExtraSpaceTop() > 0 && (getStyle().isSpecifiedAsBlock() || getStyle().isListItem())) { PageBox first = c.getRootLayer().getFirstPage(c, this); if (first != null && first.getTop() + c.getExtraSpaceTop() > getAbsY()) { int diff = first.getTop() + c.getExtraSpaceTop() - getAbsY(); setY(getY() + diff); c.translate(0, diff); calcCanvasLocation(); } } }