Add a node in the graph.
This acts as a factory, creating the node instance automatically (and eventually using the node factory provided). An event is generated toward the listeners. If strict checking is enabled, and a node already exists with this identifier, an {@link org.graphstream.graph.IdAlreadyInUseException} is raised. Else theerror is silently ignored and the already existing node is returned.
This method is implicitly generic and returns something which extends Node. The return type is the one of the left part of the assignment. For example, in the following call :
ExtendedNode n = graph.addNode("...");
the method will return an ExtendedNode. If no left part exists, method will just return a Node.
@param id Arbitrary and unique string identifying the node.
@return The created node (or the already existing node).
@throws IdAlreadyInUseException If strict checking is enabled the identifier is already used.