if (diagramView != null) {
final Diagram diag = diagramView;
TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(diagramView);
AbstractEMFOperation operation = new AbstractEMFOperation(
ted, KEY_NEURAL_NETWORK_LAYOUT, null) {
protected IStatus doExecute(IProgressMonitor monitor,
IAdaptable info)
throws ExecutionException {
LayoutService.getInstance().layout(diag, NeuralNetworkProvider.NEURAL_NETWORK_LAYOUT);
return Status.OK_STATUS;
}
};
try {
operation.execute(new NullProgressMonitor(), null);
}
catch (Exception e) {
throw new RuntimeException(e.getCause());
}
}