*/
public void setModel(GraphModel data, GraphLayout2D layout) {
if (data == null) {
throw new NullPointerException("data");
}
GraphModel oldModel = this.dataModel;
if (oldModel != null) {
clearCanvas();
oldModel.removeModelListener(modelListener);
}
GraphLayout2D oldLayout = this.layout;
if (oldLayout != null) {
oldLayout.removeGraphLayoutListener(modelListener);
oldLayout.removeNodeExpansionListener(modelListener);