Author: ruschein
Date: 2010-09-03 15:17:06 -0700 (Fri, 03 Sep 2010)
New Revision: 21696

Removed:
   core3/work-api/trunk/src/test/java/org/cytoscape/work/AbstractTaskTest.java
Modified:
   core3/work-api/trunk/src/main/java/org/cytoscape/work/Task.java
   
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/task/HeadlessTaskManager.java
   
core3/work-swing-impl/trunk/src/main/java/org/cytoscape/work/internal/task/SwingTaskManager.java
Log:
Removed Task.cancelled().

Modified: core3/work-api/trunk/src/main/java/org/cytoscape/work/Task.java
===================================================================
--- core3/work-api/trunk/src/main/java/org/cytoscape/work/Task.java     
2010-09-03 22:07:36 UTC (rev 21695)
+++ core3/work-api/trunk/src/main/java/org/cytoscape/work/Task.java     
2010-09-03 22:17:06 UTC (rev 21696)
@@ -186,9 +186,4 @@
         * concurrency issues.</p>
         */
        void cancel();
-
-       /**
-        *  @return true if cancel() has been invoked on a task, else false
-        */
-       boolean cancelled();
 }

Deleted: 
core3/work-api/trunk/src/test/java/org/cytoscape/work/AbstractTaskTest.java
===================================================================
--- core3/work-api/trunk/src/test/java/org/cytoscape/work/AbstractTaskTest.java 
2010-09-03 22:07:36 UTC (rev 21695)
+++ core3/work-api/trunk/src/test/java/org/cytoscape/work/AbstractTaskTest.java 
2010-09-03 22:17:06 UTC (rev 21696)
@@ -1,53 +0,0 @@
-/*
- Copyright (c) 2010, The Cytoscape Consortium (www.cytoscape.org)
-
- This library is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation; either version 2.1 of the License, or
- any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  The software and
- documentation provided hereunder is on an "as is" basis, and the
- Institute for Systems Biology and the Whitehead Institute
- have no obligations to provide maintenance, support,
- updates, enhancements or modifications.  In no event shall the
- Institute for Systems Biology and the Whitehead Institute
- be liable to any party for direct, indirect, special,
- incidental or consequential damages, including lost profits, arising
- out of the use of this software and its documentation, even if the
- Institute for Systems Biology and the Whitehead Institute
- have been advised of the possibility of such damage.  See
- the GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this library; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-*/
-package org.cytoscape.work;
-
-
-import static org.junit.Assert.*;
-import org.junit.Test;
-
-
-public class AbstractTaskTest {
-       static class SimpleTask extends AbstractTask {
-               SimpleTask() {
-               }
-
-               public void run(TaskMonitor taskMonitor) throws Exception {
-                       // Intentionally do nothing!
-               }
-       }
-
-       @Test
-       public final void testAbstractTask() throws Exception {
-               final Task task = new SimpleTask();
-
-               assertFalse("Invalid initial cancellation state!", 
task.cancelled());
-               task.cancel();
-               assertTrue("Invalid initial cancellation state!", 
task.cancelled());
-       }
-}

Modified: 
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/task/HeadlessTaskManager.java
===================================================================
--- 
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/task/HeadlessTaskManager.java
      2010-09-03 22:07:36 UTC (rev 21695)
+++ 
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/task/HeadlessTaskManager.java
      2010-09-03 22:17:06 UTC (rev 21696)
@@ -60,8 +60,6 @@
                                                }
 
                                                task.run(taskMonitor);
-                                               if (task.cancelled())
-                                                       break;
                                        }
                                } catch (Exception exception) {
                                        taskMonitor.showException(exception);

Modified: 
core3/work-swing-impl/trunk/src/main/java/org/cytoscape/work/internal/task/SwingTaskManager.java
===================================================================
--- 
core3/work-swing-impl/trunk/src/main/java/org/cytoscape/work/internal/task/SwingTaskManager.java
    2010-09-03 22:07:36 UTC (rev 21695)
+++ 
core3/work-swing-impl/trunk/src/main/java/org/cytoscape/work/internal/task/SwingTaskManager.java
    2010-09-03 22:17:06 UTC (rev 21696)
@@ -139,7 +139,7 @@
                                                }
 
                                                task.run(taskMonitor);
-                                               if (task.cancelled())
+                                               if (taskMonitor.cancelled())
                                                        break;
                                        }
                                } catch (Exception exception) {
@@ -160,6 +160,7 @@
        final private ExecutorService cancelExecutorService;
        final private Frame owner;
 
+       private boolean cancelled = false;
        private TaskDialog dialog = null;
        private String title = null;
        private String statusMessage = null;
@@ -204,8 +205,13 @@
                        }
                };
                cancelExecutorService.submit(cancel);
+               cancelled = true;
        }
 
+       public boolean cancelled() {
+               return cancelled;
+       }
+
        public void setTitle(final String title) {
                this.title = title;
                if (dialog != null)

-- 
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