public void undo(){
  if (!undoStack.isEmpty()) {
    UndoableAction lastEvent=undoStack.pop();
    lastEvent.undo();
    redoStack.push(lastEvent);
  }
}

public void undo ( ) { if ( ! undoStack . isEmpty ( ) ) { UndoableAction lastEvent = undoStack . pop ( ) ; lastEvent . undo ( ) ; redoStack . push ( lastEvent ) ; } }
undo the last undoable action .
