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

Bug 501329

Summary: Investigate replacing the GridCanvas with a JavaFX CSS alternative.
Product: [Tools] GEF Reporter: Matthias Wienand <matthias.wienand>
Component: GEF FXAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.0.0   
Target Milestone: 5.0.0 (Oxygen) M2   
Hardware: All   
OS: All   
Whiteboard:

Description Matthias Wienand CLA 2016-09-13 08:10:27 EDT
Currently, the InfiniteCanvas supports rendering a background grid. The implementation uses JavaFX Canvas for drawing the grid and redraws it every time the viewport changes (i.e. when scrolling, zooming, or resizing the viewport). This is problematic for large viewports (e.g. when zooming out) as JavaFX cannot render textures above a certain size. Moreover, frequent redrawing affects the performance. Therefore, we should investigate if the background grid can be implemented using JavaFX CSS so that it is also available for large viewports and the performance is not affected so much.
Comment 1 Matthias Wienand CLA 2016-09-14 06:14:24 EDT
In order to reduce the number of necessary repaints with the current implementation, I ensured that the GridCanvas is always offset by full grid cells when it is enlarged into negative coordinates.
Comment 2 Matthias Wienand CLA 2016-09-16 05:04:15 EDT
Alexander and I re-engineered the background grid using one tile image that is repeated using JavaFX Background. The GridCanvas therefore needs to be a Region so that a Background can be applied. The GridCanvas is scaled and translated so that the grid points are stable. Therefore, the tile image does only need to be redrawn if the grid cell size (width or height) changes.

This change allows the display of an infinite background grid and significantly enhances the performance for redrawing the background grid. The code is published on the master branch, therefore, I resolve this ticket as fixed for 5.0.0 M2.
Comment 3 Matthias Wienand CLA 2016-09-19 06:51:19 EDT
I removed the GridCanvas class and moved the implementation directly into InfiniteCanvas.