/** * Creates unique node ID in the graph that this node belongs to. */ public void createID() { String candidateID = StringUtil.convertToJavaIdentifier(this.name); Node node = this.graph.getNode(candidateID); while (node != null && node != this) { candidateID = StringUtil.incrementName(candidateID); node = this.graph.getNode(candidateID); } this.id = candidateID; for (PortImpl port : getAllPorts()) { port.createID(); } }