private boolean initObserver() { if (observer == null || observer.isDestroyed() || observer.getGraph().getView() != graphModel.getVisibleView()) { if (observer != null && !observer.isDestroyed()) { observer.destroy(); } observer = graphModel.createGraphObserver(graphModel.getGraphVisible(), false); return true; } return false; }
public void destroyGraphObserver(GraphObserver observer) { checkGraphObserver(observer); store.autoWriteLock(); try { if (observer.getGraph().getView().isMainView()) { store.destroyGraphObserver((GraphObserverImpl) observer); } else { store.viewStore.destroyGraphObserver((GraphObserverImpl) observer); } } finally { store.autoWriteUnlock(); } }
public void destroyGraphObserver(GraphObserver observer) { checkGraphObserver(observer); store.autoWriteLock(); try { if (observer.getGraph().getView().isMainView()) { store.destroyGraphObserver((GraphObserverImpl) observer); } else { store.viewStore.destroyGraphObserver((GraphObserverImpl) observer); } } finally { store.autoWriteUnlock(); } }
if (observer != null && (graphModel == null || observer.getGraph() != graph)) { if (!observer.isDestroyed()) { observer.destroy();