public LineBox findLastNthLineBox(int count) { LastLineBoxContext context = new LastLineBoxContext(count); findLastLineBox(context); return context.line; }
public LineBox findLastNthLineBox(int count) { LastLineBoxContext context = new LastLineBoxContext(count); findLastLineBox(context); return context.line; }
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 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 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 int calcInlineBaseline(CssContext c) { if (isReplaced() && getReplacedElement().hasBaseline()) { Rectangle bounds = getContentAreaEdge(getAbsX(), getAbsY(), c); return bounds.y + getReplacedElement().getBaseline() - getAbsY(); } else { LineBox lastLine = findLastLineBox(); if (lastLine == null) { return getHeight(); } else { return lastLine.getAbsY() + lastLine.getBaseline() - getAbsY(); } } }
public int calcInlineBaseline(CssContext c) { if (isReplaced() && getReplacedElement().hasBaseline()) { Rectangle bounds = getContentAreaEdge(getAbsX(), getAbsY(), c); return bounds.y + getReplacedElement().getBaseline() - getAbsY(); } else { LineBox lastLine = findLastLineBox(); if (lastLine == null) { return getHeight(); } else { return lastLine.getAbsY() + lastLine.getBaseline() - getAbsY(); } } }