1
Einführung in die Programmierung Introduction to Programming
- Prof. Dr. Bertrand Meyer
October 2006 – February 2007
Chair of Softw are Engineering
Lecture 21: Undo/ Redo
2
- Intro. to Programming, lecture 21: Undo Redo 3
1 The problem Enabling users of an interactive system to cancel the - - PDF document
Chair of Softw are Engineering Einfhrung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer October 2006 February 2007 Lecture 21: Undo/ Redo 2 Further reference Chapter 21 of my Object-Oriented Software
October 2006 – February 2007
Chair of Softw are Engineering
2
deferred effective
class REMOVAL inherit COMMAND feature controller : EDIT_CONTROLLER
line : STRING
index : INTEGER
execute is
do line := controller.item ; index := controller.index controller.remove ; done := True end undo is
do controller.go_ith (index) controller.put_left (line) end end
(SQUARE) (RECTANGLE) (TRIANGLE) (POLYGON)
fl
Insertion Insertion Removal Insertion item
a1 : A if condition_1 then
elseif condition_2 then
... etc.
a1 : A if condition_1 then
elseif condition_2 then
... etc.
Insertion Insertion Removal Insertion item
deferred effective
Removal Insertion Swap ...
command_type
Insertion Insertion Removal Swap Insertion De- insertion De- insertion Re- insertion Swap De- insertion
Insertion Insertion Removal Insertion item
Insertion Insertion Removal Swap De- insertion De- insertion Re- insertion Swap