Package org.locationtech.udig.project.internal

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


        for( Box box : boxList ) {
            BoxPrinter boxPrinter = box.getBoxPrinter();
            if (boxPrinter instanceof MapBoxPrinter) {
                MapBoxPrinter mapBP = (MapBoxPrinter) boxPrinter;
                Map map = mapBP.getMap();

                if (map != null && type.isAssignableFrom(map.getClass())) {
                    lists.add(map);
                }
            }
        }
View Full Code Here


            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case ProjectPackage.MAP: {
            Map map = (Map) theEObject;
            T result = caseMap(map);
            if (result == null)
                result = caseProjectElement(map);
            if (result == null)
                result = caseIMap(map);
View Full Code Here

        return map;
    }

    @SuppressWarnings("unchecked")
    public void setMap( IMap map2 ) {
        Map oldMap = map;
        if (oldMap != null) {
            oldMap.removeMapCompositionListener(mapCompositionListener);
            oldMap.getViewportModel().removeViewportModelListener(viewportListener);
            oldMap.removeMapListener(mapListener);
            List<Layer> layers = oldMap.getLayersInternal();
            for( Layer layer : layers ) {
                layer.removeListener(layerListener);
            }
        }
        this.map = (Map) map2;
View Full Code Here

        // TODO: This is internal, why so hard? Commands? Thought I could make
        // a Map and then use a command to hand it over to uDig and rendering.
        // (even system probly weighing in)

        Map map = createMap(title);
        map.setAbstract(general.getChildText("Abstract", oc)); //$NON-NLS-1$
        processBoundingBox(general.getChild("BoundingBox", ows), map); //$NON-NLS-1$
        monitor.worked(1);

        for( Iterator iter = resourceList.getContent().iterator(); iter.hasNext(); ) {
            Object child = iter.next();
View Full Code Here

       
        list.clear();
       
        SimpleFeature[] features = UDIGTestUtil.createDefaultTestFeatures("test", 4); //$NON-NLS-1$
        IGeoResource resource = MapTests.createGeoResource(features, false);
        final Map map = MapTests.createNonDynamicMapAndRenderer(resource, new Dimension(512,512));
        class FixIssue extends TestIssue{
            public IViewPart view;
            public IEditorPart editor;
            FixIssue(){
            super(Priority.CRITICAL, Resolution.UNRESOLVED);
View Full Code Here

    }
   
    @Override
    public void run( IProgressMonitor monitor ) throws Exception {
       
        final Map map = getMap();
       
        if (layer == null) {
            if (geoResource instanceof IGeoResource) {
                layer = map.getLayerFactory().createLayer((IGeoResource) geoResource);
            }
            if (geoResource instanceof Layer) {
                layer = (Layer) geoResource;
            }
        }
       
        if (layer != null) {
            if (index < 0 || index > getMap().getLegend().size()) {
                map.getLegend().add(layer);   
            } else {
                map.getLegend().add(index, layer);
            }
            //selectedLayer = getMap().getEditManager().getSelectedLayer();
            //map.getEditManagerInternal().setSelectedLayer(layer);
        }
       
View Full Code Here

public class CompositeRendererImplTest {

    @Test
    public void testZorder() throws Exception {
        Map map = MapTests.createDefaultMap("typename", 2, true, null); //$NON-NLS-1$
        map.getLayersInternal().add(map.getLayerFactory().createLayer(MapTests.createGeoResource("type2", 3, false))); //$NON-NLS-1$
       
        CompositeRendererImpl renderer = (CompositeRendererImpl) map.getRenderManagerInternal().getRenderExecutor().getRenderer();
        renderer.getContext().clear();
        RendererCreator creator=map.getRenderManagerInternal().getRendererCreator();
       
        SortedSet<Layer> layers = creator.getLayers();
        layers.clear();
        layers.addAll(map.getLayersInternal());
        layers.add(new SelectionLayer(map.getLayersInternal().get(0)));
        layers.add(new SelectionLayer(map.getLayersInternal().get(1)));
       
        creator.reset();
       
        renderer.getContext().addContexts(creator.getConfiguration());
       
        Collection<RenderExecutor> executors = renderer.getRenderExecutors();
       
        Iterator<RenderExecutor> iter = executors.iterator();

        RenderExecutor executor = iter.next();
        assertEquals( map.getLayersInternal().get(0),executor.getContext().getLayer() );
        executor = iter.next();
        assertEquals( map.getLayersInternal().get(1),executor.getContext().getLayer() );
        executor = iter.next();
        SelectionLayer sl = (SelectionLayer) executor.getContext().getLayer();
        assertEquals( map.getLayersInternal().get(0),sl.getWrappedLayer() );
        executor = iter.next();
        sl = (SelectionLayer) executor.getContext().getLayer();
        assertEquals( map.getLayersInternal().get(1),sl.getWrappedLayer() );
       
    }
View Full Code Here

    @Ignore
    @Test
    public void testTransactionUse() throws Exception {
        IGeoResource resource1 = MapTests.createGeoResource(UDIGTestUtil.createDefaultTestFeatures(
                "type1", 4), false); //$NON-NLS-1$
        Map map = MapTests.createNonDynamicMapAndRenderer(resource1, new Dimension(512,512));
        ILayer layer = map.getLayersInternal().get(0);
        EditManager manager = (EditManager) layer.getMap().getEditManager();
        //wrapper/decorator
        FeatureStore<SimpleFeatureType, SimpleFeature> store = layer.getResource(FeatureStore.class, new NullProgressMonitor());
        //we are in read mode, so the wrapper doesn't delegate to the transaction
        assertTrue(store.getTransaction() == Transaction.AUTO_COMMIT);
View Full Code Here

  @Before
  public void setUp() throws Exception {
    SimpleFeature [] features=UDIGTestUtil.createDefaultTestFeatures("Tests",4); //$NON-NLS-1$
    IGeoResource resource = MapTests.createGeoResource(features, true);
    Map map=MapTests.createNonDynamicMapAndRenderer(resource, new Dimension(512,512));
    project=map.getProjectInternal();
  }
View Full Code Here

  private IRenderContext context;

  @Before
  public void setUp() throws Exception {
    SimpleFeature[] features=UDIGTestUtil.createDefaultTestFeatures("testType", 3); //$NON-NLS-1$
    Map map=MapTests.createNonDynamicMapAndRenderer(MapTests.createGeoResource(features,true), new Dimension(512,512));
    context=map.getRenderManagerInternal().getRenderExecutor().getContext();
  }
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.