}
@Override
public void execute() {
final List<SNode> shp = new ArrayList<SNode>();
final SketchDocument doc = (SketchDocument) context.getDocument();
for(SNode node : context.getSelection().items()) {
doc.getCurrentPage().remove(node);
shp.add(node);
}
context.getSelection().clear();
context.redraw();
context.getUndoManager().pushAction(new UndoManager.UndoableAction(){
public void executeUndo() {
for(SNode shape : shp) {
doc.getCurrentPage().add(shape);
}
context.redraw();
}
public void executeRedo() {
for(SNode shape : shp) {
doc.getCurrentPage().remove(shape);
}
context.redraw();
}
public String getName() {
return "delete";