public void setGraphGenerator(GraphGenerator generator) {
if(generator == null) {
throw new NullPointerException("GraphGenerator must not be null");
}
GraphGenerator oldGraphGenerator = this.graphGenerator;
this.graphGenerator = generator;
Iterator it = oldGraphGenerator.getGraphGeneratorListeners();
while(it.hasNext()) {
GraphGeneratorListener lsnr = (GraphGeneratorListener) it.next();
graphGenerator.addGraphGeneratorListener(lsnr);
it.remove();
}