// try {
// fToolbar.updateUndoRedoButtons(fCommandController.canUndo(),fCommandController.canRedo());
// getGraphElementsVisibilityController().updateGraphElementsVisibility();
final DependencyGraph graph = (DependencyGraph) fGraphView.getGraph2D();
if (doLayout) {
final LayoutModule layoutModule = graph.getLayoutModule();
layoutModule.addModuleListener(new ModuleListener() {
public void moduleEventHappened(ModuleEvent event) {
if (event.getEventType() == ModuleEvent.TYPE_MODULE_MAIN_RUN_FINISHED) {
if (postLayout != null) {
postLayout.updateSelection();
}
// fGraphView.fitContent();
fGraphView.updateView();
// graph.updateViews();
} else if (event.getEventType() == ModuleEvent.TYPE_MODULE_DISPOSED) {
layoutModule.removeModuleListener(this);
}
}
});
if (preLayout != null) {
preLayout.updateSelection();
}
sLogger.info("Do graph layout " + getSelectionString());
layoutModule.start(graph);
} else {
// fGraphView.fitContent();
fGraphView.updateView();
// graph.updateViews();
}