private static LineBox newLine(LayoutContext c, LineBox previousLine, Box box) { int y = 0; if (previousLine != null) { y = previousLine.getY() + previousLine.getHeight(); } return newLine(c, y, box); }
private static LineBox newLine(LayoutContext c, LineBox previousLine, Box box) { int y = 0; if (previousLine != null) { y = previousLine.getY() + previousLine.getHeight(); } return newLine(c, y, box); }
public Rectangle getMarginEdge(CssContext cssCtx, int tx, int ty) { Rectangle result = new Rectangle(getX(), getY(), getContentWidth(), getHeight()); result.translate(tx, ty); return result; }
public Rectangle getMarginEdge(CssContext cssCtx, int tx, int ty) { Rectangle result = new Rectangle(getX(), getY(), getContentWidth(), getHeight()); result.translate(tx, ty); return result; }
public String toString() { return "LineBox: (" + getAbsX() + "," + getAbsY() + ")->(" + getWidth() + "," + getHeight() + ")"; }
public String toString() { return "LineBox: (" + getAbsX() + "," + getAbsY() + ")->(" + getWidth() + "," + getHeight() + ")"; }
public void analyzePageBreaks(LayoutContext c, ContentLimitContainer container) { container.updateTop(c, getAbsY()); container.updateBottom(c, getAbsY() + getHeight()); }
public void analyzePageBreaks(LayoutContext c, ContentLimitContainer container) { container.updateTop(c, getAbsY()); container.updateBottom(c, getAbsY() + getHeight()); }
private LineBox findFirstLineBox() { int type = getChildrenContentType(); int ccount = getChildCount(); if (ccount > 0) { if (type == CONTENT_INLINE) { for (int i = 0; i < ccount; i++) { LineBox result = (LineBox) getChild(i); if (result.getHeight() > 0) { return result; } } } else if (type == CONTENT_BLOCK) { for (int i = 0; i < ccount; i++) { LineBox result = ((BlockBox) getChild(i)).findFirstLineBox(); if (result != null) { return result; } } } } return null; }
private LineBox findLastLineBox() { int type = getChildrenContentType(); int ccount = getChildCount(); if (ccount > 0) { if (type == CONTENT_INLINE) { for (int i = ccount - 1; i >= 0; i--) { LineBox result = (LineBox) getChild(i); if (result.getHeight() > 0) { return result; } } } else if (type == CONTENT_BLOCK) { for (int i = ccount - 1; i >= 0; i--) { LineBox result = ((BlockBox) getChild(i)).findLastLineBox(); if (result != null) { return result; } } } } return null; }
private void findLastLineBox(LastLineBoxContext context) { int type = getChildrenContentType(); int ccount = getChildCount(); if (ccount > 0) { if (type == CONTENT_INLINE) { for (int i = ccount - 1; i >= 0; i--) { LineBox child = (LineBox) getChild(i); if (child.getHeight() > 0) { context.line = child; if (--context.current == 0) { return; } } } } else if (type == CONTENT_BLOCK) { for (int i = ccount - 1; i >= 0; i--) { ((BlockBox) getChild(i)).findLastLineBox(context); if (context.current == 0) { break; } } } } }
private LineBox findLastLineBox() { int type = getChildrenContentType(); int ccount = getChildCount(); if (ccount > 0) { if (type == CONTENT_INLINE) { for (int i = ccount - 1; i >= 0; i--) { LineBox result = (LineBox) getChild(i); if (result.getHeight() > 0) { return result; } } } else if (type == CONTENT_BLOCK) { for (int i = ccount - 1; i >= 0; i--) { LineBox result = ((BlockBox) getChild(i)).findLastLineBox(); if (result != null) { return result; } } } } return null; }
private LineBox findFirstLineBox() { int type = getChildrenContentType(); int ccount = getChildCount(); if (ccount > 0) { if (type == CONTENT_INLINE) { for (int i = 0; i < ccount; i++) { LineBox result = (LineBox) getChild(i); if (result.getHeight() > 0) { return result; } } } else if (type == CONTENT_BLOCK) { for (int i = 0; i < ccount; i++) { LineBox result = ((BlockBox) getChild(i)).findFirstLineBox(); if (result != null) { return result; } } } } return null; }
private void findLastLineBox(LastLineBoxContext context) { int type = getChildrenContentType(); int ccount = getChildCount(); if (ccount > 0) { if (type == CONTENT_INLINE) { for (int i = ccount - 1; i >= 0; i--) { LineBox child = (LineBox) getChild(i); if (child.getHeight() > 0) { context.line = child; if (--context.current == 0) { return; } } } } else if (type == CONTENT_BLOCK) { for (int i = ccount - 1; i >= 0; i--) { ((BlockBox) getChild(i)).findLastLineBox(context); if (context.current == 0) { break; } } } } }
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(); } } }
block.setY(currentLine.getY() + block.getFloatedBoxData().getMarginFromSibling()); } else { block.setY(currentLine.getY() + currentLine.getHeight());
block.setY(currentLine.getY() + block.getFloatedBoxData().getMarginFromSibling()); } else { block.setY(currentLine.getY() + currentLine.getHeight());