@Override
public void runWithEvent( Event event ) {
EditGeom currentGeom = handler.getCurrentGeom();
if( currentGeom==null )
return;
EditBlackboard editBlackboard = currentGeom.getEditBlackboard();
if( editBlackboard.getSelection().isEmpty() || hasNoPoints() ){
UndoableComposite composite=new UndoableComposite();
composite.getCommands().add(new SetEditStateCommand(handler, EditState.BUSY));
composite.getCommands().add(new RemoveAllVerticesCommand(handler));
composite.getCommands().add(handler.getCommand(handler.getAcceptBehaviours()));
composite.getCommands().add(new SetCurrentGeomCommand(handler, (PrimitiveShape)null));
composite.getFinalizerCommands().add(new SetEditStateCommand(handler, EditState.MODIFYING));
handler.getContext().sendASyncCommand(composite);
}else{
UndoableComposite composite=new UndoableComposite();
composite.getFinalizerCommands().add(new SetEditStateCommand(handler, EditState.MODIFYING));
composite.getCommands().add(new SetEditStateCommand(handler, EditState.BUSY));
RemoveSelectedVerticesCommand removeCommand = new RemoveSelectedVerticesCommand(handler);
removeCommand.setRunAnimation(editBlackboard.getSelection().size()<10);
composite.getCommands().add(removeCommand);
handler.getContext().sendASyncCommand(composite);
}
}