Package org.geotools.util

Examples of org.geotools.util.ProgressListener


    @Test
    public void testProgress() {

        Monitor monitor = new Monitor();
       
        ProgressListener progress = GeoToolsAdapters.progress(monitor);
        progress.setDescription("go");
        progress.started();
       
        assertEquals("test started", 0.0, monitor.work, 0.01 );
        assertEquals("test started", 100.0, monitor.total, 0.01 );
       
        assertFalse( monitor.isCanceled );
        assertEquals("task", "go", monitor.task );
       
        progress.progress( 0.5f );
        assertEquals("test working", 50.0, monitor.work, 0.01 );
        assertEquals("test working", 100.0, monitor.total, 0.01 );
       
        progress.progress( 1.0f );
        assertEquals("test finished", 100.0, monitor.work, 0.01 );
        assertEquals("test finished", 100.0, monitor.total, 0.01 );
       
        assertEquals("almost done", false, monitor.done );      
        progress.complete();
        assertEquals("test done", true, monitor.done );
       
    }
View Full Code Here


            }           
        };
    }
  static public ProgressListener progress(final IProgressMonitor monitor) {
    if( monitor == null ) return null;
    return new ProgressListener(){
      private String description;
      private int progress;
      private InternationalString task;
     
      public void complete() {
View Full Code Here

TOP

Related Classes of org.geotools.util.ProgressListener

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.