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

Bug 482333

Summary: [Regression] Invalid viewport when opening nested/nesting graph
Product: [Tools] GEF Reporter: Alexander Nyßen <nyssen>
Component: GEF ZestAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matthias.wienand
Version: 0.2.0   
Target Milestone: 4.0.0 / 3.11.0 (Neon) M4   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 481906, 482096    

Description Alexander Nyßen CLA 2015-11-17 03:24:37 EST
With the changes applied in terms of bug #482096, the open nested/nesting graph on zoom behavior in zest is broken, as the viewport of the opened graph is not properly set anymore.
Comment 1 Matthias Wienand CLA 2015-11-19 07:52:35 EST
I looked into the issue and found that the MVC.FX FXZoomOnScrollPolicy interferes with the Zest OpenNestedGraphOnZoomBehavior and OpenParentGraphOnZoomBehavior.

When zooming, the FXZoomOnScrollPolicy uses the FXChangeViewportPolicy to update the contents transformation of the InfiniteCanvas of the FXViewer. The update is carried out by an FXChangeViewportOperation.

This operation is locally executed twice, before it is executed on the operation history. The first execution changes the contents transformation of the InfiniteCanvas, which leads to the execution of change listeners registered for the contents transformation.

The OpenNestedGraphOnZoomBehavior and OpenParentGraphOnZoomBehavior are both registering a change listener for the contents transformation in order to react to zoom level changes. They make use of NavigationPolicy to change the viewer's contents and update the viewport.

Therefore, the viewport update from within NavigationPolicy is overwritten by a later execution of the FXChangeViewportOperation from within FXChangeViewportPolicy.

To resolve the issue, the *OnZoomBehavior classes within Zest should be removed and the functionality should be provided within a new SemanticZoomPolicy that extends the FXChangeViewportPolicy.
Comment 2 Matthias Wienand CLA 2015-11-19 10:05:33 EST
I removed the Open*OnZoomBehavior classes and provided the functionality in a specialized FXChangeViewportPolicy called SemanticZoomPolicy. The NavigationPolicy is still needed for the separate Open*OnDoubleClickPolicy classes. However, probably an operation can be refactored out of the current code base that can be used instead of the NavigationPolicy within Open*OnDoubleClickPolicy classes as well as within the new SemanticZoomPolicy. This has to be further investigated in the context of bug #475190.

The code is published on the master branch. Therefore, I resolve this ticket as fixed for 3.11.0M4.