Re: SV: Matisse with XML?

Tomas Pavek <[email protected]>
Newsgroups gmane.comp.java.netbeans.user-interface
Message-ID <[email protected]>
Christian Hessenbruch wrote:

> Hi Tomas, thanks for the answers.
> 
> I'm aware that we lack of a full featured standard XUI, but we do have
> the .form xml - that must be some sort of standard (?) And if I where
> able to parse the .form file into components, then I would be a happy
> man.
> 
> I don't want to bore you with the actual application that I'm doing, but
> it would certainly benefit from such a feature. And yes, reuse of layout
> would be possible - at least for this project and I can't imagine that
> it's completely different from the rest of the world ;)
> 
> If there where a thorough description of .form + GroupLayout available
> I'd might even have a go at it myself, but I haven't been able to find
> any?

Unfortunately there is no description of the .form file. The current format is 
nothing we would like to publish - i.e. give it to people with a tool to 
create a UI from it. It would have to be redesigned significantly. Also note 
the .form file contains more than just layout information (but also all 
components, their properties, attached events, etc - i.e. complete UI), so it 
is probably a superfluous set of data for your purpose.

It would be theoretically possible to extract some classes that loads the 
layout model and construct the container with layout, but that would be lot of 
"hacking" work.

> 
> Best regards,
> 
> Christian
> 
> N.B. Yes it prevents me from doing GUI building on the fly. My
> application (a smartclient) is serverdriven, so if I where to use
> Matisse as is, I would have to create a class for each program on the
> server - and then suddenly my client isn't that 'smart' anymore.

Note you can have a piece of UI not being a special subclass. E.g. if you add 
a container to "Other Components" in the designer then it is available just as 
an instance of the container you used. The whole subclass would be just used 
to create it. You can actually have just one class containing any number of UI 
forms.

   - Tomas


>  
> 
> 
> 
> -----Oprindelig meddelelse-----
> Fra: Tomas Pavek [mailto:[email protected]] 
> Sendt: 31. oktober 2005 22:16
> Til: [email protected]
> Emne: Re: [nbui] Matisse with XML?
> 
> I can't say your idea is wrong; this is just the "eternal" problem of 
> declarative UI which is still not solved in java in a standar way. Your 
> suggestion is just about layout, which is a subset of the whole UI 
> information, but the problem is the same - no standard.
> 
> We could certainly implement some XML layout storage, but the benefits
> don't 
> seem to be positive enough to introduce a proprietary runtime mechanism
> that 
> would be needed. We have hard time already now introducing the
> GroupLayout as 
> a special library - but in this case we hope it finds its way to JDK, so
> it 
> would become standard. It's not that clear for the possible XML form
> parser. 
> Here we expect things to happen from the other side - i.e. JDK providing
> the 
> declaratiev format we would use and support.
> 
> On another note, besides the possibility of reusing layout (which I can
> hardly 
> imagine how it could be done in practise), does the current approach we
> use 
> prevent you from doing something?
> 
> Regards,
> Tomas
> 
> 
> Christian Hessenbruch wrote:
> 
> 
>>I suprises me that no one else see the potential in this feature
> 
> request? Or has this mailinglist simply fallen asleep?
> 
>>I don't see that component layout belongs in the application as java
> 
> statements. As I see it, it would be much cleaner to keep the layout in
> xml (form) file and instantiate it whenever needed.
> 
>>As mentioned earlier, it would make it possible to reuse layout and
> 
> enable non-developers to alter the layout. Even more it would fit very
> well with patterns like "Presentation model" / "Model View Presenter".
> I'm aware that patterns can be applied to the view-class created by
> Matisse, but it would be simpler if the (requested) FormParser would
> just request components from my application. The components returned to
> the FormParser could allready be bound to the data object.
> 
>>Do you disagree?
>>
>>/Christian
>>
>>It may be that the 'FormParser' is allready available, but I haven't
> 
> been able to locate it in the source/javadocs?!
> 
>>Links:
>>http://www.martinfowler.com/eaaDev/ModelViewPresenter.html
>>http://www.martinfowler.com/eaaDev/PresentationModel.html
>>https://binding.dev.java.net/
>>
>>
>>
>>
>>-----Original Message-----
>>From: Wade Chandler [mailto:[email protected]]
>>Sent: 29. oktober 2005 19:35
>>To: [email protected]
>>Subject: Re: [nbui] Matisse with XML?
>>
>>
>>--- Christian Hessenbruch <[email protected]> wrote:
>>
>>
>>
>>>I hope that some of the developers behind Matisse is
>>>on this mailinglist, cause I've got a suggestion,
>>>and im not sure where to send it?
>>>
>>>What I think would be *really* cool, where if
>>>Matisse offered the possiblity to export the
>>>generated layout to XML, and also provided a parser
>>>to turn the XML back into a layout.
>>>
>>>To apply the layout on my application I would have
>>>to use 'GroupLayoutParser' that would parse the XML
>>>and ask my application for the components using some
>>>interface.
>>>
>>>My application would implement something like:
>>>
>>>Interface GroupLayoutComponentSupplier {
>>> public Component getComponent(String name);
>>>}
>>>
>>>And to populate the GUI I would call something like:
>>>
>>>File xmlfile = new File(mylayout.xml);
>>>JPanel panel =
>>>GroupLayoutParser.doLayoutPanel(xmlfile, this); //
>>>this instanceof GroupLayoutComponentSupplier
>>>
>>>That way I would get rid of all the autogenerated
>>>layout code, and be able to reuse a layout. Maybe I
>>>could even allow the users of the application to
>>>rearrange the gui as it no longer affects the code
>>>(as long as components are not added).
>>>
>>>/Christian
>>>
>>
>>
>>I think java.beans.XMLEncoder may already do what you
>>want to do.  It will take a panel or frame and write
>>it out to XML in it's format and then you can
>>reinstate it later.  It's a way to long term serialize
>>beans and swing objects.
>>
>>Wade
>>
>>
> 
> ************************************************************************
> ****
> 
>>Virus checked by mailFence from Sure Solutions and nothing was found
> 
> (www.SureSolutions.dk)
> 
> ************************************************************************
> ****
> 
> ************************************************************************
> ****
> Virus checked by mailFence from Sure Solutions and nothing was found
> (www.SureSolutions.dk)
> ************************************************************************
> ****
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.