use of org.cytoscape.view.layout.CyLayoutAlgorithm in project EnrichmentMapApp by BaderLab.
the class CreateEMViewTask method visualizeMap.
private void visualizeMap() {
CyNetwork network = networkManager.getNetwork(map.getNetworkID());
CyNetworkView view = networkViewFactory.createNetworkView(network);
networkViewManager.addNetworkView(view);
//apply force directed layout
CyLayoutAlgorithm layout = layoutManager.getLayout("force-directed");
if (layout == null)
layout = layoutManager.getDefaultLayout();
Task styleTask = applyStyleTaskFactory.create(new EMStyleOptions(view, map), null, false);
TaskIterator layoutTasks = layout.createTaskIterator(view, layout.createLayoutContext(), CyLayoutAlgorithm.ALL_NODE_VIEWS, null);
TaskIterator moreTasks = new TaskIterator();
moreTasks.append(styleTask);
moreTasks.append(layoutTasks);
insertTasksAfterCurrentTask(moreTasks);
}
Aggregations