private void doUndoable(Memento memento) { // TODO: Undo should be managed externally or we should be given // an Undo manager to use (the project's) rather than using a global one // if (DiagramUndoManager.getInstance().isGenerateMementos()) { // DiagramUndoManager.getInstance().addMemento(memento); // } memento.redo(); // TODO: Mark diagram/project as dirty? }
@Override public void undo() { memento.undo(); }
@Override public String toString() { return memento.toString(); }
@Override public Object execute() { memento.redo(); return null; }