public void paintFigure(Graphics g, Rectangle rect) { if (_image != null) { g.drawImage(_image, 0, 0, _imageWidth, _imageHeight, rect.x, rect.y, rect.width, rect.height); } } }
public void paintFigure(Graphics g) { List fragments = getFragmentsForRead(); if (!fragments.isEmpty()) { FlowBox box = (FlowBox) fragments.get(0); g.drawImage(getSharedHTMLImage(), new Point(box._x, box._y)); } }
protected void fillShape(Graphics g) { super.fillShape(g); if (image != null) { Rectangle r = getBounds(); Dimension imageSize = new Dimension(15, 15); g.drawImage(image, r.x + (r.width - imageSize.width)/2, r.y + (r.height - imageSize.height)/2 - 1); } }
public void paintFigure(Graphics g, org.eclipse.draw2d.geometry.Rectangle rect) { g.fillRectangle(rect); g.setClip(rect); int imageAreaWidth = Math.min(rect.width, _imageWidth); int imageAreaHeight = Math.min(rect.height, _imageHeight); if (_image != null && !_image.isDisposed()) { g.drawImage(_image, 0, 0, _imageWidth, _imageHeight, rect.x, rect.y + (rect.height - imageAreaHeight) / 2, imageAreaWidth, imageAreaHeight); } if (_label != null && _labelVisible) { int leading = 0; if (_fontMetrics != null) { leading = _fontMetrics.getLeading(); } // TODO: adapt to bg: go lighter on colors that darker() would make black // TODO: color registry Color fg = FigureUtilities.darker(g.getBackgroundColor()); g.setForegroundColor(fg); g.drawString(_label, imageAreaWidth + GAP, rect.y + (rect.height - getLabelHeight()) / 2 + leading); fg.dispose(); } }
protected void paintFigure(Graphics graphics) { super.paintFigure(graphics); if (getImage() == null) return; Rectangle srcRect = new Rectangle(getImage().getBounds()); graphics.drawImage(getImage(), srcRect, getClientArea()); }
public void paintFigure(Graphics graphics) { super.paintFigure(graphics); final Image moveImage = PDPlugin.getDefault().getImage("MoveHandle.png"); Point topLeft = getBounds().getTopLeft().getCopy(); topLeft.performTranslate(3,3); graphics.drawImage(moveImage, topLeft); } }
public void paintFigure(Graphics g) { // TODO: could we use an image label toggle button here instead? Image arrowImage = null; if (_stateMachine.isMenuShowing()) { arrowImage = PDPlugin.getDefault().getImage("pin_down.gif"); } else { arrowImage = PDPlugin.getDefault().getImage("pin_up.gif"); } Rectangle r = getBounds(); g.setAlpha(75); g.setBackgroundColor(getFillColor()); g.fillRectangle(r.x, r.y, r.width, r.height); g.setAlpha(getAlpha()); g.drawImage(arrowImage, r.x+1, r.y+1); g.setForegroundColor(getBorderColor()); g.drawRectangle(r.x, r.y, r.width-1, r.height-1); }