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: 32
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: 235
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: 32
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: 235
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: 32
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: 235
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: 32
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: 235
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: 32
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: 32
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: 235
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: 35
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 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



Previous Topic:Apply changes to all the figures
Next Topic:when do handle methods get called?
Goto Forum:
  


Current Time: Wed Sep 26 03:04:52 GMT 2018

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

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

Back to the top