Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.GC.fillRectangle()


    GC gc = new GC(img);
   
    Color white = ColorCache.getColor(display,255,255,255);
    gc.setForeground(white);
    gc.setBackground(white);
    gc.fillRectangle(size);
   
    Color blue = ColorCache.getColor(display,66,87,104);
    gc.setForeground(blue);
    gc.setBackground(blue);
   
View Full Code Here


    int y = getY();
    int height = getBarHeight();
    int width = getBarWidth();
   
    gc.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    gc.fillRectangle(0, y-pointer_height, getClientArea().width, pointer_height*2 + bar_height);
   
    // draw bar
    gc.setBackground(barBackgroundColor);
    gc.fillRectangle(x - bar_margin, y,width + bar_margin*2,height);
   
 
View Full Code Here

    gc.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    gc.fillRectangle(0, y-pointer_height, getClientArea().width, pointer_height*2 + bar_height);
   
    // draw bar
    gc.setBackground(barBackgroundColor);
    gc.fillRectangle(x - bar_margin, y,width + bar_margin*2,height);
   
    // draw used segment
    gc.setBackground(barUsedSegmentColor);
    int up_coord = getUpCoord();
    int down_coord = getDownCoord();
View Full Code Here

                   0,0, rBlockViewBounds.width, rBlockViewBounds.height);
*/     

      lastBackColor = getRowBackground(table);
      gc.setBackground(lastBackColor);
      gc.fillRectangle(clipping);
/*     
      Rectangle imageBounds = image.getBounds();
      Rectangle r = canvasBounds.intersection(tableBounds);
      int x = (r.width - imageBounds.width) / 2;
      if (x <= 0)
View Full Code Here

          return;
   
        Rectangle bounds = item.getBounds(0);
        GC gc = new GC(table);
        gc.setBackground(blue);
        gc.fillRectangle(oldPoint.x,oldPoint.y,bounds.width,2);
        gc.dispose();
      }
    });

    shell.pack();
View Full Code Here

      expandRegion(event, scrollable, gc, clArea);

      /* Draw Rectangle */
      Color oldBackground = gc.getBackground();
      gc.setBackground(OwlUI.getColor(fResources, label));
      gc.fillRectangle(0, itemRect.y, clArea.width, itemRect.height);
      gc.setBackground(oldBackground);
      gc.setForeground(scrollable.getDisplay().getSystemColor(SWT.COLOR_WHITE));

      /* Mark as Selected being handled */
      event.detail &= ~SWT.SELECTED;
View Full Code Here

      expandRegion(event, scrollable, gc, clArea);

      /* Draw Rectangle */
      Color oldBackground = gc.getBackground();
      gc.setBackground(fStickyBgColor);
      gc.fillRectangle(0, itemRect.y, clArea.width, itemRect.height);
      gc.setBackground(oldBackground);

      /* Mark as Background being handled */
      event.detail &= ~SWT.BACKGROUND;
    }
View Full Code Here

      if (backgroundImage != null) {
        // draw a background image behind the text
        Rectangle imageRect = backgroundImage.getBounds();
        // tile image to fill space
        gc.setBackground(getBackground());
        gc.fillRectangle(rect);
        int xPos = 0;
        while (xPos < rect.width) {
          int yPos = 0;
          while (yPos < rect.height) {
            gc.drawImage(backgroundImage, xPos, yPos);
View Full Code Here

        // draw a gradient behind the text
        final Color oldBackground = gc.getBackground();
        if (gradientColors.length == 1) {
          if (gradientColors[0] != null)
            gc.setBackground(gradientColors[0]);
          gc.fillRectangle(0, 0, rect.width, rect.height);
        } else {
          final Color oldForeground = gc.getForeground();
          Color lastColor = gradientColors[0];
          if (lastColor == null)
            lastColor = oldBackground;
View Full Code Here

              pos += gradientWidth;
            }
          }
          if (gradientVertical && pos < rect.height) {
            gc.setBackground(getBackground());
            gc.fillRectangle(0, pos, rect.width, rect.height - pos);
          }
          if (!gradientVertical && pos < rect.width) {
            gc.setBackground(getBackground());
            gc.fillRectangle(pos, 0, rect.width - pos, rect.height);
          }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.