Examples of IGeoResourceInfo


Examples of org.locationtech.udig.catalog.IGeoResourceInfo

            }

        } else if (record instanceof IGeoResource) {
            IGeoResource layer = (IGeoResource) record;
            try {
                IGeoResourceInfo info = layer.getInfo(searchMonitor);
                showInfo(new Info(layer.getIdentifier(), info));
            } catch (IOException e) {
                CatalogUIPlugin.log("No information for layer", e); //$NON-NLS-1$
            }
        }
View Full Code Here

Examples of org.locationtech.udig.catalog.IGeoResourceInfo

     * @param resource
     * @throws IOException
     */
    private void op( final Display display, IProgressMonitor monitor, IGeoResource resource )
            throws IOException {
        IGeoResourceInfo info = resource.getInfo(monitor);
        Envelope bounds = info.getBounds();
        final List<SummaryData> data=new ArrayList<SummaryData>();
        String crs;
        if (info.getCRS() != null)
            crs = info.getCRS().getName().toString();
        else
            crs = Messages.MultiTargetOp_unknown;
        crs=crs.replace('\n', ' ');
       
        try {
            data.add(new SummaryData(Messages.MultiTargetOp_name, info.getName()));
            data.add(new SummaryData( Messages.MultiTargetOp_title, info.getTitle()));
            data.add(new SummaryData( Messages.MultiTargetOp_bounds, LayerSummary.parseBounds(bounds) ));
            data.add(new SummaryData( Messages.MultiTargetOp_crs, crs));
            data.add(new SummaryData( Messages.MultiTargetOp_featuresource, resource.canResolve(FeatureSource.class)));
            data.add(new SummaryData( Messages.MultiTargetOp_featurestore, resource.canResolve(FeatureStore.class)));
            data.add(new SummaryData( Messages.MultiTargetOp_wms, resource.canResolve(WebMapServer.class)));
            boolean first=false;
            for( String word : info.getKeywords() ) {
                if( first )
                    data.add(new SummaryData( Messages.MultiTargetOp_keywords, word));
                else
                    data.add(new SummaryData( null , word ));
            }
View Full Code Here

Examples of org.locationtech.udig.catalog.IGeoResourceInfo

        ImageDescriptor icon = resource.resolve( ImageDescriptor.class, monitor);
        if( icon != null ) return icon;
      }
      // check for static icon next
        try{
            IGeoResourceInfo info;
            info = resource.resolve(IGeoResourceInfo.class, monitor);           
           
            ImageDescriptor icon = info.getImageDescriptor();
            if( icon != null ) return icon;           
        }catch(Throwable t){
            log("Error obtaining info", t); //$NON-NLS-1$
            return null;
        }
View Full Code Here

Examples of org.locationtech.udig.catalog.IGeoResourceInfo

     */
    public CountDownProgressMonitor( IProgressMonitor monitor, int ticks, IGeoResource resource, int remaining ) {
        super(monitor, ticks);
        this.remaining=remaining;
        try {
            IGeoResourceInfo info = resource.getInfo(ProgressManager.instance().get());
            name=info.getTitle();
            if( name==null ){
                name=info.getName();
            }
        } catch (IOException e) {
            CatalogUIPlugin.log("Couldn't read info", e); //$NON-NLS-1$
            name=resource.getIdentifier().toString();
        }
View Full Code Here

Examples of org.locationtech.udig.catalog.IGeoResourceInfo

    /* check the fields we catre about */
    protected static boolean check( IGeoResource resource, AST pattern ) {
        if (pattern == null) {
            return true;
        }
        IGeoResourceInfo info;
        try {
            info = (resource == null ? null : resource.getInfo(null));
        } catch (IOException e) {
            CatalogPlugin.log(null, e);
            info = null;
        }
        if (info == null) {
            return false;
        }
        if (pattern.accept(info.getTitle())) {
            return true;
        }
        if (pattern.accept(info.getName())) {
            return true;
        }
        if (info.getKeywords() != null) {
            for( String key : info.getKeywords() ) {
                if (pattern.accept(key)) {
                    return true;
                }
            }
        }
        if (info.getSchema() != null && pattern.accept(info.getSchema().toString())) {
            return true;
        }
        if (pattern.accept(info.getDescription())) {
            return true;
        }
        return false;
    }
View Full Code Here

Examples of org.locationtech.udig.catalog.IGeoResourceInfo

        if (name == null) {
            if (resources.size() > 0) {
                IGeoResource resource = resources.get(0);
                String title = resource.getTitle();
                if( title == null || title.trim().length() == 0 ){
                    IGeoResourceInfo info = resource.getInfo(monitor);
                    if (info != null) {
                        title = info.getTitle();
                    }
                }
                if (title != null && !title.contains("(") ){
                    name = title;
                }
View Full Code Here

Examples of org.locationtech.udig.catalog.IGeoResourceInfo

          @Override
          public <T> T resolve(Class<T> adaptee, IProgressMonitor monitor) throws IOException {
            return super.resolve(adaptee, monitor);
          }
                    protected IGeoResourceInfo createInfo( IProgressMonitor monitor ) throws IOException {
                        return new IGeoResourceInfo("Test Title", "Test Name", "description", null,  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                                new Envelope(20,30,0,40), DefaultGeographicCRS.WGS84, new String[0],
                                null);
                    }
                    public <T> boolean canResolve(Class<T> adaptee) {
            return super.canResolve(adaptee);
View Full Code Here

Examples of org.locationtech.udig.catalog.IGeoResourceInfo

    /* check the fields we catre about */
    protected static boolean check( IGeoResource resource, AST pattern ) {
        if (pattern == null) {
            return true;
        }
        IGeoResourceInfo info;
        try {
            info = (resource == null ? null : resource.getInfo(null));
        } catch (IOException e) {
            CatalogPlugin.log(null, e);
            info = null;
        }
        if (info == null) {
            return false;
        }
        if (pattern.accept(info.getTitle())) {
            return true;
        }
        if (pattern.accept(info.getName())) {
            return true;
        }
        if (info.getKeywords() != null) {
            for( String key : info.getKeywords() ) {
                if (pattern.accept(key)) {
                    return true;
                }
            }
        }
        if (info.getSchema() != null && pattern.accept(info.getSchema().toString())) {
            return true;
        }
        if (pattern.accept(info.getDescription())) {
            return true;
        }
        return false;
    }
View Full Code Here

Examples of org.locationtech.udig.catalog.IGeoResourceInfo

        return true;
    }

    @Test
    public void testInfo() throws IOException {
        IGeoResourceInfo info = getInfo(getResolve(), null);
        assertNotNull("Info is required", info); //$NON-NLS-1$
    }
View Full Code Here

Examples of org.locationtech.udig.catalog.IGeoResourceInfo

    }

    @Test
    public void testInfoMonitor() throws IOException {
        FakeProgress monitor = new FakeProgress();
        IGeoResourceInfo info = getInfo(getResolve(), monitor);
        assertNotNull("Info is required", info); //$NON-NLS-1$
    }
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.