Home » Archived » Visual Editor (VE) » Problems with the Visual Class Editor
Problems with the Visual Class Editor [message #113650] |
Mon, 19 December 2005 14:32 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: stephan.vern.chem.tu-berlin.de
Hi,
I noticed that you added the source code for libswt-gtk-print to the CVS.
With this source code I was able to build a preliminary Debian package for
the
VE. AFAIK, the libswt-gtk-print is used to capture image from the widget
and use GEF to create editor with this images.
I have now the problem that I have a floating window over the workbench and
the captured images doesn't show up in the editor, see
http://vern.chem.tu-berlin.de/~stephan/images/eclipse-ve-swt .png or
http://vern.chem.tu-berlin.de/~stephan/images/eclipse-ve-swi ng.png
I have one error in the error log, but it doesn't seem to be direct
related to the problem:
java.lang.IllegalArgumentException: Figure is not a child
at org.eclipse.draw2d.Figure.remove(Figure.java(Compiled Code))
at org.eclipse.draw2d.FreeformLayer.remove(FreeformLayer.java:7 8)
at
org.eclipse.gef.editpolicies.GraphicalEditPolicy.removeFeedb ack(GraphicalEditPolicy.java:73)
at
org.eclipse.ve.internal.swt.GridLayoutEditPolicy.eraseGridFi gure(GridLayoutEditPolicy.java:322)
at
org.eclipse.ve.internal.swt.GridLayoutEditPolicy.gridVisibil ityChanged(GridLayoutEditPolicy.java:423)
at
org.eclipse.ve.internal.cde.core.GridController.setGridShowi ng(GridController.java:212)
at
org.eclipse.ve.internal.swt.GridLayoutEditPolicy$3.selectedS tateChanged(GridLayoutEditPolicy.java:528)
at
org.eclipse.gef.editparts.AbstractEditPart.fireSelectionChan ged(AbstractEditPart.java:407)
[...]
Have you any idea what goes wrong, or how do I fix it?
Thank you, Stephan Michels.
|
|
|
Re: Problems with the Visual Class Editor [message #113662 is a reply to message #113650] |
Mon, 19 December 2005 15:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Jeff Myers![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=jeff.myers%40eclipse.org) Messages: 489 Registered: July 2009 |
Senior Member |
|
|
Stephan,
The floating window you're seeing is the remote VM instance that's used
to render the editor image. The image of this window is captured using
that native library in the case of an SWT class, then sent back to
Eclipse to be displayed in the editor via GEF figures. Usually the
remote vm windows are placed off screen (location 10000,10000) but some
window managers prevent windows from placing themselves off screen.
The stack trace you listed in your error log is unrelated to the problem
of the image not showing up in the editor window. You're probably going
to have to debug the remote vm in order to see whether the image capture
code is being executed correctly on the remote vm. To do this, you'll
need to create a new launch configuration in your VE development
workspace that has certain debug options enabled. Hit Debug... then
copy your existing Eclipse launch configuration, or create a new one,
then switch to the Tracing tab, check the box to enable tracing, check
the box next to org.eclipse.jem.proxy then check the box next to
remote/debug/debugvm and also remote/debug/vmtraceout. Then when you
launch eclipse with this launch configuration and start the VE, you'll
be prompted asking whether you want to debug the remote VMs. If you
answer yes, you'll be given a port to connect to. Back in your
development eclipse instance, create another new Debug... launch
configuration of type Remote Java Application. Under connection
properties connect to localhost, with the port number given to you by
the runtime popup window. When it's connected, you'll be able to stop
at breakpoints and debug the classes that run on the remote VMs (such as
the image capture mechanism for SWT -
org.eclipse.ve.internal.swt.targetvm.unix.ImageCapture's getImage()
method. This is where you should start investigating as to why the
image isn't being captured properly for you in SWT.
Hope this helps,
- Jeff
|
|
|
Re: Problems with the Visual Class Editor [message #113751 is a reply to message #113662] |
Mon, 19 December 2005 19:57 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: stephan.michels.gmail.com
Jeff Myers wrote:
> Usually the
> remote vm windows are placed off screen (location 10000,10000) but some
> window managers prevent windows from placing themselves off screen.
Ahh, that would explain it. I'll test it.
> When it's connected, you'll be able to stop
> at breakpoints and debug the classes that run on the remote VMs (such as
> the image capture mechanism for SWT -
> org.eclipse.ve.internal.swt.targetvm.unix.ImageCapture's getImage()
> method. This is where you should start investigating as to why the
> image isn't being captured properly for you in SWT.
> Hope this helps,
This helps me a lot. Thank you for the detailed answer. Let's see
if I can find the problem.
|
|
|
Re: Problems with the Visual Class Editor [message #113851 is a reply to message #113751] |
Wed, 21 December 2005 09:38 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: stephan.vern.chem.tu-berlin.de
Okay, I found the problem with missing images in the visual class editor.
Following code in swt-gtk-print:497 cause some troubles. It seems
that org.eclipse.ve.internal.swt.targetvm.unix.ImageCapture.getPi xels()
is invoked with maxWidth=0 and maxHeight=0.
gdk_window_get_geometry(window, &wx,&wy,&ww,&wh,&wd);
if(ww>maxWidth){
ww = maxWidth;
}
if(wh>maxHeight){
wh = maxHeight;
}
image = gdk_drawable_get_image(pm, 0,0,ww,wh);
So you will get no image because ww and wh is 0. If I disable the
if-clauses
I get the captured images.
And until now I get not other exceptions. About the floating window, I
havn't tested yet if can set the window position outside of the workspace.
Stephan Michels.
|
|
|
Re: Problems with the Visual Class Editor [message #113864 is a reply to message #113851] |
Wed, 21 December 2005 14:26 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Srimanth ![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=sgunturi%40us.ibm.com) Messages: 225 Registered: July 2009 |
Senior Member |
|
|
Hi Stephan,
The solution i think is not to comment the if statement, as if the
components are huge (10000,10000) VE will run out of memory trying to
get its image. Rather, please look at why the main call
'Java_org_eclipse_ve_internal_swt_targetvm_unix_ImageCapture _getPixels'
is getting input parameters 'jint jMaxWidth, jint jMaxHeight' as 0. The
maxwidth and maxheight should be provided correctly.
Regards,
Sri.
Stephan Michels wrote:
> Okay, I found the problem with missing images in the visual class editor.
> Following code in swt-gtk-print:497 cause some troubles. It seems
> that org.eclipse.ve.internal.swt.targetvm.unix.ImageCapture.getPi xels()
> is invoked with maxWidth=0 and maxHeight=0.
>
> gdk_window_get_geometry(window, &wx,&wy,&ww,&wh,&wd);
> if(ww>maxWidth){
> ww = maxWidth;
> }
> if(wh>maxHeight){
> wh = maxHeight;
> }
> image = gdk_drawable_get_image(pm, 0,0,ww,wh);
>
> So you will get no image because ww and wh is 0. If I disable the
> if-clauses
> I get the captured images.
> And until now I get not other exceptions. About the floating window, I
> havn't tested yet if can set the window position outside of the workspace.
> Stephan Michels.
>
|
|
|
Re: Problems with the Visual Class Editor [message #113890 is a reply to message #113864] |
Wed, 21 December 2005 17:32 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: stephan.vern.chem.tu-berlin.de
Sri Gunturi wrote:
> Hi Stephan,
> The solution i think is not to comment the if statement, as if the
> components are huge (10000,10000) VE will run out of memory trying to
> get its image.
You're right. This not a solution...
> Rather, please look at why the main call
> 'Java_org_eclipse_ve_internal_swt_targetvm_unix_ImageCapture _getPixels'
> is getting input parameters 'jint jMaxWidth, jint jMaxHeight' as 0. The
> maxwidth and maxheight should be provided correctly.
getPixels() is in R_1_1_0_1 explicit being called with jMaxWidth=0 and
jMaxHeight=0, see
protected Image getImageOfHandle(int handle, Display display, int
includeChildren){
int[] tcData = getPixels(handle, includeChildren,0,0,0);
[...]
The version in HEAD seems to fix this. I will try to backport the changes.
Stephan Michels
|
|
|
Re: Problems with the Visual Class Editor [message #611667 is a reply to message #113650] |
Mon, 19 December 2005 15:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Jeff Myers![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=jeff.myers%40eclipse.org) Messages: 489 Registered: July 2009 |
Senior Member |
|
|
Stephan,
The floating window you're seeing is the remote VM instance that's used
to render the editor image. The image of this window is captured using
that native library in the case of an SWT class, then sent back to
Eclipse to be displayed in the editor via GEF figures. Usually the
remote vm windows are placed off screen (location 10000,10000) but some
window managers prevent windows from placing themselves off screen.
The stack trace you listed in your error log is unrelated to the problem
of the image not showing up in the editor window. You're probably going
to have to debug the remote vm in order to see whether the image capture
code is being executed correctly on the remote vm. To do this, you'll
need to create a new launch configuration in your VE development
workspace that has certain debug options enabled. Hit Debug... then
copy your existing Eclipse launch configuration, or create a new one,
then switch to the Tracing tab, check the box to enable tracing, check
the box next to org.eclipse.jem.proxy then check the box next to
remote/debug/debugvm and also remote/debug/vmtraceout. Then when you
launch eclipse with this launch configuration and start the VE, you'll
be prompted asking whether you want to debug the remote VMs. If you
answer yes, you'll be given a port to connect to. Back in your
development eclipse instance, create another new Debug... launch
configuration of type Remote Java Application. Under connection
properties connect to localhost, with the port number given to you by
the runtime popup window. When it's connected, you'll be able to stop
at breakpoints and debug the classes that run on the remote VMs (such as
the image capture mechanism for SWT -
org.eclipse.ve.internal.swt.targetvm.unix.ImageCapture's getImage()
method. This is where you should start investigating as to why the
image isn't being captured properly for you in SWT.
Hope this helps,
- Jeff
|
|
| |
Re: Problems with the Visual Class Editor [message #611679 is a reply to message #113751] |
Wed, 21 December 2005 09:38 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Stephan Michels![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=stephan%40apache.org) Messages: 23 Registered: July 2009 |
Junior Member |
|
|
Okay, I found the problem with missing images in the visual class editor.
Following code in swt-gtk-print:497 cause some troubles. It seems
that org.eclipse.ve.internal.swt.targetvm.unix.ImageCapture.getPi xels()
is invoked with maxWidth=0 and maxHeight=0.
gdk_window_get_geometry(window, &wx,&wy,&ww,&wh,&wd);
if(ww>maxWidth){
ww = maxWidth;
}
if(wh>maxHeight){
wh = maxHeight;
}
image = gdk_drawable_get_image(pm, 0,0,ww,wh);
So you will get no image because ww and wh is 0. If I disable the
if-clauses
I get the captured images.
And until now I get not other exceptions. About the floating window, I
havn't tested yet if can set the window position outside of the workspace.
Stephan Michels.
|
|
|
Re: Problems with the Visual Class Editor [message #611680 is a reply to message #113851] |
Wed, 21 December 2005 14:26 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Srimanth ![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=sgunturi%40us.ibm.com) Messages: 225 Registered: July 2009 |
Senior Member |
|
|
Hi Stephan,
The solution i think is not to comment the if statement, as if the
components are huge (10000,10000) VE will run out of memory trying to
get its image. Rather, please look at why the main call
'Java_org_eclipse_ve_internal_swt_targetvm_unix_ImageCapture _getPixels'
is getting input parameters 'jint jMaxWidth, jint jMaxHeight' as 0. The
maxwidth and maxheight should be provided correctly.
Regards,
Sri.
Stephan Michels wrote:
> Okay, I found the problem with missing images in the visual class editor.
> Following code in swt-gtk-print:497 cause some troubles. It seems
> that org.eclipse.ve.internal.swt.targetvm.unix.ImageCapture.getPi xels()
> is invoked with maxWidth=0 and maxHeight=0.
>
> gdk_window_get_geometry(window, &wx,&wy,&ww,&wh,&wd);
> if(ww>maxWidth){
> ww = maxWidth;
> }
> if(wh>maxHeight){
> wh = maxHeight;
> }
> image = gdk_drawable_get_image(pm, 0,0,ww,wh);
>
> So you will get no image because ww and wh is 0. If I disable the
> if-clauses
> I get the captured images.
> And until now I get not other exceptions. About the floating window, I
> havn't tested yet if can set the window position outside of the workspace.
> Stephan Michels.
>
|
|
|
Re: Problems with the Visual Class Editor [message #611682 is a reply to message #113864] |
Wed, 21 December 2005 17:32 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Stephan Michels![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=stephan%40apache.org) Messages: 23 Registered: July 2009 |
Junior Member |
|
|
Sri Gunturi wrote:
> Hi Stephan,
> The solution i think is not to comment the if statement, as if the
> components are huge (10000,10000) VE will run out of memory trying to
> get its image.
You're right. This not a solution...
> Rather, please look at why the main call
> 'Java_org_eclipse_ve_internal_swt_targetvm_unix_ImageCapture _getPixels'
> is getting input parameters 'jint jMaxWidth, jint jMaxHeight' as 0. The
> maxwidth and maxheight should be provided correctly.
getPixels() is in R_1_1_0_1 explicit being called with jMaxWidth=0 and
jMaxHeight=0, see
protected Image getImageOfHandle(int handle, Display display, int
includeChildren){
int[] tcData = getPixels(handle, includeChildren,0,0,0);
[...]
The version in HEAD seems to fix this. I will try to backport the changes.
Stephan Michels
|
|
|
Goto Forum:
Current Time: Sun Sep 01 04:20:02 GMT 2024
Powered by FUDForum. Page generated in 0.03959 seconds
|