GraphMLNode node = diagram.addNode(); node.setFillColor("red"); // will fill the two states of the group node
GraphMLFactory factory = GraphMLFactory.getInstance(); GraphMLDiagram diagram = factory.newDiagram(); // create first group GraphMLGroupNode gnode1 = diagram.addGroupNode(); gnode1.setLabel("Group 1"); GraphMLNode node1 = gnode1.addNode(); node1.setLabel("Node 1"); GraphMLNode node2 = gnode1.addNode(); node2.setLabel("Node 2"); // create second group GraphMLGroupNode gnode2 = diagram.addGroupNode(); gnode2.setLabel("Group 2"); GraphMLNode node3 = gnode2.addNode(); node3.setLabel("Node 3"); GraphMLNode node4 = gnode2.addNode(); node4.setLabel("Node 4"); // create edges GraphMLEdge edge = node1.addEdgeTo(node2); GraphMLEdge edge2 = node3.addEdgeTo(node4); GraphMLEdge edge3 = node1.addEdgeTo(node4);
Copyright 2021 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence