TreeStructure treeStructure = dhnsGlobal.getGraphStructure().getMainView().getStructure();
GraphFactoryImpl factory = dhnsGlobal.factory();
//Nodes
for (int i = 0; i < 15; i++) {
AbstractNode node = factory.newNode();
node.getNodeData().setLabel("Node " + i);
graphGlobal.addNode(node);
nodeMap.put(node.getNodeData().getLabel(), node);
}
//2
controller = new DhnsGraphController();
dhnsGlobal2 = new Dhns(controller, null);
graphGlobal2Directed = new HierarchicalDirectedGraphImpl(dhnsGlobal2, dhnsGlobal2.getGraphStructure().getMainView());
graphGlobal2Undirected = new HierarchicalUndirectedGraphImpl(dhnsGlobal2, dhnsGlobal2.getGraphStructure().getMainView());
treeStructure = dhnsGlobal2.getGraphStructure().getMainView().getStructure();
factory = dhnsGlobal2.factory();
//Nodes
for (int i = 0; i < 3; i++) {
Node node = factory.newNode();
graphGlobal2Directed.addNode(node);
}
int i = 0;
for (Node n : graphGlobal2Directed.getTopNodes().toArray()) {
AbstractNode newC = factory.newNode();
graphGlobal2Directed.addNode(newC, n);
nodeMap.put("Leaf " + (i++), newC);
newC = factory.newNode();
graphGlobal2Directed.addNode(newC, n);
nodeMap.put("Leaf " + (i++), newC);