Package org.locationtech.udig.project.ui.internal.render.displayAdapter.impl

Examples of org.locationtech.udig.project.ui.internal.render.displayAdapter.impl.ViewportPaneTiledSWT


            public void gullMoved( final Coordinate newLoc ) {
                Display.getDefault().asyncExec(new Runnable(){

                    private void scroll(int newx, int newy, int startx, int starty){
                        ViewportModelImpl vm =  (ViewportModelImpl)map.getViewportModel();
                        final ViewportPaneTiledSWT viewera = (ViewportPaneTiledSWT)viewer;
                       
                        org.eclipse.swt.graphics.Point p = Display.getCurrent().map((Canvas)viewera, null, newx, newy);
                        org.eclipse.swt.graphics.Point p2 = Display.getCurrent().map((Canvas)viewera, null, startx, starty);
                        int xdiff = p2.x - p.x;
                        int ydiff = p2.y - p.y;
                        ((Canvas)viewera).scroll(xdiff, ydiff, 0,0, map.getRenderManager().getMapDisplay().getWidth(), map.getRenderManager().getMapDisplay().getHeight(), true);
                       
                    }
                    public void run() {
                        ViewportModelImpl vm =  (ViewportModelImpl)map.getViewportModel();
                        final ViewportPaneTiledSWT viewera = (ViewportPaneTiledSWT)viewer;
                        final ReferencedEnvelope bounds = vm.getBounds();
                        Coordinate currentc = vm.getCenter();
                     
                        final Point newpnt = vm.worldToPixel(newLoc);
                        final Point oldpnt = vm.worldToPixel(currentc);
View Full Code Here


     * @param style Use SWT.SINGLE or SWT.MULTI to control the use of tiles,
     *      SWT.DOUBLE_BUFFERED and SWT.NO_BACKGROUND can be used to configure the canvas.
     */
    public MapViewer(Composite parent, int style) {
        if( (style & SWT.MULTI) == SWT.MULTI ){
            viewport = new ViewportPaneTiledSWT(parent, style, this );
        }
        else if( (style & SWT.SINGLE) == SWT.SINGLE){
            viewport = new ViewportPaneSWT(parent, style, this );           
        }
        else {
View Full Code Here

        }

        if (getMapDisplay() instanceof ViewportPaneTiledSWT){
            //clear the tiles from the viewport pane as well otherwise the tiles will
            //be out of sync
            ViewportPaneTiledSWT tiledpane = (ViewportPaneTiledSWT) getMapDisplay();
            tiledpane.clearCachedTiles();
            tiledpane.clearReadyTiles();
        }
       
        //remove all existing images so everything will be recreated
        disposeAllTiles();
        tileCache.clear();
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.ui.internal.render.displayAdapter.impl.ViewportPaneTiledSWT

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.