Re: Does anyone else thinks that swing.text is the worst part of
Hi i30817 !
I have worked with undo/redo a little. Here's my 2 cents on one thing you mentioned...
>>>The redo and undo ....requires that the implementers call super() -
I think this is because internally, redo and undo effect the state machine of the whole Undo framework and that state is something that developers don't implement- it's implemented for us. But to remain consistent, there can't be any undoing and redoing going on behind that state machine's back. When you call super, you are making sure the state machine knows everything it needs to know in order to remain consistent.
>>>The UndoManager is not observable! Something that would be very useful for, i don't know, undo and redo buttons!
This is certainly an approach that would work. The way it's done, all undo and redo implementations can hook into any notification framework (like beans binding) that they want to. That's what I do. since I am writing the code to execute the undo (define it) then I also notify who it is that needs to be notified.
If UndoManager were observable, then observers would have to register with it. But that would be done with very generic types, and lots of casting. If every time the UndoManager undid something it starting notifying everyone, then that's a lot of notifications to entities that probably just don't care. If you fix that problem by adding "notify if condition == true" type logic, as most notification framework have, then you have a lot of responsibility on the UndoManager and it's getting pretty unfocused.
undoManager's job is to keep things straight so the undo/redo logic comes out right, whatever the undo redo functions may do as far as their exact effect on a program.
cheers!!!
...
The only way to embed a component in a swing text document is (without layout) with a property in a CharacterElement or ParagraphElement (i can't recall).
This is used to display images in a Document.
[Message sent by forum member 'swv' (swv)]
http://forums.java.net/jive/thread.jspa?messageID=285154
---------------------------------------------------------------------
To unsubscribe, e-mail: [jdnc-unsubscribe@masked-domain]
For additional commands, e-mail: [jdnc-help@masked-domain]
Other messages in this topic
| Sender | Date sent | Subject |
| [jdnc-interest@masked-domain] | Tue, 08 Jul 2008 16:29:00 PDT | Re: Does anyone else thinks that swing.text is the worst part of |
| [jdnc-interest@masked-domain] | Tue, 08 Jul 2008 00:12:07 PDT | Re: Does anyone else thinks that swing.text is the worst part of |
| [jdnc-interest@masked-domain] | Mon, 07 Jul 2008 23:57:28 PDT | Re: Does anyone else thinks that swing.text is the worst part of |
| [jdnc-interest@masked-domain] | Mon, 07 Jul 2008 21:10:11 PDT | Re: Does anyone else thinks that swing.text is the worst part of |
| [jdnc-interest@masked-domain] | Mon, 07 Jul 2008 12:03:34 PDT | Re: Does anyone else thinks that swing.text is the worst part of |
| [jdnc-interest@masked-domain] | Mon, 07 Jul 2008 12:01:34 PDT | Re: Does anyone else thinks that swing.text is the worst part of |
| [jdnc-interest@masked-domain] | Mon, 07 Jul 2008 11:16:43 PDT | Re: Does anyone else thinks that swing.text is the worst part of |
| [jdnc-interest@masked-domain] | Mon, 07 Jul 2008 09:54:39 PDT | Re: Does anyone else thinks that swing.text is the worst part of |
| [jdnc-interest@masked-domain] | Sun, 06 Jul 2008 18:01:16 PDT | Re: Does anyone else thinks that swing.text is the worst part of |
| [jdnc-interest@masked-domain] | Sun, 06 Jul 2008 03:33:00 PDT | Re: Does anyone else thinks that swing.text is the worst part of |
| [jdnc-interest@masked-domain] | Fri, 04 Jul 2008 21:34:22 PDT | Re: Does anyone else thinks that swing.text is the worst part of |
| [jdnc-interest@masked-domain] | Fri, 04 Jul 2008 18:29:02 PDT | Re: Does anyone else thinks that swing.text is the worst part of |