/** * @see Shape#fillShape(Graphics) */ @Override protected void fillShape ( final Graphics graphics ) { graphics.fillRectangle ( getBounds () ); }
/** * @see Shape#fillShape(Graphics) */ @Override protected void fillShape ( final Graphics graphics ) { graphics.fillRectangle ( getBounds () ); }
private static void fillBar(Graphics g, Rectangle rect) { g.setBackgroundColor(ColorConstants.button); g.fillRectangle(rect); }
protected void paintFigure(Graphics graphics) { graphics.setXORMode(true); graphics.setBackgroundColor(ColorConstants.darkGray); graphics.fillRectangle(getBounds()); }
public void paint(Graphics graphics) { graphics.fillRectangle(getBounds()); super.paint(graphics); boolean isFirst = false; for (Iterator i = getChildren().iterator(); i.hasNext();) { Figure figure = (Figure) i.next(); if (isFirst) { isFirst = false; } else { Rectangle r = figure.getBounds(); graphics.drawLine(r.x, r.y + 1, r.x + r.width, r.y + 1); } } } };
graphics.setBackgroundColor(color); for (int i = 0; i < dottedCount; i++) { graphics.fillRectangle(beginX + (pad + width * i) * xRate, beginY + (pad + height * i) * yRate, width, height); if (i != dottedCount - 1) {
protected void paintFigure(Graphics graphics) { if (isOpaque()) { graphics.fillRectangle(getBounds()); } Rectangle bounds1 = getBounds(); graphics.translate(bounds1.x, bounds1.y); drawText(graphics); graphics.translate(-bounds1.x, -bounds1.y); }
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(); } }
/** * Draws the handle with fill color and outline color dependent * on the primary selection status of the owner editpart. * * @param g The graphics used to paint the figure. */ public void paintFigure(Graphics g) { Rectangle r = getBounds(); r.shrink(1, 1); try { g.setBackgroundColor(getFillColor()); g.setAlpha(getAlpha()); g.fillRectangle(r.x, r.y, r.width, r.height); g.setForegroundColor(getBorderColor()); g.drawRectangle(r.x, r.y, r.width, r.height); } finally { //We don't really own rect 'r', so fix it. r.expand(1, 1); } }
int height = rect.height - BORDERTHICK * 2; g.setBackgroundColor(ColorConstants.button); g.fillRectangle(left, top, width, height);
g.setBackgroundColor(selectionBackColor); .fillRectangle(frag._x, frag._y, FlowUtilities .getTextExtents(draw, font).width, frag .getHeight()); Dimension dimension = FlowUtilities.getTextExtents(skip + todraw, font); g.fillRectangle(frag._x + x, frag._y, dimension.width - x, dimension.height); g.drawText(skip + todraw, frag._x, frag._y);
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); }
if (obj instanceof FlowBox) { FlowBox box = (FlowBox) obj; g.fillRectangle(box._x, box._y, box.getWidth(), box .getHeight());
g.fillRectangle(innerRect2); g.popState();
case CounterHelper.LIST_T_SQUARE: drawArea = getDrawAreaForGraph(DISC_DIAMETER, DISC_DIAMETER); g.fillRectangle(drawArea); case CounterHelper.LIST_T_DECIMAL_LEADING_ZERO: case CounterHelper.LIST_T_LOWER_GREEK: