for (int i = sequences.size() - 1; i >= 0; i--) { BlockBox start = (BlockBox)sequences.get(i); if (start.getAbsY() < page.getBottom() - 1) { return i; } } return -1; } public Box getSelectionEnd() {
private int getPageSequenceStart(RenderingContext c, List sequences, PageBox page) { for (int i = sequences.size() - 1; i >= 0; i--) { BlockBox start = (BlockBox)sequences.get(i); if (start.getAbsY() < page.getBottom() - 1) { return i; } } return -1; }
private int calcDelta(CssContext cssCtx, LineBox line, BoxDistance boxDistance) { BlockBox floated = boxDistance.getBox(); Rectangle rect = floated.getBorderEdge(floated.getAbsX(), floated.getAbsY(), cssCtx); int bottom = rect.y + rect.height; return bottom - line.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(); } } }
public void paint(RenderingContext c, ITextOutputDevice outputDevice, BlockBox box) { Rectangle contentBounds = box.getContentAreaEdge(box.getAbsX(), box.getAbsY(), c); ReplacedElement element = box.getReplacedElement(); outputDevice.drawImage( ((ITextImageElement)element).getImage(), contentBounds.x, contentBounds.y); }
public void paint(RenderingContext c, ITextOutputDevice outputDevice, BlockBox box) { Rectangle contentBounds = box.getContentAreaEdge(box.getAbsX(), box.getAbsY(), c); ReplacedElement element = box.getReplacedElement(); outputDevice.drawImage( ((ITextImageElement)element).getImage(), contentBounds.x, contentBounds.y); }
public void paint(RenderingContext c, ITextOutputDevice outputDevice, BlockBox box) { Rectangle contentBounds = box.getContentAreaEdge(box.getAbsX(), box.getAbsY(), c); ReplacedElement element = box.getReplacedElement(); outputDevice.drawImage( ((ITextImageElement)element).getImage(), contentBounds.x, contentBounds.y); }
public void paint(RenderingContext c, ITextOutputDevice outputDevice, BlockBox box) { Rectangle contentBounds = box.getContentAreaEdge(box.getAbsX(), box.getAbsY(), c); ReplacedElement element = box.getReplacedElement(); outputDevice.drawImage( ((ITextImageElement)element).getImage(), contentBounds.x, contentBounds.y); }
public void paint(RenderingContext c, ITextOutputDevice outputDevice, BlockBox box) { Rectangle contentBounds = box.getContentAreaEdge(box.getAbsX(), box.getAbsY(), c); ReplacedElement element = box.getReplacedElement(); outputDevice.drawImage( ((ITextImageElement)element).getImage(), contentBounds.x, contentBounds.y); }
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(); } } }
private static int getReferenceBaseline(RenderingContext c, BlockBox box) { MarkerData markerData = box.getMarkerData(); StrutMetrics strutMetrics = box.getMarkerData().getStructMetrics(); if (markerData.getReferenceLine() != null) { return markerData.getReferenceLine().getAbsY() + strutMetrics.getBaseline(); } else { return box.getAbsY() + box.getTy() + strutMetrics.getBaseline(); } }
private static int getReferenceBaseline(RenderingContext c, BlockBox box) { MarkerData markerData = box.getMarkerData(); StrutMetrics strutMetrics = box.getMarkerData().getStructMetrics(); if (markerData.getReferenceLine() != null) { return markerData.getReferenceLine().getAbsY() + strutMetrics.getBaseline(); } else { return box.getAbsY() + box.getTy() + strutMetrics.getBaseline(); } }
Rectangle contentBounds = replaced.getContentAreaEdge( replaced.getAbsX(), replaced.getAbsY(), c); // Minor hack: It's inconvenient to adjust for margins, border, padding during // layout so just do it here. Point loc = replaced.getReplacedElement().getLocation(); if (contentBounds.x != loc.x || contentBounds.y != loc.y) { replaced.getReplacedElement().setLocation(contentBounds.x, contentBounds.y); } if (! c.isInteractive() || replaced.getReplacedElement().isRequiresInteractivePaint()) { c.getOutputDevice().paintReplacedElement(c, replaced); } } public boolean isRootLayer() {