Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.GC.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


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

    public PixelConverter(final Control control) {
        final GC gc = new GC(control);
        gc.setFont(control.getFont());
        fFontMetrics = gc.getFontMetrics();
        gc.dispose();
    }

    /**
     * @see org.eclipse.jface.dialogs.DialogPage#convertHeightInCharsToPixels(int)
     */
 
View Full Code Here

        } catch (final IOException e) {
            // ignore TODO do something else?
            return null;
        } finally {
            gc.dispose();
        }
    }

    private String trim(final StringBuffer buffer, final TextPresentation presentation) {
        final int length = buffer.length();
View Full Code Here

        fFilterText = new Text(parent, SWT.NONE);
        // Set the font
        final GC gc = new GC(parent);
        gc.setFont(parent.getFont());
        final FontMetrics fontMetrics = gc.getFontMetrics();
        gc.dispose();
        // Create the layout
        final GridData data = new GridData(GridData.FILL_HORIZONTAL);
        data.heightHint = Dialog.convertHeightInCharsToPixels(fontMetrics, 1);
        data.horizontalAlignment = GridData.FILL;
        data.verticalAlignment = GridData.CENTER;
View Full Code Here

        final Font font = fSymbolicFontName == null ? JFaceResources.getDialogFont()
                : JFaceResources.getFont(fSymbolicFontName);
        gc.setFont(font);
        final int width = gc.getFontMetrics().getAverageCharWidth();
        final int height = gc.getFontMetrics().getHeight();
        gc.dispose();

        return new Point(widthInChars * width, heightInChars * height);
    }

}
View Full Code Here

                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

            } else if (corner == BOTTOM_LEFT) {
                gc.drawImage(decorator, 0, bib.height - dib.height);
            } else if (corner == BOTTOM_RIGHT) {
                gc.drawImage(decorator, bib.width - dib.width, bib.height - dib.height);
            }
            gc.dispose();
            //
            decoratedMap.put(decorator, result);
        }
        return result;
    }
View Full Code Here

            final GC newGC = new GC(screenImage);
            newGC.setClipping(clientRect);
            newGC.drawImage(sourceImage, imageRect.x, imageRect.y, imageRect.width,
                    imageRect.height, destRect.x, destRect.y, destRect.width,
                    destRect.height);
            newGC.dispose();

            gc.drawImage(screenImage, 0, 0);
        } else {
            gc.setClipping(clientRect);
            gc.fillRectangle(clientRect);
View Full Code Here

            if (i == 0) {
                // Compute and store a font metric
                final GC gc = new GC(tree);
                gc.setFont(tree.getFont());
                final FontMetrics fontMetrics = gc.getFontMetrics();
                gc.dispose();
                columnWidth = Math.max(100, fontMetrics.getAverageCharWidth() * 20);
            }

            // if (columnWidths != null) {
            // final Integer value = columnWidths.getInteger(getFieldId(column
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.