Examples of drawRectangle()


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

        final Image img = new Image(Display.getCurrent(), new Rectangle(2, 3, 20, 8));

        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

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

        final Display display = fButton.getDisplay();

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

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

     */
    protected void updateColorImage() {
        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);
        gc.setBackground(fColor);
View Full Code Here

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

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

        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

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

        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

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

        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

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

                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

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

            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

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

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