Package org.locationtech.udig.ui

Examples of org.locationtech.udig.ui.WaitCondition


        layer.setFilter( null ); // Filter.EXCLUDE
       
        action.init(null, null, ViewerDropLocation.NONE, layer, aF);
       
        action.perform(new NullProgressMonitor());
        UDIGTestUtil.inDisplayThreadWait(2000, new WaitCondition(){

            public boolean isTrue()  {
                try {
                    return 2==featureSource.getFeatures().size() && ((org.opengis.filter.Filter)layer.getFilter())!=Filter.EXCLUDE;
                } catch (IOException e) {
View Full Code Here


        map=MapTests.createDefaultMap("RMDTestType", 3, true, null, false); //$NON-NLS-1$
        Map m2 = MapTests.createDefaultMap("RMDTestType2", 3, true, null, false); //$NON-NLS-1$
        map.getLayersInternal().add(m2.getLayersInternal().get(0));
       
        ApplicationGIS.openMap(map, true);
        UDIGTestUtil.inDisplayThreadWait(2000, new WaitCondition(){

            public boolean isTrue() {
                return !map.getRenderManagerInternal().getRenderers().isEmpty();
            }
           
View Full Code Here

            assertEquals(IRenderer.NEVER, renderer.getState());
        }
       
        final ILayer refreshLayer = map.getMapLayers().get(0);
        map.getRenderManagerInternal().refresh(refreshLayer, null);
        UDIGTestUtil.inDisplayThreadWait(3000000, new WaitCondition(){

            public boolean isTrue() {
                for( Renderer renderer: impl.children() ) {
                    ILayer currentLayer = renderer.getContext().getLayer();
                    if( currentLayer==refreshLayer ){
View Full Code Here

    private void runMapImport( Object context ) throws Exception {       

        mapImport.run(new DummyMonitor(),context);

        WaitCondition object = new WaitCondition(){

      public boolean isTrue() {
                IMap map = ApplicationGIS.getActiveMap();
                if (map == ApplicationGIS.NO_MAP)
                    return false;
View Full Code Here

        final WorkflowWizard workflowWizard = mapImport.getDialog().getWorkflowWizard();
    workflowWizard.getWorkflow()
            .setContext(context);
        mapImport.run(new DummyMonitor(),context);
       
        UDIGTestUtil.inDisplayThreadWait(3000, new WaitCondition(){

      public boolean isTrue()  {
        State state = workflowWizard.getWorkflow().getCurrentState();
        if ( state instanceof ResourceSelectionState )
          return true;
        return false;
      }
         
        }, true);
        assertTrue(workflowWizard.getWorkflow().getCurrentState() instanceof ResourceSelectionState);
       
        //check the resource page to ensure that it isn't ignored
        ResourceSelectionState currentState = (ResourceSelectionState) workflowWizard.getWorkflow().getCurrentState();

        assertTrue(currentState.getResources()==null || currentState.getResources().isEmpty());
       
        //Set the resources on the state and press finish
        IService service=currentState.getServices().iterator().next();
        Map<IGeoResource, IService> resources=new HashMap<IGeoResource, IService>();
       
        for (IResolve resolve : service.resources(new NullProgressMonitor())) {
      resources.put((IGeoResource) resolve, service);
    }
       
       
        currentState.setResources(resources);
       
        org.locationtech.udig.project.internal.Map activeMap = ApplicationGISInternal.getActiveMap();
        if( activeMap!=ApplicationGIS.NO_MAP )
            activeMap.getLayersInternal().clear();

       
        DialogDriver.pushButton(mapImport.getDialog(), IDialogConstants.FINISH_ID);
      
        UDIGTestUtil.inDisplayThreadWait(4000, new WaitCondition(){

      public boolean isTrue()  {
          IMap map = ApplicationGIS.getActiveMap();
          if( map==ApplicationGIS.NO_MAP )
            return false;
View Full Code Here

    @Before
    public void setUp() throws Exception {
        map=MapTests.createDefaultMap("SynchronizeRendererConfigurationTest", 5, true, null); //$NON-NLS-1$
        map.setRenderManagerInternal(null);
        ApplicationGIS.openMap(map, true);
        UDIGTestUtil.inDisplayThreadWait(2000, new WaitCondition(){

            public boolean isTrue() {
                return ApplicationGIS.getActiveMap()!=null;
            }
           
View Full Code Here

    }

    private void removeAndAddLayer(int i) throws Exception {
        Layer removed = map.getLayersInternal().remove(0);
        manager.refresh(null);
        UDIGTestUtil.inDisplayThreadWait(1000, new WaitCondition(){

            public boolean isTrue() {
                return 0==manager.configuration.size();
            }
           
        }, false);
        assertEquals(0,manager.configuration.size());
        assertEquals(0, manager.getRenderers().size());
       
        ILayer newLayer = map.getLayerFactory().createLayer( CatalogTests.createGeoResource("SyncRenderesTestType"+i, i, false) ); //$NON-NLS-1$
        map.getLayersInternal().add((Layer) newLayer);
        manager.refresh(null);
        UDIGTestUtil.inDisplayThreadWait(1000, new WaitCondition(){

            public boolean isTrue() {
                return 2==manager.configuration.size();
            }
           
View Full Code Here

                "file:/localhost/mapgraphic",//$NON-NLS-1$
                "file:/localhost/mapgraphic#Scalebar", //$NON-NLS-1$
        "layer4");//$NON-NLS-1$
       
        map.getLayersInternal().addAll(Arrays.asList(new Layer[]{layer, layer2, layer3, layer4}));
        UDIGTestUtil.inDisplayThreadWait(2000, new WaitCondition(){

            public boolean isTrue() {
                CompositeRenderContext context = (CompositeRenderContext) map.getRenderManagerInternal().getRenderExecutor().getContext();
                return layer4==context.getContexts().get(0).getLayer();
            }
           
        }, false);
        manager.refresh(null);
        CompositeRenderContext context = (CompositeRenderContext) map.getRenderManagerInternal().getRenderExecutor().getContext();
       
        context = (CompositeRenderContext) context.getContexts().get(0);
        assertEquals(layer, context.getLayer());
       
        Iterator<IRenderContext> children = context.getContexts().iterator();
       
        IRenderContext next = children.next();
        assertEquals(layer, next.getLayer());
       
        next = children.next();
        assertEquals(layer2, next.getLayer());
       
        next = children.next();
        assertEquals(layer3, next.getLayer());
       
        next = children.next();
        assertEquals(layer4, next.getLayer());
       
        map.lowerLayer(layer3);
       
        UDIGTestUtil.inDisplayThreadWait(2000, new WaitCondition(){

            public boolean isTrue() {
                CompositeRenderContext context = (CompositeRenderContext) map.getRenderManagerInternal().getRenderExecutor().getContext();
                context = (CompositeRenderContext) context.getContexts().get(0);
                return layer3==context.getContexts().get(1).getLayer();
View Full Code Here

  @Ignore
  @Test
  public void testEditReRender() throws Exception {
        ApplicationGIS.openMap(map, true);
       
        UDIGTestUtil.inDisplayThreadWait(5000, new WaitCondition(){

            public boolean isTrue() {
                return map.getRenderManagerInternal().getRenderExecutor().getState()==IRenderer.DONE;
            }
           
        }, true);
       
        final RenderListener listener=new RenderListener();

        map.getRenderManagerInternal().getRenderExecutor().eAdapters().add(listener);
        listener.rendered=false;
        FeatureStore<SimpleFeatureType, SimpleFeature> store=map.getLayersInternal().get(0).getResource(FeatureStore.class, new NullProgressMonitor());
        FilterFactory fac=CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
        store.removeFeatures(fac.id(FeatureUtils.stringToId(fac, features[0].getID())));

        UDIGTestUtil.inDisplayThreadWait(5000, new WaitCondition(){

            public boolean isTrue() {
                return listener.rendered;
            }
           
        }, true);
       
        assertTrue(listener.rendered);
       
        listener.rendered=false;
       
        store.modifyFeatures(features[0].getFeatureType().getDescriptor("name"),"changed"//$NON-NLS-1$ //$NON-NLS-2$
            fac.id( FeatureUtils.stringToId(fac, features[1].getID() )));

        UDIGTestUtil.inDisplayThreadWait(5000, new WaitCondition(){

            public boolean isTrue() {
                return listener.rendered;
            }
           
        }, true);

        assertTrue(listener.rendered);

        listener.rendered=false;
       
        map.getEditManagerInternal().rollbackTransaction();

        UDIGTestUtil.inDisplayThreadWait(5000, new WaitCondition(){

            public boolean isTrue() {
                return listener.rendered;
            }
           
        }, true);

        assertTrue(listener.rendered);
       
        listener.rendered=false;
       
        store.modifyFeatures(features[0].getFeatureType().getDescriptor("name"),"changed",   //$NON-NLS-1$//$NON-NLS-2$
            fac.id( FeatureUtils.stringToId(fac, features[1].getID() )));
        UDIGTestUtil.inDisplayThreadWait(5000, new WaitCondition(){

            public boolean isTrue() {
                return listener.rendered;
            }
           
        }, true);
       
        assertTrue(listener.rendered);

        listener.rendered=false;
       
        map.getEditManagerInternal().rollbackTransaction();
        UDIGTestUtil.inDisplayThreadWait(5000, new WaitCondition(){

            public boolean isTrue() {
                return listener.rendered;
            }
           
View Full Code Here

        .getEntry("data/streams.shp");   //$NON-NLS-1$
   
        startup.testingSetArgs(new String[]{FileLocator.toFileURL(url).toString()});
        startup.earlyStartup();
        while( Display.getCurrent().readAndDispatch() );
        UDIGTestUtil.inDisplayThreadWait(2000, new WaitCondition(){

      public boolean isTrue()  {
        return ApplicationGIS.getActiveMap()!=ApplicationGIS.NO_MAP;
      }
         
View Full Code Here

TOP

Related Classes of org.locationtech.udig.ui.WaitCondition

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.