Package org.eclipse.swt.graphics

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


    Image image = new Image(SWTThread.getInstance().getDisplay(), newWidth,
        newHeight);
    Color color;
    GC gcImage = new GC(image);
    gcImage.setForeground(Colors.grey);
    gcImage.drawRectangle(0, 0, x1 + 1, y1 + 1);
    int blocksPerPixel = 0;
    int iPixelsPerBlock = 0;
    int pxRes = 0;
    long pxBlockStep = 0;
    int factor = 4;
View Full Code Here


        gcBuffer.drawLine(1,i+1,bounds.width-1,i+1);
      }      
      gcBuffer.setForeground(Colors.black);
      gcBuffer.drawLine(bounds.width-70,0,bounds.width-70,bounds.height-1);   
     
      gcBuffer.drawRectangle(0,0,bounds.width-1,bounds.height-1);
      gcBuffer.dispose();
    }
  }
 
  public void dispose() {
View Full Code Here

            PAD_TOP + usable_height - ( draw_y + draw_z ));
      }
       
      image.setForeground( Colors.black );
     
      image.drawRectangle( bounds.x, bounds.y, bounds.width-1, bounds.height-1 );
     
      int  font_height = image.getFontMetrics().getHeight();
      int char_width  = image.getFontMetrics().getAverageCharWidth();
     
        // x axis
View Full Code Here

      // draw border
      gcImage = new GC(image);
      gcImage.setForeground(Colors.grey);
      if (borderHorizontalSize > 0) {
        if (borderVerticalSize > 0) {
          gcImage.drawRectangle(0, 0, newWidth - 1, newHeight - 1);
        } else {
          gcImage.drawLine(0, 0, newWidth - 1, 0);
          gcImage.drawLine(0, newHeight - 1, newWidth - 1, newHeight - 1);
        }
      } else if (borderVerticalSize > 0) {
View Full Code Here

      gc.setBackground(color);
      gc.fillRectangle(0, 0, 32, 10);

      gc.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_BLACK));
      gc.drawRectangle(0, 0, 31, 9);

      gc.dispose();

      fColorItem.setImage(fColorImage);
    }
View Full Code Here

    gc.setBackground(color);
    gc.fillRectangle(0, 0, 12, 12);

    gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
    gc.drawRectangle(0, 0, 11, 11);

    gc.dispose();
    color.dispose();

    return image;
View Full Code Here

   
    Display display= fButton.getDisplay();
   
    GC gc= new GC(fImage);
    gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
    gc.drawRectangle(0, 2, fExtent.x - 1, fExtent.y - 4);
   
    if (fColor != null)
      fColor.dispose();
     
    fColor= new Color(display, fColorValue);
View Full Code Here

        final Image img = new Image(Display.getCurrent(), new Rectangle(2, 3, 20, 8));

        final GC graphic = new GC(img);
        graphic.setForeground(new Color(Display.getCurrent(), 60, 140, 10));
        graphic.setBackground(new Color(Display.getCurrent(), 60, 140, 10));
        graphic.drawRectangle(0, 0, 18, 6);
        graphic.fillRectangle(1, 1, (int) (17 * percentage / 100), 5);

        return img;
    }

View Full Code Here

        final Display display = fButton.getDisplay();

        final GC gc = new GC(fImage);
        gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
        gc.drawRectangle(0, 2, fExtent.x - 1, fExtent.y - 4);

        if (fColor != null) {
            fColor.dispose();
        }
View Full Code Here

     */
    protected void updateColorImage() {
        Display display = fButton.getDisplay();
        GC gc = new GC(fImage);
        gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
        gc.drawRectangle(0, 2, fExtent.x - 1, fExtent.y - 4);
        if (fColor != null) {
      fColor.dispose();
    }
        fColor = new Color(display, fColorValue);
        gc.setBackground(fColor);
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.