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()); }
protected void fillShape(Graphics g) { try { g.pushState(); g.setBackgroundColor(ColorConstants.white); super.fillShape(g); } finally { g.popState(); } }
Color color = new Color(Display.getCurrent(), rgbs[0]); graphics.pushState(); graphics.setBackgroundColor(color); for (int i = 0; i < dottedCount; i++) { graphics.fillOval(beginX + (pad + width * i) * xRate, beginY
graphics.pushState(); Color color = new Color(Display.getCurrent(), rgbs[0]); graphics.setBackgroundColor(color); for (int i = 0; i < dottedCount; i++) { graphics.fillRectangle(beginX + (pad + width * i) * xRate, beginY
public void paint(Graphics graphics) { super.paint(graphics); graphics.pushState(); try { // Fill for the header section // Rectangle r = getBounds().getCopy(); graphics.setBackgroundColor(ColorConstants.lightGray); Color gradient1 = isReadOnly ? gradientColor[1] : headerColor; if (isSelected && isReadOnly) gradient1 = gradientColor[3]; else if (isSelected && !isReadOnly) gradient1 = gradientColor[2]; Color gradient2 = gradientColor[0]; graphics.setForegroundColor(gradient1); graphics.setBackgroundColor(gradient2); Rectangle labelBounds = label.getBounds(); graphics.fillGradient(r.x+1, r.y+1, r.width-2, labelBounds.height - 2, true); graphics.setForegroundColor(ColorConstants.darkGray); label.paint(graphics); } finally { graphics.popState(); } }
graphics.setBackgroundColor(ColorConstants.lightGray); graphics.fillGradient(r.x, r.y, r.width, 1, false);
g.setBackgroundColor(ColorConstants.black); g.fillArc(centerX - 1, centerY - cycleWidth / 2 - 1, 4, 4, 0, 360);
int top = rect.y + BORDERTHICK; int height = rect.height - BORDERTHICK * 2; g.setBackgroundColor(ColorConstants.button); g.fillRectangle(left, top, width, height);
g.setBackgroundColor(selectionBackColor); g.setBackgroundColor(selectionBackColor); int partialStart = frag._offset > start ? frag._offset : start; g.setBackgroundColor(originalBackgroud);
/** * 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); } }
if (bg instanceof RGB) { rgbColor = new Color(null, (RGB) bg); g.setBackgroundColor(rgbColor); fillArea = true; } else if (bg instanceof Color) { g.setBackgroundColor((Color) bg); fillArea = true;
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 (color instanceof Color) { g.setForegroundColor((Color) color); g.setBackgroundColor((Color) color); } else if (color instanceof RGB) { newColor = new Color(Display.getCurrent(), (RGB) color); g.setForegroundColor(newColor); g.setBackgroundColor(newColor);
graphics.setBackgroundColor(ColorConstants.black);
g.setBackgroundColor(ColorConstants.button); g.fillRectangle(innerRect2); g.popState();