Package org.eclipse.swt.graphics

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


        if (colorTable != null) {
            Iterator e = colorTable.values().iterator();
            while (e.hasNext()) {
                Color color = (Color) e.next();
                if (color != null && !color.isDisposed()) {
                    color.dispose();
                }
            }
        }
    }
View Full Code Here


                // Left & Right edges
                drawLine(e.gc, 0, 1, 0, maxY-1, flipXY);
                drawLine(e.gc, maxX, 5, maxX, maxY-5, flipXY);
               
                // Dispose the color since we created it...
                outerColor.dispose();
               
                // Draw the 'inner' curve
                e.gc.setForeground (white);

                drawLine(e.gc, 1, 1, maxX-5, 1, flipXY);
View Full Code Here

            if (monitor.isCanceled()) return;
           
            Color blue = colorScheme().getWaterColor().asSWTColor(gc.getDevice());
            gc.setBackground(blue);
            gc.fillRectangle(gc.getClipping());
            blue.dispose();
    }

    private void paintDraft(ProgressMonitor monitor, GC gc, MapInstance map) {
        if (monitor.isCanceled()) return;
        if (map == null) return;
View Full Code Here

        for (Location each: map.locations()) {
            if (monitor.isCanceled()) break;
            int r = (int) (each.getElevation() * 2 * map.getWidth() / DEMAlgorithm.MAGIC_VALUE);
            gc.drawOval(each.px - r, each.py - r, r * 2, r * 2);
        }
        shore.dispose();
    }

    private void paintHills(ProgressMonitor monitor, GC gc, MapInstance mapInstance, DigitalElevationModel elevationModel, HillShading hillShading, MapScheme<MColor> colors) {
        if (monitor.isCanceled()) return;
        if (hillShading == null) return;
View Full Code Here

        // getting it via SWT.COLOR_BLACK raises invalid Thread access
        // and it don't want to fire up a runnable here ...
        Color black = new Color(gc.getDevice(), 0, 0, 0);
        gc.setBackground(black);
        gc.fillRectangle(gc.getClipping());
        black.dispose();
       
        Image background = new FastBackgroundRenderer(DEM, shade, mapInstance, colors, gc.getDevice()).render();
       

        gc.drawImage(background, 0, 0);
View Full Code Here

        gc.setForeground(color1);
        gc.setBackground(color2);

        gc.fillGradientRectangle(x, y, width, height, isVertical);
        color1.dispose();
        color2.dispose();
    }

    /**
     * Converts SWT FontData to a AWT Font
     *
 
View Full Code Here

        book = new PageBook(parent, SWT.NONE);
        summary = new Text(book, SWT.V_SCROLL | SWT.READ_ONLY | SWT.WRAP | SWT.BORDER);
        summary.setText(""); //$NON-NLS-1$
        Color white = new Color(parent.getDisplay(), 255, 255, 255);
        summary.setBackground(white);
        white.dispose();

        CatalogPlugin.addListener(sync);
        book.showPage(summary);
        return book;
    }
View Full Code Here

        gc.setForeground(color1);
        gc.setBackground(color2);

        gc.fillGradientRectangle(x, y, width, height, isVertical);
        color1.dispose();
        color2.dispose();
    }
}
View Full Code Here

        if (color == null) {
            colorRegistry.put(systemColorName, new RGB(red, green, blue));

        } else if (color.getRed() != red || color.getGreen() != green
                || color.getBlue() != blue) {
            color.dispose();
            color = null;
            colorRegistry.put(systemColorName, new RGB(red, green, blue));
        }
    }
View Full Code Here

            colorSquareGC.fillRectangle(
                    MARGIN_LEFT,
                    MARGIN_TOP,
                    width - 2 * MARGIN_LEFT,
                    height - 2 * MARGIN_TOP);
            newColor.dispose();
        }
        button.setImage(colorSquare);
        colorSquareGC.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.