Author: pwang
Date: 2011-11-10 17:11:20 -0800 (Thu, 10 Nov 2011)
New Revision: 27461

Modified:
   
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/destruction/DestroyNetworkTask.java
   
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/destruction/DestroyNetworkViewTask.java
Log:
Set progress monitor

Modified: 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/destruction/DestroyNetworkTask.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/destruction/DestroyNetworkTask.java
       2011-11-11 01:08:51 UTC (rev 27460)
+++ 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/destruction/DestroyNetworkTask.java
       2011-11-11 01:11:20 UTC (rev 27461)
@@ -47,7 +47,15 @@
        }
 
        public void run(TaskMonitor tm) {
-               for ( CyNetwork n : networks )
+               tm.setProgress(0.0);
+               int i=0;
+               int networkCount = networks.size();
+               
+               for ( CyNetwork n : networks ){
                        netmgr.destroyNetwork(n);
+                       i++;
+                       tm.setProgress((i/(double)networkCount));
+               }
+               tm.setProgress(1.0);
        }
 }

Modified: 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/destruction/DestroyNetworkViewTask.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/destruction/DestroyNetworkViewTask.java
   2011-11-11 01:08:51 UTC (rev 27460)
+++ 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/destruction/DestroyNetworkViewTask.java
   2011-11-11 01:11:20 UTC (rev 27461)
@@ -46,7 +46,17 @@
        }
 
        public void run(TaskMonitor tm) {
+               tm.setProgress(0.0);
+               
+               int i=0;
+               int viewCount = networkViews.size();
                for (final CyNetworkView n : networkViews)
+               {
                        networkViewManager.destroyNetworkView(n);
+                       i++;
+                       tm.setProgress((i/(double)viewCount));
+               }
+               
+               tm.setProgress(1.0);
        }
 }

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to