Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Advice on migrating an app from GEF 3 to GEF 5 (MVC)
Advice on migrating an app from GEF 3 to GEF 5 (MVC) [message #1776693] Mon, 20 November 2017 14:24 Go to next message
Phil Beauvoir is currently offline Phil BeauvoirFriend
Messages: 62
Registered: October 2012
Member
We have a fairly popular modelling tool called Archi (https://www.archimatetool.com) that uses the old GEF 3/Draw2D framework to render its diagrams. It uses an underlying EMF model, GEF's CommandStack and a bunch of bespoke code to connect EMF to GEF's Editparts, Figures, Policies and Eclipse's Editor Parts. It doesn't use GMF at all.

I'm now thinking about what it would take to migrate this part of the app to GEF 5 and the MVC part. So far I haven't found any substantial examples.

Any advice? Is it possible?
Re: Advice on migrating an app from GEF 3 to GEF 5 (MVC) [message #1776914 is a reply to message #1776693] Wed, 22 November 2017 18:32 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior Member
There is no direct migration path. GEF MVC is based on JavaFX as rendering technology, which has some implications. Furthermore, we have applied some conceptional changes:


  • We no longer have a specific controller abstraction for connections, but a generic anchorage-anchor relationship that can be established between visual parts (which correspond to edit parts in GEF-Legacy MVC.
  • We have introduced explicit controllers for feedback and handles and thereby have made them first-level concepts.
  • We have modularized the interaction logic into gestures, handlers, and policies, which adds much more flexibility.
  • We no longer use an own command stack but rely on the IOperationHistory.


As a starting point, you can consider the documentation that is provided at https://github.com/eclipse/GEF and the related wiki. Next, there is a (free) step-by-step MVC-tutorial provided by itemis (https://info.itemis.com/en/gef/tutorials), which might be good to get into touch with it. Last, you might want to study the GEF MVC logo example in more detail. It basically employs all features of the MVC component.
Re: Advice on migrating an app from GEF 3 to GEF 5 (MVC) [message #1776917 is a reply to message #1776914] Wed, 22 November 2017 18:48 Go to previous messageGo to next message
Phil Beauvoir is currently offline Phil BeauvoirFriend
Messages: 62
Registered: October 2012
Member
Thanks for the reply. :-)

Generally, our users are looking for very high quality resolution at varying zoom levels. and the ability to export diagrams in SVG format. Do you think that JavaFX is an improvement over the existing SWT rendering?

P.
Re: Advice on migrating an app from GEF 3 to GEF 5 (MVC) [message #1776918 is a reply to message #1776917] Wed, 22 November 2017 18:57 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior Member
With respect to rendering/scaling I would say absolutely yes. Take a look at our MVC Logo example. It offers continuous zooming. SVG rendering does not come out of the box. You would have to translate your shapes to SVG yourself, which is hard if you want to do it generically, but relativere easy if you know your shapes.
Re: Advice on migrating an app from GEF 3 to GEF 5 (MVC) [message #1776933 is a reply to message #1776918] Wed, 22 November 2017 22:10 Go to previous messageGo to next message
Phil Beauvoir is currently offline Phil BeauvoirFriend
Messages: 62
Registered: October 2012
Member
OK, thanks for the advice.

I'll certainly take a look at the examples, and the available resources.

Exporting a diagram to a SVG format file is a must-have for our users. Presently, we use a hacked class taken from GMF to convert from SWT Graphics (GraphicsToGraphics2DAdaptor) and some Batik SVG classes. So, I wonder if anybody has done this? Or are developers saving to PNG and similar formats?

P.
Re: Advice on migrating an app from GEF 3 to GEF 5 (MVC) [message #1776951 is a reply to message #1776933] Thu, 23 November 2017 07:57 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior Member
Image export to PNG can be achieved out of the box. SVG would require a "transformation" of the scene graph to SVG (they do not all fall back to rendering on a graphics as in SWT).
Re: Advice on migrating an app from GEF 3 to GEF 5 (MVC) [message #1776965 is a reply to message #1776951] Thu, 23 November 2017 10:03 Go to previous messageGo to next message
Phil Beauvoir is currently offline Phil BeauvoirFriend
Messages: 62
Registered: October 2012
Member
OK, thanks again for advice.

One final thing I need to check is the integration with Eclipse's Editor Parts and the use of the Palette. It seems that a lot of GEF3 apps use the GraphicalEditorWithFlyoutPalette class, and register actions with GraphicalEditor (sub-class of EditorPart) to integrate with menus and so on. Is this something supported in GEF5?

P.
Re: Advice on migrating an app from GEF 3 to GEF 5 (MVC) [message #1776984 is a reply to message #1776965] Thu, 23 November 2017 12:19 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior Member
Yes, there is a similar abstract base class provided by MVC.FX.UI.
Re: Advice on migrating an app from GEF 3 to GEF 5 (MVC) [message #1776987 is a reply to message #1776984] Thu, 23 November 2017 12:37 Go to previous messageGo to next message
Phil Beauvoir is currently offline Phil BeauvoirFriend
Messages: 62
Registered: October 2012
Member
Thanks for all advice!

I installed the GEF 5 examples from the update site but they do not show up in Eclipse (Oxygen) itself. According to my Installation History MVC Examples are installed. But I cannot see them in the "New" menu.

Edit - never mind. I found instructions.

[Updated on: Thu, 23 November 2017 13:09]

Report message to a moderator

Re: Advice on migrating an app from GEF 3 to GEF 5 (MVC) [message #1777089 is a reply to message #1776987] Fri, 24 November 2017 11:01 Go to previous messageGo to next message
Phil Beauvoir is currently offline Phil BeauvoirFriend
Messages: 62
Registered: October 2012
Member
Just want to say thanks for advice. I've taken a look at the API, some examples, and other materials. You've done a great job on this. Well done.

Phil

[Updated on: Fri, 24 November 2017 11:01]

Report message to a moderator

Re: Advice on migrating an app from GEF 3 to GEF 5 (MVC) [message #1777156 is a reply to message #1776987] Sat, 25 November 2017 08:38 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior Member
Thanks!
Re: Advice on migrating an app from GEF 3 to GEF 5 (MVC) [message #1778876 is a reply to message #1777156] Fri, 22 December 2017 20:04 Go to previous messageGo to next message
Ken Keefe is currently offline Ken KeefeFriend
Messages: 38
Registered: September 2009
Member
I'm working through a transition similar to your situation. I had an Eclipse RCP 3.x app that I am moving to a pure e4 RCP app. A big part of my application used the the old GEF 3 / Draw2D framework and I'm moving it to GEF5. This tutorial has been immensely useful for me:

https://www.itemis.com/en/gef/tutorials/part-1-the-foundations/

I also have a need to export my diagrams to SVG (and then PNG and PDF). I'm working through how to do that and just forked the Itemis tutorial on GitHub to see if the GEF team can help me get it working. I'm going to post a fresh topic soon.

If you are also using e4 RCP, I started working on a tutorial to help me learn GEF5 (then stopped when I found Itemis' tutorial). I figured out how to get RCP and JavaFX to play nice. You can find it here: https://www.perform.illinois.edu/~kjkeefe/?p=299
Re: Advice on migrating an app from GEF 3 to GEF 5 (MVC) [message #1779824 is a reply to message #1778876] Sat, 13 January 2018 15:51 Go to previous messageGo to next message
Jay Norwood is currently offline Jay NorwoodFriend
Messages: 155
Registered: July 2009
Senior Member
That is an excellent example, although I'm left with a couple of questions:
1. Normally in eclipse e4 examples I see steps related to creating a separate target project, so I'm puzzled why this wasn't necessary in your case.
2. With e4 we got dependency injection, so I'm puzzled by the need to include google inject. I see that e4 DI does dynamic re-inject, and it isn't clear to me if google inject does that. It was covered in this in the slide, around p10, E4 DI Differences:

https://www.eclipsecon.org/na2014/sites/default/files/slides/2014-EclipseCon-DI.pdf

On svg export ... I was looking at jfreechart-fx code last night and noticed that they did an svg export in javascript rather than attempting it from java, which was odd. Then I poked around more and found JavaFxNodeToSvg on gh. Don't know if it will help...

https://github.com/jfree/jfreechart
https://github.com/stefaneidelloth/JavaFxNodeToSvg

Re: Advice on migrating an app from GEF 3 to GEF 5 (MVC) [message #1779825 is a reply to message #1778876] Sat, 13 January 2018 16:04 Go to previous messageGo to next message
Jay Norwood is currently offline Jay NorwoodFriend
Messages: 155
Registered: July 2009
Senior Member
btw, the tutorial source code fragments at this link are out of sync with the github example code, and the fragments won't work in oxygen.2. The github code works fine.

https://www.itemis.com/en/gef/tutorials/part-1-the-foundations/

https://github.com/itemis/gef-mindmap-tutorial



Re: Advice on migrating an app from GEF 3 to GEF 5 (MVC) [message #1819299 is a reply to message #1776693] Sun, 12 January 2020 17:21 Go to previous messageGo to next message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 179
Registered: July 2009
Senior Member
Hi Phil Beauvoir

did you succeed in the migration? Is there some advice you can share?

Frank
Re: Advice on migrating an app from GEF 3 to GEF 5 (MVC) [message #1819389 is a reply to message #1819299] Tue, 14 January 2020 11:41 Go to previous messageGo to next message
Phil Beauvoir is currently offline Phil BeauvoirFriend
Messages: 62
Registered: October 2012
Member
Frank Benoit wrote on Sun, 12 January 2020 17:21
Hi Phil Beauvoir

did you succeed in the migration? Is there some advice you can share?

Frank


No, I didn't even try.

I couldn't find a non-trivial example of an RCP app that uses GEF5 to see how it performs, Also, I don't want to invest in JavaFX as I believe performance will be slow.
Finally, I don't have a spare two years of time to even attempt it.
Re: Advice on migrating an app from GEF 3 to GEF 5 (MVC) [message #1820834 is a reply to message #1819389] Thu, 30 January 2020 00:08 Go to previous message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 230
Registered: March 2015
Senior Member
Hi,

there is a tool developed at itemis that I would consider non-trivial, using current GEF, and you can check it out for free (trial license): YAKINDU ModelViewer

Make sure to try the signal tracing feature, it looks quite good IMHO, making combined use of JavaFX effects and animations to show data actually "flowing through the wires" :-)

Besides, the GEF mind map tutorial is still being continued. A part about Eclipse integration should now be available, and a part about automatic layout is in the works. I hope the tutorial will be extended further over time, until most GEF features are presented properly. It should already suffice as an introduction to the framework, and as stimulation for your inspiration in terms of forthcoming migration efforts, in case you dare the consideration.

In my personal experience, JavaFX performance can be really good, even for complex interactions and scenes, but you have to avoid some pitfalls:

- avoid expensive computations during interaction (i.e. perform computations beforehand)
- try to minimise the number of nodes in a scene (e.g. shaping contents accordingly, for example, using "folding" or other structural means)

Although you will not need any advanced techniques for the usual viewers/editors, there are also tricks for rendering very large scenes, unfortunately not built-in. You can use mechanisms such as pagination, level-of-detail, and off-screen rendering. All of which can greatly restrict the number of nodes in a scene by omitting invisible nodes, or rendering large parts of the whole as a single unit, or rendering parts of a scene to an image for expedited display, respectively. Typical examples are:
- off-loading / on-loading on-demand
- replacement of many connections that are very close to each other with a single bigger line
- replacement of parts of a scene with a snapshot (e.g. while zooming)
I would be surprised if you actually needed to implement any of these to achieve adequate performance, and it would certainly not be a task implemented straight-forwardly, but nonetheless, it would be doable.

There is lots of published material w.r.t. performance-tuning of scene rendering, mostly originating from the game development community. In most cases, however, it is much easier to shape the contents so that very large scenes are simply avoided.

Best regards,
Matthias
Previous Topic:[GEF5] Right way to set global visual effect
Next Topic:[GEF5 MVC] content object without visual
Goto Forum:
  


Current Time: Fri Dec 13 15:44:57 GMT 2024

Powered by FUDForum. Page generated in 0.05035 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top