Package org.eclipse.swt.graphics

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


        if( rect != null ) {
          area.x = rect.x;
        }
        gc.fillRectangle(area);
      } else {
        gc.fillRectangle(event.getBounds());
      }
     
      event.detail &= ~SWT.SELECTED;
    }
  }
View Full Code Here


    GC gc = event.gc;
    gc.setBackground(cell.getViewerRow().getBackground(
        cell.getColumnIndex()));
    gc.setForeground(cell.getViewerRow().getForeground(
        cell.getColumnIndex()));
    gc.fillRectangle(cell.getBounds());
    event.detail &= ~SWT.SELECTED;
  }

  private void hookListener(final ColumnViewer viewer) {
View Full Code Here

        fExtent= computeImageSize(parent);
        fImage= new Image(parent.getDisplay(), fExtent.x, fExtent.y);
       
        GC gc= new GC(fImage);
        gc.setBackground(fButton.getBackground());
        gc.fillRectangle(0, 0, fExtent.x, fExtent.y);
        gc.dispose();
       
        fButton.setImage(fImage);
        fButton.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent event) {
View Full Code Here

        if (fColor != null)
            fColor.dispose();
           
        fColor= new Color(display, fColorValue);
        gc.setBackground(fColor);
        gc.fillRectangle(1, 3, fExtent.x - 2, fExtent.y - 5);
        gc.dispose();
       
        fButton.setImage(fImage);
    }
   
View Full Code Here

      }
      gc.setAlpha(alpha);
      gc.setAntialias(SWT.ON);
    }
    gc.setBackground(customBackground);
    gc.fillRectangle(x, y, 2, height);
    gc.fillRoundRectangle(x, y, width, height, 4, 4);

    gc.setAlpha(oldAlpha);
    gc.setAntialias(oldAnti);
View Full Code Here

  private void paint(PaintEvent e) {
    GC gc = e.gc;
    Display display = getDisplay();

    Rectangle rectangle = getClientArea();
    gc.fillRectangle(rectangle);
    drawBorder(gc, rectangle.x, rectangle.y, rectangle.width - 1, rectangle.height - 1,
        display.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW),
        display.getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));

    gc.setBackground(currentColor);
View Full Code Here

        display.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW),
        display.getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));

    gc.setBackground(currentColor);
    barWidth = Math.min(rectangle.width - 2, barWidth);
    gc.fillRectangle(1, 1, barWidth, rectangle.height - 2);
  }

  private void paintStep(PaintEvent e, int startX, int endX) {
    GC gc = e.gc;
    gc.setBackground(currentColor);
View Full Code Here

  private void paintStep(PaintEvent e, int startX, int endX) {
    GC gc = e.gc;
    gc.setBackground(currentColor);
    Rectangle rectangle = getClientArea();
    startX = Math.max(1, startX);
    gc.fillRectangle(startX, 1, endX - startX, rectangle.height - 2);
  }

  private void drawBorder(GC gc, int x, int y, int width, int height, Color topLeft,
      Color bottomRight) {
    gc.setForeground(topLeft);
View Full Code Here

public static void main (String [] args) {
  Display display = new Display ();
  Image image = new Image(display, 16, 16);
  GC gc = new GC(image);
  gc.setBackground(display.getSystemColor(SWT.COLOR_BLUE));
  gc.fillRectangle(0, 0, 16, 16);
  gc.setBackground(display.getSystemColor(SWT.COLOR_YELLOW));
  gc.fillRectangle(3, 3, 10, 10);
  gc.dispose();
  final Shell shell = new Shell (display);
  shell.setLayout(new GridLayout());
View Full Code Here

  Image image = new Image(display, 16, 16);
  GC gc = new GC(image);
  gc.setBackground(display.getSystemColor(SWT.COLOR_BLUE));
  gc.fillRectangle(0, 0, 16, 16);
  gc.setBackground(display.getSystemColor(SWT.COLOR_YELLOW));
  gc.fillRectangle(3, 3, 10, 10);
  gc.dispose();
  final Shell shell = new Shell (display);
  shell.setLayout(new GridLayout());
  final CTabFolder folder = new CTabFolder(shell, SWT.BORDER);
  folder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
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.