本文整理汇总了Java中org.cytoscape.work.Task类的典型用法代码示例。如果您正苦于以下问题:Java Task类的具体用法?Java Task怎么用?Java Task使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Task类属于org.cytoscape.work包,在下文中一共展示了Task类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: startTask
import org.cytoscape.work.Task; //导入依赖的package包/类
private void startTask(Task task)
{
Task updateTask = new AbstractTask() {
@Override
public void run(TaskMonitor taskMonitor) throws Exception {
updateContents();
}
};
TaskManager<?,?> mgr = registrar.getService(TaskManager.class);
mgr.execute(new TaskIterator(task, updateTask));
}
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:13,代码来源:MappingManagerPanel.java
示例2: actionPerformed
import org.cytoscape.work.Task; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent event) {
Optional<AnnotationSet> as = modelManager.getActiveNetworkViewSet().flatMap(NetworkViewSet::getActiveAnnotationSet);
if(as.isPresent()) {
List<FileChooserFilter> filter = Collections.singletonList(new FileChooserFilter("txt Files", "txt"));
File file = fileUtil.getFile(jframeProvider.get(), TITLE, FileUtil.SAVE, filter);
if(file != null) {
Task exportTask = new ExportTask(as.get(), file);
dialogTaskManager.execute(new TaskIterator(exportTask));
}
}
}
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:13,代码来源:ExportClustersAction.java
示例3: taskIterator
import org.cytoscape.work.Task; //导入依赖的package包/类
public static Collector<Task, ?, TaskIterator> taskIterator() {
return Collector.of(
TaskIterator::new,
TaskIterator::append,
(left, right) -> { left.append(right); return left; },
Collector.Characteristics.IDENTITY_FINISH);
}
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:8,代码来源:TaskTools.java
示例4: taskMessage
import org.cytoscape.work.Task; //导入依赖的package包/类
public static Task taskMessage(String message) {
return new AbstractTask() {
@Override
public void run(TaskMonitor taskMonitor) {
taskMonitor.setTitle(BuildProperties.APP_NAME);
taskMonitor.setStatusMessage(message);
}
};
}
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:10,代码来源:TaskTools.java
示例5: taskOf
import org.cytoscape.work.Task; //导入依赖的package包/类
public static Task taskOf(Runnable runnable) {
return new AbstractTask() {
@Override
public void run(TaskMonitor taskMonitor) {
runnable.run();
}
};
}
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:9,代码来源:TaskTools.java
示例6: taskFactory
import org.cytoscape.work.Task; //导入依赖的package包/类
public static TaskFactory taskFactory(Provider<? extends Task> taskProvider) {
return new AbstractTaskFactory() {
@Override
public TaskIterator createTaskIterator() {
return new TaskIterator(taskProvider.get());
}
};
}
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:9,代码来源:TaskTools.java
示例7: createTaskIterator
import org.cytoscape.work.Task; //导入依赖的package包/类
@Override
public TaskIterator createTaskIterator() {
final String tempColumn = UUID.randomUUID().toString();
CyNetwork network = annotationSet.getParent().getNetwork();
CyTable nodeTable = network.getDefaultNodeTable();
// Create a temp column of cluster identifiers
Task createTempColumnTask = TaskTools.taskOf(() -> {
nodeTable.createColumn(tempColumn, Integer.class, false);
int i = 0;
for(Cluster cluster: annotationSet.getClusters()) {
for(CyNode node : cluster.getNodes()) {
network.getRow(node).set(tempColumn, i);
}
i++;
}
});
// Layout the clusters
Collection<Collection<CyNode>> clusters = annotationSet.getClusters().stream().map(Cluster::getNodes).collect(Collectors.toSet());
LayoutClustersTaskFactory layoutTaskFactory = layoutTaskFactoryFactory.create(clusters, annotationSet.getParent().getNetworkView(), tempColumn);
TaskIterator layoutTasks = layoutTaskFactory.createTaskIterator();
// Delete the temp column
Task deleteTempColumnTask = TaskTools.taskOf(() -> {
nodeTable.deleteColumn(tempColumn);
});
TaskIterator tasks = new TaskIterator();
tasks.append(TaskTools.taskMessage("Layout '" + annotationSet.getName() + "'"));
tasks.append(createTempColumnTask);
tasks.append(layoutTasks);
tasks.append(deleteTempColumnTask);
return tasks;
}
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:37,代码来源:LayoutAnnotationSetTaskFactory.java
示例8: execute
import org.cytoscape.work.Task; //导入依赖的package包/类
@Override
public void execute(TaskIterator iterator, TaskObserver observer) {
TaskMonitor monitor = mock(TaskMonitor.class);
FinishStatus finishStatus = null;
Task task = null;
try {
while(iterator.hasNext()) {
task = iterator.next();
if(tasksToIgnore.contains(task.getClass())) {
//System.out.println("Task Ignored: " + task.getClass());
continue;
}
task.run(monitor);
//System.out.println("Task Ran: " + task.getClass());
if(task instanceof ObservableTask && observer != null) {
observer.taskFinished((ObservableTask)task);
}
}
finishStatus = FinishStatus.getSucceeded();
} catch(Exception e) {
finishStatus = FinishStatus.newFailed(task, e);
e.printStackTrace();
throw new AssertionError("Task failed", e);
} finally {
if(observer != null) {
observer.allFinished(finishStatus);
}
}
}
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:35,代码来源:SerialTestTaskManager.java
示例9: SimpleTaskFactory
import org.cytoscape.work.Task; //导入依赖的package包/类
public SimpleTaskFactory(FactoryMethod<Task> factory) {
this.factory = factory;
}
开发者ID:baryshnikova-lab,项目名称:safe-java,代码行数:4,代码来源:SimpleTaskFactory.java
示例10: registerCommand
import org.cytoscape.work.Task; //导入依赖的package包/类
private void registerCommand(BundleContext bc, String name, Class<? extends Task> type, String description) {
TaskFactory taskFactory = taskFactory(injector.getProvider(type));
registerCommand(bc, name, false, taskFactory, description);
}
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:5,代码来源:CyActivator.java
示例11: createDrawTask
import org.cytoscape.work.Task; //导入依赖的package包/类
Task createDrawTask(Cluster cluster);
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:2,代码来源:RenderTaskFactory.java
注:本文中的org.cytoscape.work.Task类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论