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

Bug 472646

Summary: Contract prevents to share a single Scene between multiple FXViewers.
Product: [Tools] GEF Reporter: Alexander Nyßen <nyssen>
Component: GEF MVCAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact: Alexander Nyßen <nyssen>
Severity: major    
Priority: P3    
Version: 0.1.0   
Target Milestone: 3.10.1 (Mars SR1) M2   
Hardware: All   
OS: All   
Whiteboard:

Description Alexander Nyßen CLA 2015-07-14 14:10:07 EDT
Up to now, FXViewer has the responsibility of constructing a scene, hooking its visuals (and the nested root part visuals) into it, and hooking the scene into a passed in scene container.

The mechanism prevents that several viewers can share the same scene, which would e.g. be helpful when a palette viewer is to be added within the same canvas. The current mechanism also enforces that the visuals of a viewer are always used as the root visuals of the scene, unless FXViewer is overwritten to change the default behavior.  

We should remove the responsibility for creating a scene from the FXViewer. It is sufficient if the FXViewer provides its visuals (with the hooked in root part visuals), and hooking these into the scene is performed outside. In case a palette viewer is to be added, the root visual of the scene could e.g. be set to a SplitPane, to which the root visuals of the contents FXViewer and the palette FXViewer could then added as children.
Comment 1 Alexander Nyßen CLA 2015-07-14 14:40:32 EDT
As this a major issue that prevents that a palette viewer can be used within the same domain and the same canvas/scene as the default (content) viewer, it seems to be reasonable to include the fix into 3.10.1/0.1.1, even if changes to the provisional API will result.
Comment 2 Alexander Nyßen CLA 2015-07-15 02:07:43 EDT
I pushed the following changes to origin/master:

- Changed contract of FXViewer, so that is no longer responsible of constructing a scene and hooking it into a scene container, but instead only of constructing its own visuals (lazily within getScrollPane()) and hooking the root part visuals into it.
- Adjusted FXView, FXEditor, ZestContentViewer, AbstractZestExample, and AbstractMvcExample to properly hook the FXViewer visuals of their viewers into a newly created scene.
- Removed obsolete ISceneContainer, FXStageSceneContainer, and FXCanvasSceneContainer abstractions/implementations.
- Removed obsolete o.e.g4.mvc.fx.ui.viewer package, which contained the above named obsolete classes. Excluded package from javadoc generation (javadocOptions.txt within o.e.g4.mvc.doc).
Comment 3 Alexander Nyßen CLA 2015-07-15 02:27:00 EDT
In addition, I updated the documentation at https://wiki.eclipse.org/GEF/GEF4/MVC#Properties and documented the breaking (provisional) API changes at https://wiki.eclipse.org/GEF/New_and_Noteworthy/3.10.1.

Resolving as fixed in 3.10.1 M2.