Bug 525777

Summary: InfiniteCanvas content bounds computation should be split for better extensibility.
Product: [Tools] GEF Reporter: Matthias Wienand <matthias.wienand>
Component: GEF FXAssignee: Hannes Niederhausen <hniederhausen>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 5.0.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: low-hanging fruit

Description Matthias Wienand CLA 2017-10-09 13:18:31 EDT
The computation of content-bounds within InfiniteCanvas can be overwritten by subclasses, however, an adjustment is not correctly transferred to the computation of scrollable-bounds, which reuses the content-bounds, but additionally takes into account the bounds-in-parent of the content-group. Therefore, the computation of scrollable-bounds does also need to be overwritten when overwriting the computation of content-bounds, at least in most cases.

In order to enhance the extensibility of InfiniteCanvas, the computeContentBoundsInLocal() method should be split into a computeContentBoundsInScrolledPane() method and a computeContentBoundsInLocal() method that reuses the content-bounds-in-scrolled. The computation of scrollable-bounds can then reuse both, the content-bounds-in-scrolled, as well as the content-bounds-in-local. Then, an adjustment to the content-bounds can be made by overwriting computeContentBoundsInScrolledPane(), and it will automatically be respected by the scrollable-bounds (once recomputed).