private static LineBox newLine(LayoutContext c, int y, Box box) { LineBox result = new LineBox(); result.setStyle(box.getStyle().createAnonymousStyle(IdentValue.BLOCK)); result.setParent(box); result.initContainingLayer(c); result.setY(y); result.calcCanvasLocation(); return result; }
private static LineBox newLine(LayoutContext c, int y, Box box) { LineBox result = new LineBox(); result.setStyle(box.getStyle().createAnonymousStyle(IdentValue.BLOCK)); result.setParent(box); result.initContainingLayer(c); result.setY(y); result.calcCanvasLocation(); return result; }
public void checkPagePosition(LayoutContext c, boolean alwaysBreak) { if (! c.isPageBreaksAllowed()) { return; } PageBox pageBox = c.getRootLayer().getFirstPage(c, this); if (pageBox != null) { boolean needsPageBreak = alwaysBreak || getAbsY() + getHeight() >= pageBox.getBottom() - c.getExtraSpaceBottom(); if (needsPageBreak) { forcePageBreakBefore(c, IdentValue.ALWAYS, false); calcCanvasLocation(); } else if (pageBox.getTop() + c.getExtraSpaceTop() > getAbsY()) { int diff = pageBox.getTop() + c.getExtraSpaceTop() - getAbsY(); setY(getY() + diff); calcCanvasLocation(); } } }
public void checkPagePosition(LayoutContext c, boolean alwaysBreak) { if (! c.isPageBreaksAllowed()) { return; } PageBox pageBox = c.getRootLayer().getFirstPage(c, this); if (pageBox != null) { boolean needsPageBreak = alwaysBreak || getAbsY() + getHeight() >= pageBox.getBottom() - c.getExtraSpaceBottom(); if (needsPageBreak) { forcePageBreakBefore(c, IdentValue.ALWAYS, false); calcCanvasLocation(); } else if (pageBox.getTop() + c.getExtraSpaceTop() > getAbsY()) { int diff = pageBox.getTop() + c.getExtraSpaceTop() - getAbsY(); setY(getY() + diff); calcCanvasLocation(); } } }
calcCanvasLocation(); calcChildLocations();
calcCanvasLocation(); calcChildLocations();
if (delta > 0) { currentLine.setY(currentLine.getY() + delta); currentLine.calcCanvasLocation(); remainingWidth = maxAvailableWidth; remainingWidth -= c.getBlockFormattingContext().getFloatDistance(c, currentLine, maxAvailableWidth);