// Removes listeners from the previous graph
if (oldValue != null && sourceGraph != oldValue) {
oldValue.getModel().removeGraphModelListener(this);
oldValue.getGraphLayoutCache()
.removeGraphLayoutCacheListener(this);
oldValue.removePropertyChangeListener(this);
JScrollPane scrollPane = getParentScrollPane(oldValue);
if (scrollPane != null) {
scrollPane.removeComponentListener(componentListener);
scrollPane.getVerticalScrollBar()
.removeAdjustmentListener(this);