Package org.locationtech.udig.ui.graphics

Examples of org.locationtech.udig.ui.graphics.SWTGraphics


        int height = (int) Math.abs(screenbounds[3]-screenbounds[1]);
        //create transparent image
        image=AWTSWTImageUtils.createDefaultImage(Display.getDefault(), width, height);
       
        // draw feature
        SWTGraphics graphics=new SWTGraphics(image, Display.getDefault());
       
        drawing.drawFeature(graphics, feature,
                getMap().getViewportModel().worldToScreenTransform(envelope, new Dimension(width,height)), false, syms, mt);
        graphics.dispose();
    }
View Full Code Here


    public static ViewportGraphics createGraphics( GC gc, Display display, Dimension displaySize ) {
        if (Platform.getOS().equals(Platform.OS_LINUX))

            return new NonAdvancedSWTGraphics(gc, display, displaySize);

        return new SWTGraphics(gc, display);
    }
View Full Code Here

     * @return
     */
    private ViewportGraphics createSWTGraphics( Image image, Display display ) {
        if (Platform.getOS().equals(Platform.OS_LINUX))
            return new NonAdvancedSWTGraphics(image, display);
        return new SWTGraphics(image, display);
    }
View Full Code Here

    public static ViewportGraphics createGraphics( GC gc, Display display, Dimension displaySize ){
        if( Platform.getOS().equals(Platform.OS_LINUX) )
         
            return new NonAdvancedSWTGraphics(gc, display, displaySize);
       
        return new SWTGraphics(gc,display );
    }
View Full Code Here

     * @return
     */
    private ViewportGraphics createSWTGraphics( Image image, Display display ) {
        if( Platform.getOS().equals(Platform.OS_LINUX) )
            return new NonAdvancedSWTGraphics(image, display);
        return new SWTGraphics(image, display);
    }
View Full Code Here

        StyleBuilder builder = new StyleBuilder();
        Style rule = builder.createStyle(builder.createPolygonSymbolizer(Color.RED, Color.BLUE, 1));

        image = new Image(display, 16, 16);

        SWTGraphics graphics = new SWTGraphics(image, display);
        graphics.getGraphics(GC.class).setAntialias(SWT.OFF);
        graphics.setBackground(Color.WHITE);
        graphics.clearRect(0, 0, 16, 16);
        d.drawFeature(graphics, d.feature(d.polygon(new int[]{2, 2, 2, 14, 14, 14, 14, 2, 2, 2})),
                new AffineTransform(), rule);
        graphics.dispose();
        int blue = image.getImageData().palette.getPixel(new RGB(Color.BLUE.getRed(), Color.BLUE
                .getGreen(), Color.BLUE.getBlue()));
        int red = image.getImageData().palette.getPixel(new RGB(Color.RED.getRed(), Color.RED
                .getGreen(), Color.RED.getBlue()));
        int white = image.getImageData().palette.getPixel(new RGB(Color.WHITE.getRed(), Color.WHITE
View Full Code Here

        StyleBuilder builder = new StyleBuilder();
        Style style = builder.createStyle(builder.createLineSymbolizer(Color.BLUE, 3));

        image = new Image(display, 16, 16);

        SWTGraphics graphics = new SWTGraphics(image, display);
        graphics.getGraphics(GC.class).setAntialias(SWT.OFF);
        graphics.setBackground(Color.WHITE);
        graphics.clearRect(0, 0, 16, 16);
        d.drawFeature(graphics, d.feature(line), style, new AffineTransform());
        graphics.dispose();
        int blue = image.getImageData().palette.getPixel(new RGB(Color.BLUE.getRed(), Color.BLUE
                .getGreen(), Color.BLUE.getBlue()));
        int white = image.getImageData().palette.getPixel(new RGB(Color.WHITE.getRed(), Color.WHITE
                .getGreen(), Color.WHITE.getBlue()));
View Full Code Here

        graphic.setSize(builder.getFilterFactory().literal(5));
        Style style = builder.createStyle(builder.createPointSymbolizer(graphic));

        image = new Image(display, 16, 16);

        SWTGraphics graphics = new SWTGraphics(image, display);
        graphics.getGraphics(GC.class).setAntialias(SWT.OFF);
        graphics.setBackground(Color.WHITE);
        graphics.clearRect(0, 0, 16, 16);
        d.drawFeature(graphics, d.feature(point), style, new AffineTransform());
        graphics.dispose();
        int blue = image.getImageData().palette.getPixel(new RGB(Color.BLUE.getRed(), Color.BLUE.getGreen(), Color.BLUE.getBlue()));
        int white = image.getImageData().palette.getPixel(new RGB(Color.WHITE.getRed(), Color.WHITE.getGreen(), Color.WHITE.getBlue()));

        for( int y = 0; y < 16; y++ ) {
            for( int x = 0; x < 16; x++ ) {
View Full Code Here

            }

            ViewportGraphics swtGraphics = null;
           
            if (useAdvancedGraphics) {
              swtGraphics = new SWTGraphics(buffer, display);
            } else {
              swtGraphics = new NonAdvancedSWTGraphics(buffer, display);
            }

            painter.paint(swtGraphics, swtImage, minWidth, minHeight);
            swtGraphics.dispose();

            gc.drawImage(buffer, 0, 0);
        }else{

          ViewportGraphics swtGraphics = null;
         
          if (useAdvancedGraphics) {
            swtGraphics = new SWTGraphics(gc, display);
          } else {
            swtGraphics = new NonAdvancedSWTGraphics(gc, display, null);
          }
            painter.paint(swtGraphics, swtImage, minWidth, minHeight);
            swtGraphics.dispose();
View Full Code Here

            }        

            ViewportGraphics swtGraphics = null;
           
            if (useAdvancedGraphics ) {
              swtGraphics = new SWTGraphics(buffer, display);
            } else {
              swtGraphics = new NonAdvancedSWTGraphics(buffer, display);
            }
            if (renderManager.getViewportModelInternal().isBoundsChanging() ) {
                swtGraphics.getGraphics(GC.class).setAdvanced(false);
            }
            painter.paint(swtGraphics, tiles, minWidth, minHeight);
            swtGraphics.dispose();

            gc.drawImage(buffer, 0, 0);
        }else{

          ViewportGraphics swtGraphics = null;
         
          if (useAdvancedGraphics ) {
            swtGraphics = new SWTGraphics(gc, display);
          } else {
            swtGraphics = new NonAdvancedSWTGraphics(gc, display, null);
          }
          if (renderManager.getViewportModelInternal().isBoundsChanging() ) {
              swtGraphics.getGraphics(GC.class).setAdvanced(false);
View Full Code Here

TOP

Related Classes of org.locationtech.udig.ui.graphics.SWTGraphics

Copyright © 2018 www.massapicom. 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.