Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » WindowBuilder » WindowBuilder Design Mode changes parent when moving objects(Change to way WindowBuilder behaves in design mode.)
WindowBuilder Design Mode changes parent when moving objects [message #762745] Thu, 08 December 2011 15:14 Go to next message
David Garratt is currently offline David GarrattFriend
Messages: 42
Registered: July 2011
Member
I have a great many Swing screens setup to use the absolute layout. They were all created initially with WindowBuilder Pro (over the years). Without going into the merits of absolute layout model I now find that when I am in design mode and move a visual component the hierarchy of the objects changes with the net effect that the object that I moved is no longer visible.

Effectively my hierarchy starts as something like

JFrame -> ContentPane -> DesktopPane -> JButton

I move the position on screen of the button, expecting that the bounds x,y co-ordinates are updated and find that the structure has changed to

JFrame -> ContentPane -> JButton

I don't want to have to re-invent all my code so that I can continue using WindowBuilder - can anyone suggest what has happened here ?

Dave

[Updated on: Thu, 08 December 2011 15:16]

Report message to a moderator

Re: WindowBuilder Design Mode changes parent when moving objects [message #763602 is a reply to message #762745] Sat, 10 December 2011 04:16 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric ClaybergFriend
Messages: 979
Registered: July 2009
Location: Boston, MA
Senior Member
I tried this using the hierarchy you described, and it worked fine on my end. Therefore, it would be useful to see a complete example class which will reproduce this behavior.
Re: WindowBuilder Design Mode changes parent when moving objects [message #764026 is a reply to message #763602] Sun, 11 December 2011 06:14 Go to previous messageGo to next message
David Garratt is currently offline David GarrattFriend
Messages: 42
Registered: July 2011
Member
The source code (entire project) can be downloaded from www.commander4j.com - look for version 3.73 and download b4.zip

A good example of the issue can be replicated if you open up the Frame called JFrameHostAdmin.java in the package called com.commander4j.cfg

Use the WindowBuilder visual designer to move the Site No field a few mm in any direction and the source will be reformed so that the object no longer has desktop pane as its parent and disappears from view.

Many thanks for help on this.

Dave

Re: WindowBuilder Design Mode changes parent when moving objects [message #764179 is a reply to message #764026] Sun, 11 December 2011 15:44 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric ClaybergFriend
Messages: 979
Registered: July 2009
Location: Boston, MA
Senior Member
I'll take a look at that project.

In the mean time, if you try this with a new, simple JFrame example, do you see the same behavior?
Re: WindowBuilder Design Mode changes parent when moving objects [message #764209 is a reply to message #764179] Sun, 11 December 2011 17:06 Go to previous messageGo to next message
David Garratt is currently offline David GarrattFriend
Messages: 42
Registered: July 2011
Member
New Frame is ok - it seems to be a problem parsing my old stuff.

Thanks

Dave
Re: WindowBuilder Design Mode changes parent when moving objects [message #764832 is a reply to message #764209] Mon, 12 December 2011 23:21 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric ClaybergFriend
Messages: 979
Registered: July 2009
Location: Boston, MA
Senior Member
I tried your example code and it worked fine on my end. I moved several widgets around including the one you mentioned (see the pic below).

index.php/fa/6445/0/

What exact build of WB are you using?

[Updated on: Mon, 12 December 2011 23:22]

Report message to a moderator

Re: WindowBuilder Design Mode changes parent when moving objects [message #764976 is a reply to message #764832] Tue, 13 December 2011 08:06 Go to previous messageGo to next message
David Garratt is currently offline David GarrattFriend
Messages: 42
Registered: July 2011
Member
Curious. Then it's maybe my environment which is the problem. I am working on a MacBook Pro running OSX Lion.

java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)

Eclipse 3.7 SR1

(see attached screen dump for detailed versions)

I will try and replicate the problem on a Windows (vmware) machine.

Thanks for your help on this issue.

Dave

Re: WindowBuilder Design Mode changes parent when moving objects [message #764985 is a reply to message #764832] Tue, 13 December 2011 08:20 Go to previous messageGo to next message
David Garratt is currently offline David GarrattFriend
Messages: 42
Registered: July 2011
Member
I've tested within my Windows environment and I cannot replicate the problem, so it's something specific to the OSX setup. I've reinstalled Eclipse and WindowBuilder without any improvement on the OSX front.

Can you suggest anything which would help pin down the nature of the problem in my preferred, default setup ?

Thanks again

Dave
Re: WindowBuilder Design Mode changes parent when moving objects [message #765066 is a reply to message #764832] Tue, 13 December 2011 10:57 Go to previous messageGo to next message
David Garratt is currently offline David GarrattFriend
Messages: 42
Registered: July 2011
Member
Final test with the Integration build of the WindowBuilder did not help - not sure what to try next.

Dave
Re: WindowBuilder Design Mode changes parent when moving objects [message #765338 is a reply to message #765066] Tue, 13 December 2011 21:34 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric ClaybergFriend
Messages: 979
Registered: July 2009
Location: Boston, MA
Senior Member
We'll look into the OSX angle. I only tried it under Windows myself.
Re: WindowBuilder Design Mode changes parent when moving objects [message #765809 is a reply to message #765338] Wed, 14 December 2011 18:01 Go to previous message
Eric Clayberg is currently offline Eric ClaybergFriend
Messages: 979
Registered: July 2009
Location: Boston, MA
Senior Member
After further investigation, it appears that Apple is doing something unusual under the covers with JDesktopPane which is not done under Windows. They are giving it a custom, non-standard layout (not absolute layout) when it is instantiated which WB does not recognize. WB does not provide editing support for that layout, so it treats it as a generic, unknown layout and basically ignores it as a drop site.

The work around appears to be simple, Be explicit about your layout choice and add "desktopPane.setLayout(null);" to your code. That will force it to actually use absolute layout and WB will be able to edit it.

Also, in researching this, it appears that your use of JDesktopPane itself is very unusual (see its JavaDoc) so I wonder why you are using it this way at all. I'm guessing that what Apple is doing under the covers here is in support of JDesktopPane normal mission in the context of OSX.
Previous Topic:Binding through several instances?
Next Topic:Part of Selection table binding problem
Goto Forum:
  


Current Time: Tue Apr 23 14:29:03 GMT 2024

Powered by FUDForum. Page generated in 0.04260 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top