Author: ruschein
Date: 2010-10-05 09:22:04 -0700 (Tue, 05 Oct 2010)
New Revision: 22145
Modified:
core3/log-swing/trunk/src/main/java/org/cytoscape/log/internal/AdvancedLogViewer.java
Log:
Converted to use a TaskFactory instead of a TaskIterator as an argument to the
execute() method of TaskManager.
Modified:
core3/log-swing/trunk/src/main/java/org/cytoscape/log/internal/AdvancedLogViewer.java
===================================================================
---
core3/log-swing/trunk/src/main/java/org/cytoscape/log/internal/AdvancedLogViewer.java
2010-10-05 01:45:33 UTC (rev 22144)
+++
core3/log-swing/trunk/src/main/java/org/cytoscape/log/internal/AdvancedLogViewer.java
2010-10-05 16:22:04 UTC (rev 22145)
@@ -14,6 +14,7 @@
import org.cytoscape.work.AbstractTask;
import org.cytoscape.work.Task;
+import org.cytoscape.work.TaskFactory;
import org.cytoscape.work.TaskIterator;
import org.cytoscape.work.TaskManager;
import org.cytoscape.work.TaskMonitor;
@@ -368,12 +369,23 @@
if (fileChooser.showSaveDialog(null) !=
JFileChooser.APPROVE_OPTION)
return;
- File file = fileChooser.getSelectedFile();
- final Task task = new ExportTask(file);
- taskManager.execute(new TaskIterator(task));
+ final File file = fileChooser.getSelectedFile();
+ taskManager.execute(new ExportTaskFactory(file));
}
}
+ class ExportTaskFactory implements TaskFactory {
+ private final File file;
+
+ ExportTaskFactory(final File file) {
+ this.file = file;
+ }
+
+ public TaskIterator getTaskIterator() {
+ return new TaskIterator(new ExportTask(file));
+ }
+ }
+
class ExportTask extends AbstractTask {
private final File file;
private boolean cancelled = false;
--
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.