[nbusers] Re: editing generated code
- From: trhouse < >
- Subject: [nbusers] Re: editing generated code
- Date: Thu, 25 Oct 2012 15:26:27 -0700
I am under the possibly mistaken impression that the GUI editor screwed up somehow, trashing my GUI. It's not a big deal, it's easily recreated, but when I went to fix it I suddenly understood that I couldn't, as in, it was not permitted. I wondered why. It's gotta be because while NB can produce a legal interface by writing code that's not the same thing as being able to read arbitrary but legal code and produce an interface from it. So part of it was just that- I can't edit it and if it goes south I have to start over.
But really there's more to it than that. First, the GUI builder enforces a style of programming which is orthogonal to what I want to do. Specifically around passing state through the GUI objects themselves. You can argue that you shouldn't pass state through GUI widgets ever MVC and all that, but nevertheless it forces a certain style of modeling and message passing. not everything I write needs a dedicated EventDispatcher pattern t rationalize the propagation of events.
Then there are the weird things, errors it gives me I just can't fathom, such as "(extension of swing widget) X is not a bean". Well, yeah actually, it is a bean, complete with a no arg constructor. Huge Gaps appear out of nowhere and refuse to be moved, resized or deleted and they don't appear in the form hierarchy of the Navigator so i can't get at them there. . Generally, I am finding a disconnect between what is on the screen and how I am permitted to manipulate it, to say nothing of change or fix the code which is not permitted.
I would say the GUI tool does work but is also brittle in the sense of if I start with a Frame or Dialog and add components and move them around and then finish I have a series of properly laid out components, but if *something* happens - and who knows why stuff happens- it seems unsalvagable and I find myself have to start over from scratch. That's not so bad, all GUIs are pretty simple if they're any good (arguably) but redoing the message and state passing is No Fun.
People bash GroupLayout as being overly verbose and hard to read but honestly my experience with it is just the opposite. I feel like it's not only the best and most versatile of all the layouts and also the most rational, most predictable, most amenable to both planning and post-hoc analysis. It has by far the fewest moving parts, none of them are ambiguous in their effects is clearly the most deterministic of all of the grown-up layout managers.
I never GUI builders before. This one is the best one I think, but the feeling that I am going to be redoing a lot of work on serious projects if I use it is now haunting me at every step. Better to be able to fix things that go wrong than have to start over, never mind how fast I can prototype stuff .
It's interesting, it is. I would strive to make it 2-way unless that's some kind of known to be impossible achievement. If I were going to change it, I would do that and include more features that make it more of a GroupLayout learning tool, dedicated not just to creating GUIs but also helping the programmer to understand how all that wordy code relates to the GUI. It's really pretty simple. That's for GroupLayout, now for GridbagLayout, it's hopeless because as far as anyone can tell, GridbagLayout is, if not strictly indeterminate, then too complex to predict. It's totally a trial an error process that I for one am glad to be rid of and I was good at it ;)
On 10/25/2012 11:12 AM, Javier Ortiz wrote:
If you want to do stuff not supported from the GUI editor you can't use it.
Is there anything in particular that want to do the editor doesn't seem to
Javier A. Ortiz Bultrón
Senior Software Quality Engineer
7000 West William Cannon Drive
Austin, Texas 78735
Sent: Thursday, October 25, 2012 3:25 PM
Subject: [nbusers] editing generated code
Is there some way to edit the generated layout code, some special box to
check somewhere which permits it? I can't find anything like this in the
menus or help system.
If not, I am curious, what's the rationale for this? I am guessing it's
because the GUI editor cannot process arbitrary-yet-legal layouts but rather
operates within the confines it's own sort of sub-dialect of the language of
GroupLayout. Is that about right or is it an HCI decision somehow.. what's
the force driving that decision?
The information contained in this e-mail message, together with any
attachments thereto, is intended only for the personal and confidential
use of the addressee named above. The message and the attachments
are or may be privileged or protected communication. If you are not the
intended recipient of this message, or authorized to receive it for the
intended recipient, you have received this message in error, and you
are not to review, use, disseminate, distribute or copy this message,
any attachments thereto, or their contents. If you have received this
message in error, please immediately notify us by return e-mail
message, and delete the original message.
Pursuant to Circular 230 issued by the United States Treasury
Department and relating to practice before the Internal Revenue
Services, any comment or opinion in this communication relating to a
federal tax issue is not intended to be used, and cannot be used, by a
taxpayer for the purpose of avoiding tax-related penalties that may be
imposed on the taxpayer.
[nbusers] Re: editing generated code