GraphmlFactory factory = GraphmlFactory.getInstance(); GraphmlDiagram diagram = factory.newDiagram();A diagram contains nodes and edges which connect the nodes.
GraphmlFactory factory = GraphmlFactory.getInstance(); GraphmlDiagram diagram = factory.newDiagram(); DiagramDefaults defaults = diagram.getDefaults(); defaults.nodeFillColor = "#FFFFFF";
GraphmlDiagram diagram = factory.openDiagram(file);or:
GraphmlDiagram diagram = factory.openDiagram(file, defaults);Note that you can open a diagrams produced by the yEd tool.
graphml
file:factory.saveDiagram(diagram, file);Note that saved diagrams are compatible with the yEd tool.
GraphmlFactory factory = GraphmlFactory.getInstance(); GraphmlDiagram diagram = factory.newDiagram(); GraphMLNode node1 = diagram.addNode(); node1.setX(10); node1.setY(10); GraphMLNode node2 = diagram.addNode(); node2.setX(100); node2.setY(100); GraphMLEdge edge = diagram.addEdge(node1, node2);
Copyright 2021 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence