Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 484421

Summary: Remove dynamic layout support (which should indeed be handled by clients).
Product: [Tools] GEF Reporter: Alexander Nyßen <nyssen>
Component: GEF LayoutAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.2.0   
Target Milestone: 4.0.0 / 3.11.0 (Neon) M5   
Hardware: All   
OS: All   
Whiteboard:

Description Alexander Nyßen CLA 2015-12-15 13:20:15 EST
The ILayoutContext supports to provide a dynamic layout algorithm, and there are related properties to enable/disable dynamic layout within LayoutProperties. This mechanism is only used in SpaceTreeAlgorithm and should IMHO be removed to make the Layout API more consistent. The algorithm itself should not run continuously. Instead a client should execute it continuously if such behavior is desired. 

In this context, we should also investigate whether the listener infrastructure for layout algorithms is really needed. In case a client explicitly triggers a layout, it can consume all respective changes afterwards.
Comment 1 Alexander Nyßen CLA 2015-12-16 04:21:25 EST
it seems, also SpringLayout is able to react to layout changes. We could alternatively enable dynamic layout in Zest. Up to now however, the state is somehow inconsistent. If we remove dynamic layout, the layout listeners should also be removed, as this is there only necessity.
Comment 2 Alexander Nyßen CLA 2015-12-16 04:35:39 EST
The clean option within applyLayout() could be an alternative way to achieve what is intended with dynamic layout.
Comment 3 Alexander Nyßen CLA 2015-12-16 09:26:57 EST
Ensured that only one algorithm is used per context, which may be used for static and dynamic layouting. Changed that dynamic layouting is disabled by default.
Comment 4 Alexander Nyßen CLA 2015-12-16 12:41:31 EST
Having investigated that deeper it seems that the dynamic layout introduces an additional complexity with respect to synchronization (to prevent infinite loops) that makes the API hard to use (for clients). We should rather consider to remove support for dynamic layout algorithms (including the listener infrastructure) and rather add something like "dynamic" layout support to Zest.
Comment 5 Alexander Nyßen CLA 2015-12-17 11:06:57 EST
Having investigated that in even more detail, I came to the conclusion that dynamic layouting has probably never worked correctly and that it should not be supported by layout algorithms directly. As such, pushed the following changes to origin/master:

- Remove support for dynamic layout passes. Removed related properties and adjusted SpaceTreeLayoutAlgorithm and SpringLayoutAlgorithm to no longer register layout listeners.
- Remove layout listener infrastructure which was only required for dynamic layout (clients can use the property change notifications of layout context of the layout abstractions).

Resolving as fixed in 3.11.0 M5.