Package org.locationtech.udig.project

Examples of org.locationtech.udig.project.IMap


        return false;
    }

    private boolean desinationContainsLayer( ILayer layer) {
        if( getDestination() instanceof IMap ){
        IMap map=(IMap) getDestination();
        if( map.getMapLayers().contains(layer) )
            return true;
        }
        return false;
    }
View Full Code Here


            seperateGeoResources(resources, otherData, data2);
        }
       
        int layerpos=-1;
        layerpos = calculateDropPosition();
        IMap map=null;
        if( !otherData.isEmpty() ){
            for( Object object : otherData ) {
                Collection<IGeoResource> additionalResources = toResources(monitor, object, getClass());
               
                ProjectUIPlugin.trace(Trace.DND, MapDropAction.class,
View Full Code Here

            return Collections.emptyList();
        }
    }

    private void addResourcesToMap( List<IGeoResource> resources, int layerpos,IMap map2 ) {
        IMap map=map2;
        if( getDestination() instanceof Layer){
            Layer layer=(Layer) getDestination();
            map=layer.getMap();
        } else if( getDestination() instanceof IMap ){
            map = (IMap) getDestination();
        }
        if (map==null )
            map = ApplicationGIS.getActiveMap();
        if( map==ApplicationGIS.NO_MAP ){
            ProjectUIPlugin.trace(Trace.DND, getClass(), "Creating new Map with from resources: "+resources, null); //$NON-NLS-1$
            ApplicationGIS.addLayersToMap((IMap)null, resources, layerpos);
        }else{
            ProjectUIPlugin.trace(Trace.DND, getClass(), "Add layers to "+map.getName()+" from resources: "+resources, null)//$NON-NLS-1$//$NON-NLS-2$
            ApplicationGIS.addLayersToMap(map, resources, layerpos, null, true);
        }
    }
View Full Code Here

        featurePage = new FeaturePanelPage(this);
       
        featurePage.init( pageSite );       
        featurePage.setFeatureSite(new FeatureSiteImpl());
        featurePage.createControl(book);
        final IMap map = ApplicationGIS.getActiveMap();
        if (map != ApplicationGIS.NO_MAP) {
            try {
                editFeatureChanged(map.getEditManager().getEditFeature());
            } catch (Throwable e) {
                UiPlugin.log("Default SimpleFeature Editor threw an exception", e); //$NON-NLS-1$
            }
        }
       
View Full Code Here

            book.showPage( messagePage.getControl() );
            return;
        }
        // pass the selection to the page
       
        IMap activeMap = ApplicationGIS.getActiveMap();
        IFeatureSite site = featurePage.getFeatureSite();
        if( site == null ){
            site = new FeatureSiteImpl(activeMap);
            featurePage.setFeatureSite(site);      
        }
View Full Code Here

         * @return Object[]
         */
        public Object[] getChildren( Object arg0 ) {

            if (arg0 instanceof IMap) {
                IMap map = (IMap) arg0;

                List<ILayer> layers = map.getMapLayers();

                return filteredLayers(layers);
            } else if (arg0 instanceof ILayer) {
                return null;
            }
View Full Code Here

         *
         * @param arg0 the input data
         * @return Object[]
         */
        public Object[] getElements( Object arg0 ) {
            IMap map = ApplicationGIS.getActiveMap();
            return new Object[]{map};
        }
View Full Code Here

     * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
     */
    public void createPartControl( Composite parent ) {
        featureDisplay = new PropertySheetPage();
        featureDisplay.createControl(parent);
        final IMap map = ApplicationGIS.getActiveMap();
        if (map != ApplicationGIS.NO_MAP) {
            try {
                editFeatureChanged(map.getEditManager().getEditFeature());
            } catch (Throwable e) {
                UiPlugin.log("Default SimpleFeature Editor threw an exception", e); //$NON-NLS-1$
            }
        }
    }
View Full Code Here

    // feature under the cursor, so
    // this will return a feature.
    assert feature != null;

    // set map units.
    IMap map = handler.getContext().getMap();
    assert map != null;

    CoordinateReferenceSystem crs = MapUtil.getCRS(map);
    Unit<?> mapUnits = GeoToolsUtils.getDefaultCRSUnit(crs);
View Full Code Here

    BufferedImage image = new BufferedImage(width, height,
        BufferedImage.TYPE_INT_ARGB);

    Graphics2D g = image.createGraphics();
   
    IMap renderedMap;
    try {
      monitor.worked(1);
      pattern = Messages.ExportMapToImageWizard_renderingTaskname;
      args = new Object[]{map.getName()};
      monitor.setTaskName(MessageFormat.format(pattern, args));
      int scaleDenom = MapSelectorPageWithScaleColumn.getScaleDenom(map);
      BoundsStrategy boundsStrategy = new BoundsStrategy(scaleDenom);
     
      //final Map mapCopy = (Map) EcoreUtil.copy((EObject) map);
      final Map mapCopy = (Map) ApplicationGIS.copyMap(map);
       
      DrawMapParameter drawMapParameter =
          new DrawMapParameter(g,
                               new java.awt.Dimension(width, height),
                               mapCopy,
                               boundsStrategy,
                               imageSettingsPage.getFormat().getDPI(),
                               imageSettingsPage.getSelectionHandling(),
                               monitor);
     
      renderedMap = ApplicationGIS.drawMap(drawMapParameter);
    }
    finally {
      g.dispose();
    }
    monitor.worked(1);
    pattern = Messages.ExportMapToImageWizard_writingTaskname;
    args = new Object[]{map.getName()};
    monitor.setTaskName(MessageFormat.format(pattern, args));
    imageSettingsPage.getFormat().write(renderedMap, image, destination);
    String baseFile = destination.getPath().substring(0, destination.getPath().lastIndexOf("."));
    createWorldFile(renderedMap.getViewportModel().worldToScreenTransform().createInverse(), baseFile);
    createProjectionFile(baseFile, renderedMap.getViewportModel().getCRS());

    addToCatalog(destination);
   
    monitor.done();
  }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.IMap

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.