private ContentLimit getContentLimit(int pageNo, boolean addAsNeeded) { if (addAsNeeded) { while (_contentLimits.size() < (pageNo - _initialPageNo + 1)) { _contentLimits.add(new ContentLimit()); } } int target = pageNo - _initialPageNo; if (target >= 0 && target < _contentLimits.size()) { return (ContentLimit)_contentLimits.get(pageNo - _initialPageNo); } else { return null; } }
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 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 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); } }
private void updateHeaderPosition(RenderingContext c, ContentLimit limit) { if (limit.getTop() != ContentLimit.UNDEFINED || c.getPageNo() == _contentLimitContainer.getInitialPageNo()) { if (getChildCount() > 0) { newAbsY = section.getOriginalAbsY(); } else { newAbsY = limit.getTop() - getStyle().getBorderVSpacing(c) - section.getHeight();
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 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 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); } }
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 (section.isHeader()) { if (! section.isCapturedOriginalAbsY()) { section.setOriginalAbsY(section.getAbsY()); section.setCapturedOriginalAbsY(true); } int newAbsY; if (c.getPageNo() == _contentLimitContainer.getInitialPageNo()) { newAbsY = section.getOriginalAbsY(); } else { newAbsY = limit.getTop() - getStyle().getBorderVSpacing(c) - section.getHeight(); } int diff = newAbsY - section.getAbsY(); if (diff != 0) { section.setY(section.getY() + diff); section.calcCanvasLocation(); section.calcChildLocations(); section.calcPaintingInfo(c, false); } } } } }
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); } } } } }
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++; } }
private ContentLimit getContentLimit(int pageNo, boolean addAsNeeded) { if (addAsNeeded) { while (_contentLimits.size() < (pageNo - _initialPageNo + 1)) { _contentLimits.add(new ContentLimit()); } } int target = pageNo - _initialPageNo; if (target >= 0 && target < _contentLimits.size()) { return (ContentLimit)_contentLimits.get(pageNo - _initialPageNo); } else { return null; } }
return null; } else { if (limit.getTop() == ContentLimit.UNDEFINED || limit.getBottom() == ContentLimit.UNDEFINED) { return result; top = result.y; } else { top = limit.getTop() - ((TableRowBox)getParent()).getExtraSpaceTop() ; bottom = result.y + result.height; } else { bottom = limit.getBottom() + ((TableRowBox)getParent()).getExtraSpaceBottom();
return null; } else { if (limit.getTop() == ContentLimit.UNDEFINED || limit.getBottom() == ContentLimit.UNDEFINED) { return result; top = result.y; } else { top = limit.getTop() - ((TableRowBox)getParent()).getExtraSpaceTop() ; bottom = result.y + result.height; } else { bottom = limit.getBottom() + ((TableRowBox)getParent()).getExtraSpaceBottom();
return result; } else { if (limit.getTop() == ContentLimit.UNDEFINED || limit.getBottom() == ContentLimit.UNDEFINED) { return result; top = result.y; } else { top = limit.getTop() - (int)padding.top() - (int)border.top() - getStyle().getBorderVSpacing(c); if (getChildCount() > 0) { bottom = result.y + result.height; } else { bottom = limit.getBottom() + (int)padding.bottom() + (int)border.bottom() + getStyle().getBorderVSpacing(c); if (getChildCount() > 0) {
return result; } else { if (limit.getTop() == ContentLimit.UNDEFINED || limit.getBottom() == ContentLimit.UNDEFINED) { return result; top = result.y; } else { top = limit.getTop() - (int)padding.top() - (int)border.top() - getStyle().getBorderVSpacing(c); if (getChildCount() > 0) { bottom = result.y + result.height; } else { bottom = limit.getBottom() + (int)padding.bottom() + (int)border.bottom() + getStyle().getBorderVSpacing(c); if (getChildCount() > 0) {