Package org.locationtech.udig.project.command

Examples of org.locationtech.udig.project.command.SetLayerVisibilityCommand


                return; // not available?
            }
            graphLayer = (ILayer) added.get(0);           
        }
        if( !graphLayer.isVisible() ){
            map.sendCommandASync( new SetLayerVisibilityCommand(graphLayer, true) );
        }
       
        for( ILayer look : map.getMapLayers() ){
            URL id = look.getGeoResource().getIdentifier();
            if(PATH_ID.equals(id) ){
                pathLayer = look;
                break;
            }
        }
        if( pathLayer == null ){           
            ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();
            IGeoResource resource = catalog.getById(IGeoResource.class, PATH_ID, new NullProgressMonitor() );
            if( resource == null ){
                return; // not available?
            }
            List<IGeoResource> resourceList = Collections.singletonList( resource );           
            List< ? extends ILayer> added = ApplicationGIS.addLayersToMap(map, resourceList, 0 );
            if( added.isEmpty() ){
                return; // not available?
            }
            pathLayer = (ILayer) added.get(0);           
        }
        if( !pathLayer.isVisible() ){
            map.sendCommandASync( new SetLayerVisibilityCommand(pathLayer, true) );
        }
        pathLayer.refresh(null);
    }
View Full Code Here


    private void setGridLayerVisibility( ILayer gridLayer, boolean enabled ) {
        if( enabled!=gridLayer.isVisible() ) {
            if( enabled ) {
                gridLayer.getBlackboard().putString(KEY, KEY);
            }
            gridLayer.getMap().sendCommandASync(new SetLayerVisibilityCommand(gridLayer, enabled) );
        }
    }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.command.SetLayerVisibilityCommand

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.