public void undo(StudentModel model) { System.out.println("Undoing add command."); int index = model.findIndexByElement(node); if (index >= 0) ModelUtils.removeElement(model.getElement(index), model, true); }
public Add(Node node, StudentModel model) { this.node = node; if (!model.getHistory().isEmpty() && model.getHistory().peek() instanceof Drag) model.removeActionFromHistory(); }