GraphMLNode node = diagram.addNode(); node.setX(10); node.setY(10);To set the size of a node:
GraphMLNode node = diagram.addNode(); node.setWidth(50); node.setHeight(100);To set the size of a node, such that it will always be set to correctly enclose its label:
GraphMLNode node = diagram.addNode(); node.setAutosized(true);To set the color of a node:
GraphMLNode node = diagram.addNode(); node.getShapeNode().setFillColor("red");You can also specify that the fill or the border of the node will be transparent. For example:
GraphMLNode node = diagram.addNode(); node.setHasFillColor(false); node.setHasBorderColor(false);
GraphMLNode node = diagram.addNode(); node.setLabel("The Label");
GraphMLNode node = diagram.addNode(); NodeLabel label = node.setLabel("The Label"); label.setTextColor(Color.RED);
GraphMLNode node = diagram.addNode(); node.setType(ShapeType.ROUNDRECTANGLE);
GraphMLNode node = diagram.addNode(); DropShadow dropShadow = new DropShadow(3, 3); node.setDropShadow(dropShadow);By default the text color is black, but it is possible to set the text color. For example:
GraphMLNode node = diagram.addNode(); NodeLabel label = node.setLabel("The Label"); label.setTextColor(Color.RED);
node
for the graphml implementation but vertex
for the genzric library. In all cases, methods which refer to vertex deal with nodes because they refer to the same concept.node
for the graphml implementation is because it is the name which is used in the XML format and specification.
GraphmlFactory factory = GraphmlFactory.getInstance(); GraphmlDiagram diagram = factory.newDiagram(); GraphMLNode node = diagram.addNode(); node.setX(10); node.setY(10);
Copyright 2021 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence