Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Viewport is continuously layouting
Viewport is continuously layouting [message #925211] Thu, 27 September 2012 13:52
Maarten Bezemer is currently offline Maarten BezemerFriend
Messages: 117
Registered: February 2012
Senior Member
Hi,

I am developing a GEF based model editor. At a certain moment I noticed that lots of resources (CPU and RAM) were being used.

After a while I noticed that FigureCanvas#layoutViewport() is continuously being called. See snippet below (I left out uninteresting parts of the method):
private void layoutViewport() {
	ScrollPaneSolver.Result result;
	result = ScrollPaneSolver.solve(...);
	// ...
	Rectangle r = new Rectangle(getClientArea());
	getLightweightSystem().getRootFigure().setBounds(r);
	}


I noticed that both ScrollPaneSolver#solve() and layoutViewPort() are calling setBounds(). The provided Rectangles differ by 2 pixels in width and in height.
This resulting in the setBounds() method calling fireFigureMoved(), which then calls layourViewport() again. This keeps on going...

Big disadvantage is that all figures get revalidated/layouted which takes lots of resources when the editor is used for big models.

Were does these 2 pxiels come from? A 1 pixel wide border somewhere? (As far as I can see I do not modify the different layered views)

Does anyone have a similar experience and is able to tell me what I am doing wrong, or how I should circumvent this issue?

Edit: It only seems to occur when the scrollbars are visible. When I zoom out far enough (so that the model does easily fit) the problem cease to exist

[Updated on: Thu, 27 September 2012 13:53]

Report message to a moderator

Previous Topic:Connections over Nodes Zest
Next Topic:GEF 3.8.1?
Goto Forum:
  


Current Time: Sat Dec 20 08:58:15 GMT 2014

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

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