protected void propagateExtraSpace( LayoutContext c, ContentLimitContainer parentContainer, ContentLimitContainer currentContainer, int extraTop, int extraBottom) { int start = currentContainer.getInitialPageNo(); int end = currentContainer.getLastPageNo(); int current = start; while (current <= end) { ContentLimit contentLimit = currentContainer.getContentLimit(current); if (current != start) { int top = contentLimit.getTop(); if (top != ContentLimit.UNDEFINED) { parentContainer.updateTop(c, top - extraTop); } } if (current != end) { int bottom = contentLimit.getBottom(); if (bottom != ContentLimit.UNDEFINED) { parentContainer.updateBottom(c, bottom + extraBottom); } } current++; } }
public void updateTop(LayoutContext c, int absY) { PageBox page = getPage(c, absY); getContentLimit(page.getPageNo(), true).updateTop(absY); ContentLimitContainer parent = getParent(); if (parent != null) { parent.updateTop(c, absY); } }
public void updateBottom(LayoutContext c, int absY) { PageBox page = getPage(c, absY); getContentLimit(page.getPageNo(), true).updateBottom(absY); ContentLimitContainer parent = getParent(); if (parent != null) { parent.updateBottom(c, absY); } }
public void analyzePageBreaks(LayoutContext c, ContentLimitContainer container) { _contentLimitContainer = new ContentLimitContainer(c, getAbsY()); _contentLimitContainer.setParent(container); if (container != null) { container.updateTop(c, getAbsY()); container.updateBottom(c, getAbsY() + getHeight()); } for (Iterator i = getChildIterator(); i.hasNext(); ) { Box b = (Box)i.next(); b.analyzePageBreaks(c, _contentLimitContainer); } if (container != null && _contentLimitContainer.isContainsMultiplePages() && (getExtraSpaceTop() > 0 || getExtraSpaceBottom() > 0)) { propagateExtraSpace(c, container, _contentLimitContainer, getExtraSpaceTop(), getExtraSpaceBottom()); } }
ContentLimit limit = contentLimitContainer.getContentLimit(c.getPageNo()); if (c.getPageNo() == contentLimitContainer.getInitialPageNo()) { top = result.y; } else { if (c.getPageNo() == contentLimitContainer.getLastPageNo()) { bottom = result.y + result.height; } else {
public PageBox getPage(LayoutContext c, int absY) { PageBox page; PageBox last = getLastPage(); if (last != null && absY >= last.getTop() && absY < last.getBottom()) { page = last; } else { page = c.getRootLayer().getPage(c, absY); setLastPage(page); } return page; }
public ContentLimit getContentLimit(int pageNo) { return getContentLimit(pageNo, false); }
public boolean isNeedsClipOnPaint(RenderingContext c) { boolean result = super.isNeedsClipOnPaint(c); if (result) { return result; } return c.isPrint() && getTable().getStyle().isPaginateTable() && ((TableRowBox)getParent()).getContentLimitContainer().isContainsMultiplePages(); } }
public ContentLimitContainer(LayoutContext c, int startAbsY) { _initialPageNo = getPage(c, startAbsY).getPageNo(); }
private void updateHeaderPosition(RenderingContext c, ContentLimit limit) { if (limit.getTop() != ContentLimit.UNDEFINED || c.getPageNo() == _contentLimitContainer.getInitialPageNo()) { if (getChildCount() > 0) { TableSectionBox section = (TableSectionBox)getChild(0); if (c.getPageNo() == _contentLimitContainer.getInitialPageNo()) { newAbsY = section.getOriginalAbsY(); } else {
private void updateFooterPosition(RenderingContext c, ContentLimit limit) { if (limit.getBottom() != ContentLimit.UNDEFINED || c.getPageNo() == _contentLimitContainer.getLastPageNo()) { if (getChildCount() > 0) { TableSectionBox section = (TableSectionBox)getChild(getChildCount()-1); if (section.isFooter()) { if (! section.isCapturedOriginalAbsY()) { section.setOriginalAbsY(section.getAbsY()); section.setCapturedOriginalAbsY(true); } int newAbsY; if (c.getPageNo() == _contentLimitContainer.getLastPageNo()) { newAbsY = section.getOriginalAbsY(); } else { newAbsY = limit.getBottom(); } int diff = newAbsY - section.getAbsY(); if (diff != 0) { section.setY(section.getY() + diff); section.calcCanvasLocation(); section.calcChildLocations(); section.calcPaintingInfo(c, false); } } } } }
public void analyzePageBreaks(LayoutContext c, ContentLimitContainer container) { _contentLimitContainer = new ContentLimitContainer(c, getAbsY()); _contentLimitContainer.setParent(container); if (container != null) { container.updateTop(c, getAbsY()); container.updateBottom(c, getAbsY() + getHeight()); } for (Iterator i = getChildIterator(); i.hasNext(); ) { Box b = (Box)i.next(); b.analyzePageBreaks(c, _contentLimitContainer); } if (container != null && _contentLimitContainer.isContainsMultiplePages() && (getExtraSpaceTop() > 0 || getExtraSpaceBottom() > 0)) { propagateExtraSpace(c, container, _contentLimitContainer, getExtraSpaceTop(), getExtraSpaceBottom()); } }
ContentLimit limit = contentLimitContainer.getContentLimit(c.getPageNo()); if (c.getPageNo() == contentLimitContainer.getInitialPageNo()) { top = result.y; } else { if (c.getPageNo() == contentLimitContainer.getLastPageNo()) { bottom = result.y + result.height; } else {
public void updateBottom(LayoutContext c, int absY) { PageBox page = getPage(c, absY); getContentLimit(page.getPageNo(), true).updateBottom(absY); ContentLimitContainer parent = getParent(); if (parent != null) { parent.updateBottom(c, absY); } }
public PageBox getPage(LayoutContext c, int absY) { PageBox page; PageBox last = getLastPage(); if (last != null && absY >= last.getTop() && absY < last.getBottom()) { page = last; } else { page = c.getRootLayer().getPage(c, absY); setLastPage(page); } return page; }
public ContentLimit getContentLimit(int pageNo) { return getContentLimit(pageNo, false); }
public boolean isNeedsClipOnPaint(RenderingContext c) { boolean result = super.isNeedsClipOnPaint(c); if (result) { return result; } return c.isPrint() && getTable().getStyle().isPaginateTable() && ((TableRowBox)getParent()).getContentLimitContainer().isContainsMultiplePages(); } }
public ContentLimitContainer(LayoutContext c, int startAbsY) { _initialPageNo = getPage(c, startAbsY).getPageNo(); }