use of org.ivis.layout.LNode in project cytoscape-impl by cytoscape.
the class CoSELayoutAlgorithmTask method createLNode.
private LNode createLNode(final LayoutNode layoutNode, final LGraph graph, final CoSELayout cose, final Map<CyNode, LNode> lNodeMap) {
final VNode vn = new VNode(layoutNode);
final LNode ln = graph.add(cose.newNode(vn));
ln.setCenter(layoutNode.getX(), layoutNode.getY());
ln.setWidth(layoutNode.getWidth());
ln.setHeight(layoutNode.getHeight());
lNodeMap.put(layoutNode.getNode(), ln);
return ln;
}
use of org.ivis.layout.LNode in project cytoscape-impl by cytoscape.
the class CoSELayoutAlgorithmTask method traverseLNodeTree.
private void traverseLNodeTree(final LayoutNode layoutNode, final LGraph graph, final CoSELayout cose, final Map<CyNode, LNode> lNodeMap, final Map<CyNode, LayoutNode> layoutNodeMap, final CyGroupManager groupManager) {
if (lNodeMap.containsKey(layoutNode.getNode()))
// This node has already been visited!
return;
final LNode ln = createLNode(layoutNode, graph, cose, lNodeMap);
if (groupManager.isGroup(layoutNode.getNode(), networkView.getModel())) {
final CyGroup group = groupManager.getGroup(layoutNode.getNode(), networkView.getModel());
if (group != null) {
final LGraphManager gm = cose.getGraphManager();
final LGraph subGraph = gm.add(cose.newGraph("G" + group.getGroupNetwork().getSUID()), ln);
for (CyNode childNode : group.getNodeList()) {
final LayoutNode childLayoutNode = layoutNodeMap.get(childNode);
if (childLayoutNode != null)
traverseLNodeTree(childLayoutNode, subGraph, cose, lNodeMap, layoutNodeMap, groupManager);
}
}
}
}
Aggregations