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 paintReplacedElement(RenderingContext c, BlockBox box) { ReplacedElement replaced = box.getReplacedElement(); if (replaced instanceof SwingReplacedElement) { Rectangle contentBounds = box.getContentAreaEdge(box.getAbsX(), box.getAbsY(), c); translate(contentBounds.x, contentBounds.y); JComponent component = ((SwingReplacedElement)box.getReplacedElement()).getJComponent(); component.print(_graphics); translate(-contentBounds.x, -contentBounds.y); } else if (replaced instanceof ImageReplacedElement) { Image image = ((ImageReplacedElement)replaced).getImage(); Point location = replaced.getLocation(); _graphics.drawImage( image, (int)location.getX(), (int)location.getY(), null); } }
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 paintReplacedElement(RenderingContext c, BlockBox box) { ReplacedElement replaced = box.getReplacedElement(); if (replaced instanceof SwingReplacedElement) { Rectangle contentBounds = box.getContentAreaEdge(box.getAbsX(), box.getAbsY(), c); JComponent component = ((SwingReplacedElement)box.getReplacedElement()).getJComponent(); RootPanel canvas = (RootPanel)c.getCanvas(); CellRendererPane pane = canvas.getCellRendererPane(); pane.paintComponent(_graphics, component, canvas, contentBounds.x, contentBounds.y, contentBounds.width, contentBounds.height,true); } else if (replaced instanceof ImageReplacedElement) { Image image = ((ImageReplacedElement)replaced).getImage(); Point location = replaced.getLocation(); _graphics.drawImage( image, (int)location.getX(), (int)location.getY(), null); } }
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); }
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() {
private void paintReplacedElement(RenderingContext c, BlockBox replaced) { 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 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(); } } }