Package org.eclipse.swt.graphics

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


    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


    this.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent e) {
        GC gc = e.gc;
       
        gc.setBackground(success ? green : red);
        gc.fillRectangle(0, 0, getFillWidth(), getBounds().height);
      }
    });
  }
 
  private int getFillWidth() {
View Full Code Here

            color = new Color(Display.getCurrent(), 255, 255, 255);
        }

        graphic.setForeground(color);
        graphic.setBackground(color);
        graphic.fillRectangle(0, 0, 12, 12);

        return img;
    }

}
View Full Code Here

        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

        fExtent = computeImageSize(parent);
        fImage = new Image(parent.getDisplay(), fExtent.x, fExtent.y);

        final 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() {
View Full Code Here

            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

        final Image image = new Image(Display.getCurrent(), MISSING_IMAGE_SIZE,
                MISSING_IMAGE_SIZE);
        //
        final GC gc = new GC(image);
        gc.setBackground(getColor(SWT.COLOR_RED));
        gc.fillRectangle(0, 0, MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE);
        gc.dispose();
        //
        return image;
    }
View Full Code Here

        fButton = new Button(parent, SWT.PUSH);
        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) {
                open();
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

        Rectangle area = event.getBounds();
        Rectangle rect = cell.getTextBounds();
        if( rect != null ) {
          area.x = rect.x;
        }
        gc.fillRectangle(area);
      } else {
        gc.fillRectangle(event.getBounds());
      }
     
      event.detail &= ~SWT.SELECTED;
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.