GraphmlFactory factory = GraphmlFactory.getInstance(); GraphmlDiagram diagram = factory.newDiagram();Note the you can set default values for the diagram elements parameters. See diagram defaults for more information.
GraphMLNode node = diagram.addNode();To add a label for the node:
node.setLabel(<the text>);To add a description for the node:
node.setDescription(<the text>);
GraphMLEdge edge = diagram.addEdge(node1, node2);To add a label for the edge:
edge.setLabel(<the text>);To add a description for the edge:
edge.setDescription(<the text>);
GraphmlFactory factory = GraphmlFactory.getInstance(); GraphmlDiagram diagram = factory.newDiagram(); DiagramDefaults defaults = diagram.getDefaults(); defaults.nodeFillColor = "#FFFFFF";
GraphmlDiagram diagram = factory.openDiagram(file);
graphml
file:factory.saveDiagram(diagram, file);
Copyright 2021 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence