On May 9, 5:44 pm, "418...@cepsz.unizar.es" <418...@cepsz.unizar.es>
wrote:
> Hi everybody,
>
[quoted text clipped - 6 lines]
> The obvious approach is to store snapshots of previous states of the
> application desktop to restore them if necessary.
That's one way. It's probably not the right way.
> But then I start
> thinking about how many undos to support, if I will support redos,
> etc. Just wondering if there's something out there on this subject.
javax.swing.undo
The 'things' you draw should be stored in some sort of Collection.
This, in combination with the undo functionality will allow you to
draw only thing things you want, when you want. For example, you
could allow the user to show only Rectangles. The painting code would
iterate over this Collection, drawing whatever items meet the users
requirements.
Jim S.