Login | Register
My pages Projects Community openCollabNet

Discussions > users > Undo in GEF

gef
Discussion topic

Back to topic list

Undo in GEF

Reply

Author bobtarling
Full name Bob Tarling
Date 2005-06-11 07:06:27 PDT
Message I've started work on an undo facility in GEF.

The basic structure is an UndoManager containing a stack of mementos
that can be undone. An UndoAction has been provided to remove the top
item from the stack and undo it. A RedoAction will also be provided.

A memento is created and handed to the stack whenever GEF or an
application performs some task that is to be undone.

See the UndoManager class and Memento interface in GEF CVS.

For how to create and apply a Memento to the UndoManager see the
changes made in ModeModify and ModePlace to introduce their inner
class mementos.

I am concentrating on undo for now, redo will follow later.

I don't like the existing undo methods on Cmd. This suggests only Cmds
can be undone. We want to be able to undo Mode events, other events
and Actions.

The current Cmd hierarchy will be abolished in time and all GEF
Actions will become more vanilla Java, simply extending
AbstractAction.

If you build the latest CVS of http://gefdemo.tigris.org you will now
see undo in action. Try placing a class on a diagram, moving it and
then reshaping it. All 3 of those are now undoable.

Please feed back any comments on my implementation.

I'd also be very grateful for patches to implement undo further throughout GEF.

[this has been cross posted to argouml dev and GEF user lists. Please
respond to GEF dev list only]

Regards

Bob.

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

Undo in GEF bobtarling Bob Tarling 2005-06-11 07:06:27 PDT
Messages per page: