[From nobody Fri Aug 6 17:06:36 2004 X-Mozilla-Status2: 00000000 Message-ID: <3B3CB562.B5F73AA3@swsgmbh.de> Date: Fri, 29 Jun 2001 18:05:38 +0100 From: Markus Bernhardt <mbernhardt@swsgmbh.de> X-Mailer: Mozilla 4.5 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: philip.nelson@omniresources.com Subject: Re: [jdom-interest] Re: JDOM events References: <DF5018B3C986D11196FF0060089A903C36E330@omnigbwww.omniresource.com> Content-Type: multipart/mixed; boundary="------------E355EA09C97CEA52B3F5B222" This is a multi-part message in MIME format. --------------E355EA09C97CEA52B3F5B222 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit philip.nelson@omniresources.com wrote: > > Hi > > > > Please read my mail to the list from Tuesday, 19:36 > > title: [jdom-interest] Event enabled classes > > I think the subclasses are quite complete. > > > > To Do > > ****** > > - subclass PartialList / FilterList to fire events > > - look for bugs > > - code models, like > > TreeModel, TableModel, TableColumnModel, ListSelectionModel .... > > - THINK ABOUT BUBBLING (How to implement, where to use,..) > > - .... > > I have been reading this with interest but I have to say, I think this is > the hard way to do it. In order to use these classes it seems like you > would have to > > subclass jdom core nodes already done > subclass JDOMFactory to use them already done > create listeners and add them to the tree at build time why ? > extract the info needed for models > build and set models no. the tree is used as model. > handle events already done > and locate the element to update no > update the element no > listener code does it stuff. > update model no > redraw gui does swing itself > > > This is off the top of my head and could easily be better than this in your > implementation but bear with me here ;) > > If you instead wrap the jdom nodes it gets a lot simpler I think. The > wrapper can have toString specifically taylored to the model you want to > use. I can carry a reference to the underlying JDOM core class instance. > You can build iterators of full, partial, filtered content of your document > specifically taylored to your application. Then the rest is simpler. > > build a normal jdom document > iterate on document creating wrapper nodes and insert into model > set model on gui > handle events and update node selected in model > redraw gui Question: How do you handle the 'other' direction ? Somebody creates a new Element and adds it to your tree. And then ? In your solution I have to use a reference to the model to do programatic changes. That's no option for me. I am not writing an application to just show and modify a jdom tree, but a client with trees, buttons, tables, comboboxes and ONE central jdom tree. If a command for example adds the following element <gui type="frame" size="max;600" location="center;center" visible="true" /> to my guimanager element a new JFrame will open immediatly. Remove the element and the frame is history. (That's working already !!) I think its worth to have a set of event enabled subclasses. > > > OK, maybe there's more steps than this ;) but it really is quite a bit > simpler I think. Brett's upcoming second edition of JavaXML will have an > example of doing much of this. > > _______________________________________________ > To control your jdom-interest membership: > http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com --------------E355EA09C97CEA52B3F5B222 Content-Type: text/x-vcard; charset=us-ascii; name="mbernhardt.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Markus Bernhardt Content-Disposition: attachment; filename="mbernhardt.vcf" begin:vcard n:Bernhardt;Markus tel;cell:0171-5770462 tel;fax:089-420903-20 tel;home:089-6378949 tel;work:089-420903-14 x-mozilla-html:FALSE url:www.swsgmbh.de org:Software Service Wulf Schupp GmbH;Spieljoch adr:;;Spieljochstr. 34;München;;81825;Germany version:2.1 email;internet:mbernhardt@swsgmbh.de title:Entwicklungsleiter note;quoted-printable:[dF]Quisam=0D=0Awww.discordian-Front.de=0D=0AHail Eris !!!=0D=0AHappy Frag !!! fn:Markus Bernhardt end:vcard --------------E355EA09C97CEA52B3F5B222-- ]