Package org.locationtech.udig.project.internal

Examples of org.locationtech.udig.project.internal.Map


            table.clear();
            table.update();
            return;
        }
       
        Map map = currentEditor.getMap();
        final ILayer selectedLayer = map.getEditManager().getSelectedLayer();
        // layerSelecte returns if layer==newLayer.  If both are null we still want to listen to map for a
        // layer being added (and selected).
        if( selectedLayer==null && layer == null ){
            map.getEditManager().addListener(editManagerListener);
            return;
        }
       
        PlatformGIS.run(new ISafeRunnable(){
View Full Code Here


        this.resources = resources;
        index = i;
    }

    public void run( IProgressMonitor monitor ) throws Exception {
        Map map = getMap();
        if (layers == null) {
            layers = new ArrayList<Layer>();
            LayerFactory layerFactory = map.getLayerFactory();

            selection = (Layer) map.getEditManager().getSelectedLayer();

            for( Object o : resources ) {
                try {
                    Layer layer = null;
   
                    if (o instanceof IGeoResource) {
                        // ensure that the service is part of the Catalog so that the find method in
                        // layer turn into layer
                        IGeoResource resource = (IGeoResource) o;
                        layer = layerFactory.createLayer(resource);
                    }
                    if (o instanceof Layer) {
                        // leave as is
                        layer = (Layer) o;
                    }
   
                    if (layer != null) {
                        layers.add(layer);
                    }
                }
                catch (Throwable t){
                    ProjectPlugin.log("Unable to add "+o,t);
                }
            }
        }
        if (!layers.isEmpty()) {
            if (index < 0) {
                index = map.getLayersInternal().size();
            }
            trace();

            map.getLayersInternal().addAll(index, layers);
            map.getEditManagerInternal().setSelectedLayer(layers.get(0));
        }

    }
View Full Code Here

    /**
     * Checks if folder is existing in the map and initialises isInMap and index variables.
     */
    private void initializeDelete() {
        final Map map = getMap();
        final List<ILegendItem> items = map.getLegend();
        if (items.contains(folder)) {
            parent = getMap();
            index = items.indexOf(folder);
        } else {
            for (ILegendItem item : items) {
View Full Code Here

                button.addListener(SWT.MouseUp, new Listener(){

                    public void handleEvent( Event event ) {
                        MapEditorPart editor = (MapEditorPart) PlatformUI.getWorkbench()
                                .getActiveWorkbenchWindow().getActivePage().getActiveEditor();
                        Map map = editor.getMap();
                        Envelope env = geometry.getEnvelopeInternal();
                        try {
                            env = JTS.transform(env, map.getEditManager().getEditLayer()
                                    .layerToMapTransform());
                        } catch (Exception e1) {
                            ProjectUIPlugin.log(null, e1);
                        }
                        map.sendCommandASync(new SetViewportBBoxCommand(env, map.getViewportModel().getCRS()));
                        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
                                .activate(editor);
                    }

                });
View Full Code Here

                    "The selected file does.");
            return;
        }

        if (openMap) {
            Map map = (Map) elem;
            ApplicationGIS.openMap(map);
        }
    }
View Full Code Here

           
            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);
            List<Layer> layersInternal = mapCopy.getLayersInternal();           
            List<Layer> mapGraphics = prepareMapGraphics(mapCopy, contentDim, monitor);
            layersInternal.addAll(mapGraphics);
           
            //block out the labels over my whitebox
            //context.getLabelS...()
View Full Code Here

      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,
View Full Code Here

            Page page = (Page) object;
            Iterator iter = page.getBoxes().iterator();
            while (iter.hasNext()) {
                BoxPrinter box = ((Box) iter.next()).getBoxPrinter();
                if (box instanceof MapBoxPrinter) {
                    Map map = ((MapBoxPrinter)box ).getMap();
//                    children.add(new MapItemProvider(adapterFactory, map));
                    children.add(map);
                }
            }
           
View Full Code Here

        // CatalogPlugin.getDefault().getLocalCatalog().add(service);
        List< ? extends IGeoResource> resources = service.resources(null);
       
        IGeoResource resource = resources.get(0);
       
        Map map = ((Map)layers[0].getMap());
        LayerFactory factory = map.getLayerFactory();
        Layer outLayer = factory.createLayer(resource);
        map.getLayersInternal().add(outLayer);
    }
View Full Code Here

    private SummaryData abstractData;
    private SummaryControl summaryControl;

    @Override
    protected Control createContents( Composite parent ) {
        final Map map = (Map) getElement();
        Envelope bounds;
        bounds = map.getBounds(ProgressManager.instance().get());

        final List<SummaryData> data = new ArrayList<SummaryData>();

        String name = map.getName();
        nameData = new SummaryData(Messages.LayerSummary_name, name==null?"":name); //$NON-NLS-1$
        nameData.setModifier(new NameModifier());
        data.add(nameData);
        newName=oldName=nameData.getInfo();
       
        String abstract1 = map.getAbstract();
        abstractData = new SummaryData(Messages.MapSummary_abstract, abstract1==null?"":abstract1); //$NON-NLS-1$
        abstractData.setModifier(new AbstractModifier());
        data.add(abstractData);
        newAbstract=oldAbstract=abstractData.getInfo();
       
        data.add(new SummaryData(Messages.LayerSummary_id, map.getID()));
        data.add(new SummaryData(Messages.MapSummary_mapBounds, bounds == null
                ? Messages.LayerSummary_unknownBounds
                : LayerSummary.parseBounds(bounds)));
        data.add(new SummaryData(Messages.MapSummary_viewportBounds, LayerSummary.parseBounds(map
                .getViewportModel().getBounds())));

        summaryControl = new SummaryControl(data);
        return summaryControl.createControl(parent);
    }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.internal.Map

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.