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 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 paintReplacedElement(RenderingContext c, BlockBox box) { ReplacedElement replaced = box.getReplacedElement(); java.awt.Point location = replaced.getLocation(); if (replaced instanceof ImageReplacedElement) { drawImage(((ImageReplacedElement) replaced).getImage(), location.x, location.y); } else if (replaced instanceof FormControlReplacementElement) { SWTFormControl swtControl = ((FormControlReplacementElement) replaced) .getControl(); swtControl.getSWTControl().setVisible(true); } }
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); } }
Point location = getReplacedElement().getLocation(); if (location.x != getAbsX() || location.y != getAbsY()) { getReplacedElement().setLocation(getAbsX(), getAbsY());
Point location = getReplacedElement().getLocation(); if (location.x != getAbsX() || location.y != getAbsY()) { getReplacedElement().setLocation(getAbsX(), getAbsY());