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

Bug 482096

Summary: Remove ViewportModel and access InfiniteCanvas directly from related policies and operations.
Product: [Tools] GEF Reporter: Matthias Wienand <matthias.wienand>
Component: GEF MVCAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: nyssen
Version: 0.2.0   
Target Milestone: 4.0.0 / 3.11.0 (Neon) M4   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 482333    
Bug Blocks:    

Description Matthias Wienand CLA 2015-11-13 05:25:16 EST
The FXViewportBehavior transfers viewport information from the ViewportModel to the InfiniteCanvas and vice versa. The transferred information contains the horizontal and vertical scroll offsets, the viewport width and height, and the content transformation.

However, the content transformation is only transferred from the ViewportModel to the InfiniteCanvas, but not from the InfiniteCanvas to the ViewportModel. Therefore, directly changing the content transformation on the InfiniteCanvas will not be reflected within the ViewportModel. As a result, all policies working with the ViewportModel will use an outdated content transformation.

Hence, the content transformation should also be transferred from the InfiniteCanvas to the ViewportModel.
Comment 1 Matthias Wienand CLA 2015-11-13 06:51:52 EST
I investigated further and found that the ViewportModel is an unnecessary indirection. The ViewportModel is defined within MVC, however, corresponding classes are only defined within MVC.FX: FXChangeViewportPolicy, FXViewportBehavior, & FXChangeViewportOperation. These can directly access the InfiniteCanvas instead of being based on the ViewportModel.

Removing the ViewportModel will enable the user to change the viewport using the InfiniteCanvas directly and will simplify the code as no values have to be transferred from/to a ViewportModel.
Comment 2 Alexander Nyßen CLA 2015-11-17 06:41:00 EST
It seems the changes applied in terms of this bug cause the regression documented in bug #482333.
Comment 3 Matthias Wienand CLA 2015-11-19 10:17:30 EST
I removed the ViewportModel, so that the InfiniteCanvas is now directly accessed and resolved the viewport regression (bug #482333). The code is published on the master branch. Therefore, I resolve this ticket as fixed for 3.11.0M4.