RAP GEF endless redraw, no UI Access.. [message #1766638] |
Fri, 23 June 2017 18:07  |
Eclipse User |
|
|
|
Hello,
i am working currently on a Diagram/Graph viewer on RAP with GEF and Draw2D. The same code works on RCP Application, it's just a port to be able to show up things in a Webbrowser.
In the RAP variant the Canvas is redrawing endless, so i have no UI Access and nothing is visible. The EditParts doesn't have any changes, so there shouldn't be a demand to redraw the whole graph again. Is there any interval or is it possible to trigger the redrawing manually? What's the cause for the redrawing of the canvas?
I'm using the following versions:
org.eclipse.rap.gef_01.0.20151228-339
org.eclipse.rap.draw2d_01.0.20151228-339
and RAP in version 3.1.2
Thanks in advance.
Best Regards
Mehmet Karaman
[Updated on: Fri, 23 June 2017 18:13] by Moderator Report message to a moderator
|
|
|
Re: RAP GEF endless redraw, no UI Access.. [message #1766699 is a reply to message #1766638] |
Mon, 26 June 2017 09:14   |
Eclipse User |
|
|
|
During debugging i've found the trigger point of the whole redrawing.. It has something to do with the DeferredUpdateManager, i've changed the performUpdate() Method of this class
public synchronized void performUpdate() {
if (true) // <--- this line was added
return; // <-- this line was added
....
Now the UI Freeze is gone, is this a bug in draw2d or am i using it in a wrong way?
Best regards
Mehmet Karaman
[Updated on: Mon, 26 June 2017 09:15] by Moderator Report message to a moderator
|
|
|
Re: RAP GEF endless redraw, no UI Access.. [message #1766772 is a reply to message #1766699] |
Tue, 27 June 2017 08:29   |
Eclipse User |
|
|
|
Hi,
what you do is to eliminate the `performUpdate` code execution. I think that you have to find why `performUpdate` is executed so often, who is calling it... and so on.
Maybe someone with more knowledge about gef/draf2d can help here.
Regards,
Ivan
|
|
|
|
|
|
|
Re: RAP GEF endless redraw, no UI Access.. [message #1769510 is a reply to message #1767004] |
Tue, 01 August 2017 09:07   |
Eclipse User |
|
|
|
Sorry, i've forgotten to check the thread again. The problem wasn't in GEF, it was caused due to my code. During the paint()-Method i was setting foreground and background color, which was gathered by the parent. And this caused the repaint and while painting this object another repaint was started again. My test was actually in an eclipse view, but i will recheck it within the next week in RAP.
|
|
|
Re: RAP GEF endless redraw, no UI Access.. [message #1769511 is a reply to message #1769510] |
Tue, 01 August 2017 09:11   |
Eclipse User |
|
|
|
Found the problem while checking the super class (Figure) of my custom figure:
public void setForegroundColor(Color fg) {
// Set foreground color to fg unless in high contrast mode.
// In that case, get the color from system
if (fgColor != null && fgColor.equals(fg))
return;
Display display = Display.getCurrent();
if (display == null) {
display = Display.getDefault();
}
Color highContrastClr = null;
try {
if (display.getHighContrast()) {
highContrastClr = display
.getSystemColor(SWT.COLOR_WIDGET_FOREGROUND);
}
} catch (SWTException e) {
highContrastClr = null;
}
fgColor = highContrastClr == null ? fg : highContrastClr;
repaint(); // <------- this starts a repaint.. my code doesn't need a repaint because im always painting it with it's parent.
}
|
|
|
|
|
Re: RAP GEF endless redraw, no UI Access.. [message #1818334 is a reply to message #1818141] |
Thu, 12 December 2019 16:48  |
Eclipse User |
|
|
|
Hi Michael,
Thanks a lot for your help. Now i can easly visualize a graph in my application.
But, i cannot create a GraphicalEditor in my application using the Part created from Application.e4xmi because the plugin or.eclipse.ui is missing!!!
Have you an idea how to do this.
Best regards
Antonio
|
|
|
Powered by
FUDForum. Page generated in 0.04949 seconds