private void calcFloatLocations(List floats) { for (Iterator i = floats.iterator(); i.hasNext();) { BoxOffset boxOffset = (BoxOffset) i.next(); boxOffset.getBox().calcCanvasLocation(); boxOffset.getBox().calcChildLocations(); } }
private void calcFloatLocations(List floats) { for (Iterator i = floats.iterator(); i.hasNext();) { BoxOffset boxOffset = (BoxOffset) i.next(); boxOffset.getBox().calcCanvasLocation(); boxOffset.getBox().calcChildLocations(); } }
private void save(BlockBox current, Layer layer, BlockFormattingContext bfc, int direction) { Point p = bfc.getOffset(); getFloats(direction).add(new BoxOffset(current, p.x, p.y)); layer.addFloat(current, bfc); current.getFloatedBoxData().setManager(this); current.calcCanvasLocation(); current.calcChildLocations(); }
private static void layoutInlineBlockContent( LayoutContext c, BlockBox containingBlock, BlockBox inlineBlock, int initialY) { inlineBlock.setContainingBlock(containingBlock); inlineBlock.setContainingLayer(c.getLayer()); inlineBlock.initStaticPos(c, containingBlock, initialY); inlineBlock.calcCanvasLocation(); inlineBlock.layout(c); }
private static void layoutInlineBlockContent( LayoutContext c, BlockBox containingBlock, BlockBox inlineBlock, int initialY) { inlineBlock.setContainingBlock(containingBlock); inlineBlock.setContainingLayer(c.getLayer()); inlineBlock.initStaticPos(c, containingBlock, initialY); inlineBlock.calcCanvasLocation(); inlineBlock.layout(c); }
private void save(BlockBox current, Layer layer, BlockFormattingContext bfc, int direction) { Point p = bfc.getOffset(); getFloats(direction).add(new BoxOffset(current, p.x, p.y)); layer.addFloat(current, bfc); current.getFloatedBoxData().setManager(this); current.calcCanvasLocation(); current.calcChildLocations(); }
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 positionAbsoluteOnPage(LayoutContext c) { if (c.isPrint() && (getStyle().isForcePageBreakBefore() || isNeedPageClear())) { forcePageBreakBefore(c, getStyle().getIdent(CSSName.PAGE_BREAK_BEFORE), false); calcCanvasLocation(); calcChildLocations(); setNeedPageClear(false); } }
public void positionAbsoluteOnPage(LayoutContext c) { if (c.isPrint() && (getStyle().isForcePageBreakBefore() || isNeedPageClear())) { forcePageBreakBefore(c, getStyle().getIdent(CSSName.PAGE_BREAK_BEFORE), false); calcCanvasLocation(); calcChildLocations(); setNeedPageClear(false); } }
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 void calcClearance(LayoutContext c) { if (getStyle().isCleared() && ! getStyle().isFloated()) { c.translate(0, -getY()); c.getBlockFormattingContext().clear(c, this); c.translate(0, getY()); calcCanvasLocation(); } }
private void calcClearance(LayoutContext c) { if (getStyle().isCleared() && ! getStyle().isFloated()) { c.translate(0, -getY()); c.getBlockFormattingContext().clear(c, this); c.translate(0, getY()); 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(); } } }
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(); } } }
clearDelta = block.forcePageBreakBefore(c, block.getStyle().getIdent(CSSName.PAGE_BREAK_BEFORE), false); clearedPage = true; block.calcCanvasLocation(); block.reset(c); block.setContainingLayer(currentLine.getContainingLayer()); if (clearedPage) { block.setY(block.getY() - clearDelta); block.calcCanvasLocation();
clearDelta = block.forcePageBreakBefore(c, block.getStyle().getIdent(CSSName.PAGE_BREAK_BEFORE), false); clearedPage = true; block.calcCanvasLocation(); block.reset(c); block.setContainingLayer(currentLine.getContainingLayer()); if (clearedPage) { block.setY(block.getY() - clearDelta); block.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 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(); } }