Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RAP GEF endless redraw, no UI Access..
RAP GEF endless redraw, no UI Access.. [message #1766638] Fri, 23 June 2017 18:07 Go to next message
Emin M. is currently offline Emin M.Friend
Messages: 55
Registered: November 2012
Location: Berlin
Member
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]

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 Go to previous messageGo to next message
Emin M. is currently offline Emin M.Friend
Messages: 55
Registered: November 2012
Location: Berlin
Member
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]

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 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2285
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
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 #1766850 is a reply to message #1766772] Wed, 28 June 2017 07:58 Go to previous messageGo to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 220
Registered: March 2010
Location: France
Senior Member
Did you try with a more recent version of GEF/draw2d port ?
Re: RAP GEF endless redraw, no UI Access.. [message #1766882 is a reply to message #1766850] Wed, 28 June 2017 13:54 Go to previous messageGo to next message
Emin M. is currently offline Emin M.Friend
Messages: 55
Registered: November 2012
Location: Berlin
Member
Yes, i have checked out the latest sources from GIT, the same problem still remains. The workaround solves my origin problem, but the UI updates have to be triggered manually by resizing the browser window/sash form. When does the redrawing happen usually, what is the normal case?

[Updated on: Wed, 28 June 2017 14:13]

Report message to a moderator

Re: RAP GEF endless redraw, no UI Access.. [message #1767003 is a reply to message #1766882] Thu, 29 June 2017 12:58 Go to previous messageGo to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 220
Registered: March 2010
Location: France
Senior Member
Could you provide sample code reproducing this issue ?
Re: RAP GEF endless redraw, no UI Access.. [message #1767004 is a reply to message #1766882] Thu, 29 June 2017 12:59 Go to previous messageGo to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 220
Registered: March 2010
Location: France
Senior Member
Could you provide sample code reproducing this issue ?
Re: RAP GEF endless redraw, no UI Access.. [message #1769510 is a reply to message #1767004] Tue, 01 August 2017 09:07 Go to previous messageGo to next message
Emin M. is currently offline Emin M.Friend
Messages: 55
Registered: November 2012
Location: Berlin
Member
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 Go to previous message
Emin M. is currently offline Emin M.Friend
Messages: 55
Registered: November 2012
Location: Berlin
Member
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.
	}

Previous Topic:BundleException after switching from RAP 3.2 M4 to RAP 3.2 M5
Next Topic:Rap e4 movable parts
Goto Forum:
  


Current Time: Thu Aug 16 11:50:46 GMT 2018

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

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

Back to the top