Package org.eclipse.swt.graphics

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


       
        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


        gc.setBackground(fill);
        gc.fillRectangle(2, 2, w - 4, h - 4);

        gc.setForeground(line);
        gc.setLineWidth(width);
        gc.drawRectangle(2, 2, w - 4, w - 4);

        return descriptor(imageData, image, gc);
    }
   
    public static ImageDescriptor raster( int lineColor, int fillColor, int width ) {
View Full Code Here

        gc.setBackground(fill);
        gc.fillRectangle(2, 2, w - 4, h - 4);

        gc.setForeground(line);
        gc.setLineWidth(width);
        gc.drawRectangle(2, 2, w - 4, w - 4);

        return descriptor(imageData, image, gc);
    }
}
View Full Code Here

        GC gc = new GC(newImage);

        if (bandIndex < 0 || bandIndex > histogramData.length) {
            // draw border and return nothing
            gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
            gc.drawRectangle(0, 0, bounds.width - 1, bounds.height - 1);
            return;
        }

        int[] histValues = histogramData[bandIndex];
        int max = -1;
View Full Code Here

                if (i % inc == 0) {
                    // show the average value so no data is skipped
                    values = values / cnt;
                    int height = (int) (((bounds.height - 1) * values) / max);
                    if (height > 0) {
                        gc.drawRectangle(i * size, (bounds.height - 1), size, -height);
                    }
                    values = 0;
                    cnt = 0;
                }
            }
View Full Code Here

            if (cnt > 0) {
                values = values / cnt;

                int height = (int) (((bounds.height - 1) * values) / max);
                if (height > 0) {
                    gc.drawRectangle(bounds.width - 2, (bounds.height - 1), size, -height);
                }
            }
            gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
            gc.drawRectangle(0, 0, bounds.width - 1, bounds.height - 1);

View Full Code Here

                if (height > 0) {
                    gc.drawRectangle(bounds.width - 2, (bounds.height - 1), size, -height);
                }
            }
            gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
            gc.drawRectangle(0, 0, bounds.width - 1, bounds.height - 1);

        } finally {
            gc.dispose();
            if (color2 != null) {
                color2.dispose();
View Full Code Here

    /**
     * @param index
     */
    protected void updateButtonColourDisplay( ColourScheme scheme, int index ) {
        GC gc = new GC(image);
        gc.drawRectangle(0, 2, fExtent.x, fExtent.y);
       
        if (swtColour != null)
            swtColour.dispose();

        Color clr = scheme.getColour(index);
View Full Code Here

                    gc.fillRectangle( 1, 1, imageSize.width-2, imageSize.height-2);
                    c.dispose();
                   
                    gc.setAlpha(150);
                    gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
                    gc.drawRectangle(1, 1, imageSize.width - 2, imageSize.height-2);
                   
                    ImageData clone = (ImageData) swtImage.getImageData().clone();               
                    swtImage.dispose();
                   
                    return clone;
View Full Code Here

                    gc.setBackground( c );
                    gc.fillRectangle( 1, 1, imageSize.width-2, imageSize.height-2);
                   
                    gc.setAlpha(150);
                    gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
                    gc.drawRectangle(1, 1, imageSize.width - 2, imageSize.height-2);
                   
                    c.dispose();
                   
                    ImageData clone = (ImageData) swtImage.getImageData().clone();               
                    swtImage.dispose();
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.