Examples of canResolve()


Examples of org.locationtech.udig.catalog.IGeoResource.canResolve()

        }
        if (resolve instanceof IResolveFolder ) {
          return CatalogUIPlugin.getDefault().getImage(ISharedImages.FOLDER_OBJ);
        }else if (resolve instanceof IGeoResource) {
            IGeoResource resource = (IGeoResource) resolve;
            boolean isFeature = resource.canResolve(FeatureSource.class);
            String iconId = iconInternalResource( resource.getID(), isFeature );
            return CatalogUIPlugin.getDefault().getImage( iconId );
        } else if (resolve instanceof IService) {
            IService service = (IService) resolve;
            boolean isFeature = service.canResolve(DataStore.class);
View Full Code Here

Examples of org.locationtech.udig.catalog.IGeoResource.canResolve()

    public void createPageContent( Composite parent ) {

        Layer layer = getSelectedLayer();
        IGeoResource resource = layer.getGeoResource();

        if (resource.canResolve(JGrassMapGeoResource.class)) {
            try {
                JGrassMapGeoResource grassMapGeoResource = resource.resolve(
                        JGrassMapGeoResource.class, null);
                if (grassMapGeoResource.getType().equals(JGrassConstants.GRASSBINARYRASTERMAP)) {
                    editorSupported = true;
View Full Code Here

Examples of org.locationtech.udig.catalog.IGeoResource.canResolve()

         * draw the graphic's border.
         */
        for( int i = context.getMapLayers().size() - 1; i >= 0; i-- ) {
            ILayer layer = context.getMapLayers().get(i);
            IGeoResource geoResource = layer.getGeoResource();
            boolean isMapgraphic = geoResource.canResolve(MapGraphicResource.class);
            if (!isMapgraphic && layer.isVisible()) {

                // String layerName = LayerGeneratedGlyphDecorator.generateLabel((Layer) layer);
                String layerName = layer.getName();
                if (layerName != null && layerName.length() != 0) {
View Full Code Here

Examples of org.locationtech.udig.catalog.IGeoResource.canResolve()

                    // dumpMap(coverage2D, fileCrs, newCrs, mapPath, isAscii, isTiff);
                    // }
                    // }
                    //
                    // } else
                    if (geoResource.canResolve(GridCoverage.class)) {
                        GridCoverage2D coverage2D = (GridCoverage2D) geoResource.resolve(GridCoverage.class, pm);
                        dumpMap(coverage2D, fileCrs, newCrs, newPath, isAscii, isTiff);
                    } else {
                        throw new IOException("The selected resource doesn't seem to be a coverage layer: " + geoResource.getTitle());
                    }
View Full Code Here

Examples of org.locationtech.udig.catalog.IGeoResource.canResolve()

            }
           
//TODO codereview: This resolves http://jira.codehaus.org/browse/UDIG-1686
//            final FeatureStore<?,?> store  = object.getResource(FeatureStore.class, ProgressManager.instance().get());
//            return store != null;
            boolean canResolve = resource.canResolve(FeatureStore.class);
            return canResolve;
        } catch (Exception e) {
            return false;
        } finally {
            isEvaluating.set(false);
View Full Code Here

Examples of org.locationtech.udig.catalog.IGeoResource.canResolve()

            final IGeoResource resource = object.findGeoResource(FeatureSource.class);
            if (resource != null && ids.add(resource.getIdentifier())) {
                CatalogPlugin.getDefault().getLocalCatalog().addCatalogListener(
                        new ObjectPropertyCatalogListener(object, resource, isEvaluating, this));
            }
            boolean canResolve = resource.canResolve(FeatureSource.class);
            return canResolve;
        } catch (Exception e) {
            return false;
        } finally {
            isEvaluating.set(false);
View Full Code Here

Examples of org.locationtech.udig.catalog.IGeoResource.canResolve()

                /*
                 * finally do some processing
                 */
                pm.beginTask(Messages.getString("KmlExportWizard.taskExportingMap"), IProgressMonitor.UNKNOWN); //$NON-NLS-1$
                try {
                    if (geoResource.canResolve(SimpleFeatureSource.class)) {

                        SimpleFeatureSource featureStore = (SimpleFeatureSource) geoResource.resolve(SimpleFeatureSource.class,
                                pm);
                        KmlUtils.writeKml(new File(filePath), featureStore.getFeatures());
                    } else {
View Full Code Here

Examples of org.locationtech.udig.catalog.IGeoResource.canResolve()

    /**
     * @see org.locationtech.udig.project.render.IRenderMetricsFactory#canRender(org.locationtech.udig.project.render.IRenderContext)
     */
    public boolean canRender( IRenderContext context ) {
        IGeoResource geoResource = context.getGeoResource();
        if (geoResource.canResolve(AbstractGridCoverage2DReader.class)) {
            return false; // give image moasic priority over shapefile
        }
        return context.getGeoResource().canResolve(FeatureSource.class);
    }

View Full Code Here

Examples of org.locationtech.udig.catalog.IGeoResource.canResolve()

     */
    @SuppressWarnings("unchecked")
    public boolean canRender(IRenderContext context) {
        try {
            IGeoResource geoResource = context.getGeoResource();
            if( geoResource.canResolve(ShapefileDataStore.class)){
                FeatureSource featureSource=geoResource.resolve(FeatureSource.class, null);
               
                boolean notAView = !(featureSource instanceof DefaultView);
                boolean isAShapefile = (featureSource.getDataStore() instanceof ShapefileDataStore);
                return notAView && featureSource!=null && isAShapefile;
View Full Code Here

Examples of org.locationtech.udig.catalog.IResolve.canResolve()

public class WWConnectionFactory extends UDIGConnectionFactory {

  public boolean canProcess(Object context) {
    if(context instanceof IResolve){
           IResolve resolve = (IResolve) context;
           return resolve.canResolve(LayerSet.class);
       }
       return toWWConfigURL(context) != null;       
  }
 
  public Map<String, Serializable> createConnectionParameters( Object context ) {
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.