Is this your first time here? SwingWiki is a Java Swing Developer community site with an big archive of Swing-related usenet groups and mailing lists, but also tips, tricks and articles and book reviews written by your colleagues from around the world. If you came here through a search engine and did not find what you were looking for, make sure to check the wiki table of contents.

Re: Does anyone else thinks that swing.text is the worst part of

From:[jdnc-interest@masked-domain]
Sent on:Tue, 08 Jul 2008 12:05:47 PDT
In reply to:Does anyone else thinks that swing.text is the worst part of swing? sent on Fri, 04 Jul 2008 16:39:47 PDT by [jdnc-interest@masked-domain]
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]
Found what you were looking for? If not - continue at Wiki Index

Other messages in this topic

SenderDate sentSubject
[jdnc-interest@masked-domain]Tue, 08 Jul 2008 16:29:00 PDTRe: Does anyone else thinks that swing.text is the worst part of
[jdnc-interest@masked-domain]Tue, 08 Jul 2008 00:12:07 PDTRe: Does anyone else thinks that swing.text is the worst part of
[jdnc-interest@masked-domain]Mon, 07 Jul 2008 23:57:28 PDTRe: Does anyone else thinks that swing.text is the worst part of
[jdnc-interest@masked-domain]Mon, 07 Jul 2008 21:10:11 PDTRe: Does anyone else thinks that swing.text is the worst part of
[jdnc-interest@masked-domain]Mon, 07 Jul 2008 12:03:34 PDTRe: Does anyone else thinks that swing.text is the worst part of
[jdnc-interest@masked-domain]Mon, 07 Jul 2008 12:01:34 PDTRe: Does anyone else thinks that swing.text is the worst part of
[jdnc-interest@masked-domain]Mon, 07 Jul 2008 11:16:43 PDTRe: Does anyone else thinks that swing.text is the worst part of
[jdnc-interest@masked-domain]Mon, 07 Jul 2008 09:54:39 PDTRe: Does anyone else thinks that swing.text is the worst part of
[jdnc-interest@masked-domain]Sun, 06 Jul 2008 18:01:16 PDTRe: Does anyone else thinks that swing.text is the worst part of
[jdnc-interest@masked-domain]Sun, 06 Jul 2008 03:33:00 PDTRe: Does anyone else thinks that swing.text is the worst part of
[jdnc-interest@masked-domain]Fri, 04 Jul 2008 21:34:22 PDTRe: Does anyone else thinks that swing.text is the worst part of
[jdnc-interest@masked-domain]Fri, 04 Jul 2008 18:29:02 PDTRe: Does anyone else thinks that swing.text is the worst part of

 
Recent changes | RSS changes | Table of contents | News Archive | Terms And Conditions | Register | The Quest For Software++| Ruby Resources| Agile acceptance testing resources