executeCommand(command);
}
private Command createDeleteCommand(GraphElement element) {
if (element instanceof Node) {
NodeDeleteCommand result = new NodeDeleteCommand();
result.setNode((Node) element);
return result;
} else if (element instanceof Transition) {
TransitionDeleteCommand result = new TransitionDeleteCommand();
result.setTransition((Transition) element);
return result;
} else if (element instanceof Swimlane) {
ProcessDefinitionRemoveSwimlaneCommand result = new ProcessDefinitionRemoveSwimlaneCommand();
result.setSwimlane((Swimlane) element);
result.setProcessDefinition((ProcessDefinition) selectedPart.getParent().getModel());
return result;
} else if (element instanceof Action) {
ActionDeleteCommand command = new ActionDeleteCommand();
command.setAction((Action) element);
return command;