Migrating to GroupLayout

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Migrating to GroupLayout

Postby PeteLachall » Wed Oct 31, 2007 11:57 am

We are evaluating WindowBuilder Pro in the hopes that it'll ease the pain of migrating our existing project (which uses an old JBuilder layout manager called XYLayout) to GroupLayout. Designer seems able to render our screens, and allows us to change the layout to GroupLayout. Shortly after changing the layout, however, the Designer becomes unresponsive, and the following exception starts showing up in the Error Log:


!ENTRY com.swtdesigner 4 4 2007-10-31 11:28:33.490
!MESSAGE Designer internal error [6.5.0.20071030095216]: Component model not found for id = 95
!STACK 0
java.lang.IllegalStateException: Component model not found for id = 95
at com.swtdesigner.model.swing.layouts.managers.group.GroupLayoutInfo.getComponentBeanInfoByID(GroupLayoutInfo.java:624)
at com.swtdesigner.model.swing.layouts.managers.group.GroupLayoutInfo.getComponentBounds(GroupLayoutInfo.java:667)
at org.netbeans.modules.form.layoutdesign.LayoutDesigner.imposeCurrentContainerSize(LayoutDesigner.java:2531)
at org.netbeans.modules.form.layoutdesign.LayoutDesigner.updatePositions(LayoutDesigner.java:133)
at org.netbeans.modules.form.layoutdesign.LayoutDesigner.updateCurrentState(LayoutDesigner.java:72)
at com.swtdesigner.gef.policy.swing.layout.group.GroupLayoutEditPolicy$2.run(GroupLayoutEditPolicy.java:544)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)


Any thoughts? Is there a prescribed process one should adhere to when changing layout managers? Should I first manually remove all of the code for the old layout manager? Thanks for your help.
PeteLachall
 
Posts: 2
Joined: Wed Oct 31, 2007 7:14 am

Postby Alexander.Mitin » Wed Oct 31, 2007 11:48 pm

Could you please provide a reproducible test case? Its rather difficult do determine the place of the error without it.
Alexander Mitin
Alexander.Mitin
Moderator
 
Posts: 155
Joined: Fri Jan 19, 2007 3:57 am

Postby PeteLachall » Thu Nov 01, 2007 5:14 am

I will try to provide a simple test case, but it may take some time, as our application is quite large. In the mean time, though, is there some insight you can provide as to what this exception 'generally' means (Component model not found)? Is this saying that WBP could not locate the class definition for a custom component (of which we have many...subclasses of all the common Swing components)? I have a feeing that the error is due to the complexity/quirkiness of our design, and as such will not be easily reproducible with a simple test case. Is there a 'best practices' type of document for migrating to WBP from another IDE? Would I just be better of redesigning our entire GUI from scratch? I really appreciate your cosideration, Alex (and others).
PeteLachall
 
Posts: 2
Joined: Wed Oct 31, 2007 7:14 am

Postby Alexander.Mitin » Fri Nov 02, 2007 3:52 am

This error usually means than the designer can't find information for some widget inside parent component (content pane or panel). And usually this doesn't mean that WBP could not locate the class definition for a custom component but may be there are more exceptions in log?
Actually, component id = 95 means that your gui is very complex, since ids starts from zero :) but GL support should work anyway so the test case would be very appreciated. And for now until we fix this problem you may try to use another Swing layout.
The "best practices" of migrating to WBP depends on initial code. If the code is too complex and messy then sometimes its better to create new gui on scratch, this also may give the better result because of eliminate the disadvantages of old gui.
Alexander Mitin
Alexander.Mitin
Moderator
 
Posts: 155
Joined: Fri Jan 19, 2007 3:57 am

Postby Eric Clayberg » Wed Nov 07, 2007 5:19 am

PeteLachall wrote:I will try to provide a simple test case, but it may take some time, as our application is quite large.

If you can carve out even one window that you are having a problem with, we would be happy to look at it.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to Swing Designer

Who is online

Users browsing this forum: No registered users and 1 guest