当前位置: 首页>>代码示例>>Java>>正文


Java TaskIterator.append方法代码示例

本文整理汇总了Java中org.cytoscape.work.TaskIterator.append方法的典型用法代码示例。如果您正苦于以下问题:Java TaskIterator.append方法的具体用法?Java TaskIterator.append怎么用?Java TaskIterator.append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.cytoscape.work.TaskIterator的用法示例。


在下文中一共展示了TaskIterator.append方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createAnnotations

import org.cytoscape.work.TaskIterator; //导入方法依赖的package包/类
private void createAnnotations() {
	if(networkView == null)
		return;
	
	TabPanel tabPanel = (TabPanel)tabPane.getSelectedComponent();
	AnnotationSetTaskParamters params = tabPanel.createAnnotationSetTaskParameters();
	
	TaskIterator tasks = new TaskIterator();
	tasks.append(TaskTools.taskMessage("Generating Clusters"));
	
	// clusterMaker does not like it when there are collapsed groups
	CollapseAllTaskFactory collapseAllTaskFactory = collapseTaskFactoryFactory.create(Grouping.EXPAND, params.getNetworkView());
	tasks.append(collapseAllTaskFactory.createTaskIterator());
	
	CreateAnnotationSetTask createTask = createTaskFactory.create(params);
	tasks.append(createTask);
	
	dialogTaskManager.execute(tasks);
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:20,代码来源:CreateAnnotationSetDialog.java

示例2: runSelectAnnotationSetTasks

import org.cytoscape.work.TaskIterator; //导入方法依赖的package包/类
private void runSelectAnnotationSetTasks(NetworkViewSet networkViewSet, AnnotationSet toSelect) {
	// Disable the combo so the user can't somehow start a new task while this one is still running
	annotationSetCombo.setEnabled(false);
	
	TaskIterator tasks = new TaskIterator();
	
	// Expand all the groups
	CollapseAllTaskFactory collapseAllTaskFactory = collapseTaskFactoryFactory.create(Grouping.EXPAND, networkViewSet);
	tasks.append(collapseAllTaskFactory.createTaskIterator());
	
	// Select the annotation set (fires event that redraws annotations)
	tasks.append(taskOf(() -> networkViewSet.select(toSelect)));
	
	// Enable the combo box
	TaskObserver observer = allFinishedObserver(() -> annotationSetCombo.setEnabled(true));
	
	dialogTaskManager.execute(tasks, observer);
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:19,代码来源:ClusterPanel.java

示例3: createTaskIterator

import org.cytoscape.work.TaskIterator; //导入方法依赖的package包/类
@Override
public TaskIterator createTaskIterator() {
	TaskIterator tasks = new TaskIterator();
	
	CyLayoutAlgorithm attributeCircle = layoutManager.getLayout("attributes-layout");
	TaskIterator attributeLayoutTasks = attributeCircle.createTaskIterator(view, attributeCircle.createLayoutContext(), CyLayoutAlgorithm.ALL_NODE_VIEWS, layoutAttribute);
	tasks.append(attributeLayoutTasks);
	
	CyLayoutAlgorithm force_directed = layoutManager.getLayout("force-directed");
	
	for(Collection<CyNode> cluster : clusters) {
		Set<View<CyNode>> nodeViewSet = new HashSet<>();
		for(CyNode node : cluster) {
			nodeViewSet.add(view.getNodeView(node));
		}
		// Only apply layout to nodes of size greater than 4
		if (nodeViewSet.size() > 4) {
			TaskIterator forceTasks = force_directed.createTaskIterator(view, force_directed.createLayoutContext(), nodeViewSet, null);
			tasks.append(forceTasks);
		}
	}
	
	return tasks;
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:25,代码来源:LayoutClustersTaskFactory.java

示例4: getExpandTasks

import org.cytoscape.work.TaskIterator; //导入方法依赖的package包/类
private TaskIterator getExpandTasks(Collection<CyNetworkView> networkViewsToCollapse) {
	TaskIterator tasks = new TaskIterator();
	tasks.append(TaskTools.taskMessage("Expanding all clusters"));
	// Right here, expand and remove all groups in networks managed by AutoAnnotate
	for(CyNetworkView networkView : networkViewsToCollapse) {
		CollapseAllTaskFactory collapseAction = collapseActionFactory.create(Grouping.EXPAND, networkView);
		tasks.append(collapseAction.createTaskIterator());
	}
	return tasks;
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:11,代码来源:ModelTablePersistor.java

示例5: handle

import org.cytoscape.work.TaskIterator; //导入方法依赖的package包/类
@Subscribe
public void handle(ModelEvents.ClusterChanged event) {
	Cluster cluster = event.getCluster();
	if(cluster.getParent().isActive()) {
		TaskIterator tasks = new TaskIterator();
		
		if(cluster.isCollapsed())
			tasks.append(eraseTaskProvider.create(cluster));
		else
			tasks.append(drawTaskProvider.create(cluster));
		
		syncTaskManager.execute(tasks);
	}
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:15,代码来源:AnnotationRenderer.java

示例6: createTaskIterator

import org.cytoscape.work.TaskIterator; //导入方法依赖的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

示例7: createTasks

import org.cytoscape.work.TaskIterator; //导入方法依赖的package包/类
private void createTasks(AnnotationSetTaskParamters params) {
	TaskIterator tasks = new TaskIterator();
	tasks.append(TaskTools.taskMessage("Generating Clusters"));
	
	// clusterMaker does not like it when there are collapsed groups
	CollapseAllTaskFactory collapseAllTaskFactory = collapseTaskFactoryFactory.create(Grouping.EXPAND, params.getNetworkView());
	tasks.append(collapseAllTaskFactory.createTaskIterator());
	
	CreateAnnotationSetTask createTask = createTaskFactory.create(params);
	createTask.setIsCommand(true); // hackey way to tell the AnnotationRenderer to run synchronously
	tasks.append(createTask);
	
	insertTasksAfterCurrentTask(tasks);
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:15,代码来源:AnnotateCommandTask.java

示例8: createTaskIterator

import org.cytoscape.work.TaskIterator; //导入方法依赖的package包/类
@Override
public TaskIterator createTaskIterator() {
	
    
	TaskIterator programTasks = new TaskIterator();
	String networkName = inputTask.graphName;
	CyNetwork network = null;
	
	for (CyNetwork n: CyActivator.networkManager.getNetworkSet()) {
		if ((n.getRow(n).get(CyNetwork.NAME, String.class).equals(networkName))) {
			network = n;
		}
	}
	
	InputTask userInput = inputTask;
	
	// If training a bayesian network then add training task to the iterator, otherwise
	// Perform only simple search
	TrainingTask train = new TrainingTask(network, userInput);
	if (userInput.supervisedLearning) {
		programTasks.append(train);
	}
	search = new SearchTask(network, userInput, train);
	programTasks.append(search);
	
	return programTasks;
}
 
开发者ID:DataFusion4NetBio,项目名称:Paper16-SCODE,代码行数:28,代码来源:SupervisedComplexTaskFactory.java

示例9: createTaskIterator

import org.cytoscape.work.TaskIterator; //导入方法依赖的package包/类
@Override
public TaskIterator createTaskIterator(CyNetwork network) {
	TaskIterator tasks = new TaskIterator();
	tasks.append(new GenModelTask());
	return tasks;
}
 
开发者ID:DataFusion4NetBio,项目名称:Paper16-SCODE,代码行数:7,代码来源:GenModelTaskFactory.java


注:本文中的org.cytoscape.work.TaskIterator.append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。