Package org.eclipse.swt.graphics

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


    TableColumn column2= new TableColumn(table, SWT.NONE);
    column2.setText(columnValue);
    minWidth= computeMinimumColumnWidth(gc, columnValue);
    columnLayout.setColumnData(column2, new ColumnWeightData(3, minWidth, true));
   
    gc.dispose();

    fTableViewer= new TableViewer(table);
    fTableViewer.setLabelProvider(new TemplateLabelProvider());
    fTableViewer.setContentProvider(new TemplateContentProvider());
View Full Code Here


      GC gc = new GC(spinner);
      try {
        Point extent = gc.textExtent("X");//$NON-NLS-1$
        gd.widthHint = widthInChars * extent.x;
      } finally {
        gc.dispose();
      }
    } else {
      gd.horizontalAlignment = GridData.FILL;
      gd.grabExcessHorizontalSpace = true;
    }
View Full Code Here

 
  public void writeScreenShot(OutputStream to){
    Image screenShot = new Image(parent.getDisplay(), (int)viewPortSize.getX()+1 ,(int)viewPortSize.getY()+1);
    GC gc = new GC(parent);
    gc.copyArea(screenShot, 0,0);
    gc.dispose();
    ImageLoader il = new ImageLoader();
    il.data = new ImageData[] {screenShot.getImageData()};
    il.save(to, SWT.IMAGE_PNG);
  }
 
View Full Code Here

    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) {
        ColorDialog colorDialog= new ColorDialog(fButton.getShell());
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);
  }
 
  protected Point computeImageSize(Control window) {
View Full Code Here

  protected Point computeImageSize(Control window) {
    GC gc= new GC(window);
    Font f= JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT);
    gc.setFont(f);
    int height= gc.getFontMetrics().getHeight();
    gc.dispose();
    Point p= new Point(height * 3 - 6, height);
    return p;
  }
}
View Full Code Here

  protected void initializeDialogUnits(Control testControl) {
    // Compute and store a font metric
    GC gc = new GC(testControl);
    gc.setFont(JFaceResources.getDialogFont());
    fontMetrics = gc.getFontMetrics();
    gc.dispose();
  }

  public int convertHorizontalDLUsToPixels(Composite comp, int x) {
    if (fontMetrics == null) {
      initializeDialogUnits(comp);
View Full Code Here

      GC gc = new GC(newImage);
      gc.setAntialias(SWT.ON);
      gc.setInterpolation(SWT.HIGH);
      gc.drawImage(oldImage, 0, 0, oldImage.getBounds().width, oldImage.getBounds().height, 0, 0, newWidth,
          newHeight);
      gc.dispose();
      oldImage.dispose();
      return newImage;
    }

  }
View Full Code Here

  protected static void initializeDialogUnits(Control testControl) {
    // Compute and store a font metric
    GC gc = new GC(testControl);
    gc.setFont(JFaceResources.getDialogFont());
    fontMetrics = gc.getFontMetrics();
    gc.dispose();
  }

  /**
   * Returns a width hint for a button control.
   */
 
View Full Code Here

        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() {

            @Override
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.