Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Migrating GEF 3 project
Migrating GEF 3 project [message #1753866] Fri, 10 February 2017 23:34 Go to next message
Ken Keefe is currently offline Ken KeefeFriend
Messages: 41
Registered: April 2012
Member
I'm migrating an e3 RCP project that made extensive use of GEF MVC. It was largely based off the old shapes example https://eclipse.org/articles/Article-GEF-diagram-editor/shape.html

Transitioning to e4 was a challenge, but we think it'll really be worth it and now have much of our core functionality working. However, GEF is proving to be a real struggle for us. As we understand it, GEF 3, will not work on e4 applications and we are ready to migrate to using GEF 4. We do not want to use the e4/e3 compatibility layer. It seems like we want to use Zest, but, honestly, the vast collection of components is baffling.

Are there any tutorials out there that do a walk through on a simple diagram editor like the old shapes example? Something that has a palette that lets you create nodes and then connect them with arcs?
Re: Migrating GEF 3 project [message #1753912 is a reply to message #1753866] Sun, 12 February 2017 09:23 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior Member
Hallo Ken,

the different components and their scope are documented in the reference documentation at https://github.com/eclipse/gef/wiki. While the documentation does not reflect the merger of MVC/MVC.FX (see http://nyssen.blogspot.de/2017/02/gef4-1-gef-5.html) yet, it should be a good starting point.

Besides, with respect to MVC, the logo example can pretty much be used as a reference, as we have tried to incorporate all directly supported 'features' there. In case you need to look into details, I would recommend to take a look at it.

Concerning tutorials, Frank Benoit has externally provided one MVC tutorial based on GEF4 at https://github.com/frankbenoit/gef4.mvc.tutorial. It could help you to get in touch with the concepts, while not being based on the current 5.0.0 code base. We have internally prepared an MVC Mindmap tutorial (based on 5.0.0 M5) that is not yet available, but should be published before Eclipse Converge (I will announce its availability here).

Best Regards,
Alexander
Re: Migrating GEF 3 project [message #1754827 is a reply to message #1753912] Wed, 22 February 2017 20:44 Go to previous messageGo to next message
Ken Keefe is currently offline Ken KeefeFriend
Messages: 41
Registered: April 2012
Member
Thank you for the reply! I've studied the gef4 MVC Logo example and I can see the similarities with gef3 MVC. One major difference is that it uses javafx. My existing RCP application was originally an eclipse 3.8 RCP app, which meant that its UI was created using SWT.

Is there a gef4 MVC example that does not use JavaFX? I'm not really excited about learning another toolkit without a good reason. I have tried to find an argument for why applications should migrate to javafx, but I have been unsuccessful. Do you know of one?
Re: Migrating GEF 3 project [message #1754856 is a reply to message #1754827] Thu, 23 February 2017 09:21 Go to previous messageGo to next message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 230
Registered: March 2015
Senior Member
Hi Ken,

there is no GEF4 1.x MVC example that does not use JavaFX. In fact, all GEF4 1.x / GEF 5 examples use JavaFX. Moreover, with GEF 5 we dropped the visualization-agnostic abstraction layer, so that GEF 5 MVC actually requires JavaFX.

There are many arguments for migrating to JavaFX. Just to name a few from the top of my head:
* HW accelerated graphics
* Scene graph API
* Animation support
* CSS styling support
* Media (audio, video) playback support
* Properties & Binding
* up-to-date technology (IMHO one of the best 2D rendering/GUI APIs available)
=> less boilerplate code
=> faster development
=> prettier graphics

Best regards,
Matthias
Re: Migrating GEF 3 project [message #1754923 is a reply to message #1754856] Fri, 24 February 2017 06:26 Go to previous messageGo to next message
Ken Keefe is currently offline Ken KeefeFriend
Messages: 41
Registered: April 2012
Member
I'm trying to dive in to adding GEF 4.1 to a plugin in my e4 RCP application. I've been looking at the org.eclipse.gef4.mvc.examples.logo.ui plugin (although I understand that is a 3.x plugin in order to work with the workbench). I added the org.eclipse.gef4.fx.swt plugin dependency to my plugin and the org.eclipse.gef4.fx.swt feature to my feature based product. When I hit add required, the product also added org.eclipse.gef4.common and org.eclipse.fx.runtime.min.feature.

To get started, I just wanted to display the canvas. I created a part and added this composite to it:

import javax.inject.Inject;

import org.eclipse.gef4.fx.swt.canvas.IFXCanvasFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;

import javafx.embed.swt.FXCanvas;

public class AEGComposite extends Composite {
	
	@Inject
	private IFXCanvasFactory canvasFactory;
	private FXCanvas canvas = null;

	public AEGComposite(Composite parent, int style) {
		super(parent, style);
		
		setLayout(new FillLayout());
		
		canvas = canvasFactory.createCanvas(this, SWT.NONE);
		
	}

}


This comes from the code in AbstractFXView. This compiles with no problem, but when I try to run the product, I get this error:



org.osgi.framework.BundleException: Could not resolve module: edu.illinois.mobius.atomic.advise [1275]
  Unresolved requirement: Require-Bundle: org.eclipse.gef4.fx.swt; bundle-version="1.0.1"
    -> Bundle-SymbolicName: org.eclipse.gef4.fx.swt; bundle-version="1.0.1.201609060946"
       org.eclipse.gef4.fx.swt [1279]
         Unresolved requirement: Require-Bundle: org.eclipse.gef4.common; bundle-version="[1.0.0,2.0.0)"
           -> Bundle-SymbolicName: org.eclipse.gef4.common; bundle-version="1.1.0.201609060946"
              org.eclipse.gef4.common [1278]
                Unresolved requirement: Import-Package: com.google.common.collect; version="[12.0.0,16.0.0)"

	at org.eclipse.osgi.container.Module.start(Module.java:444)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1620)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1599)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1571)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1514)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)


I'm not sure where to find the package com.google.common.collect. How can I resolve this error?
Re: Migrating GEF 3 project [message #1754931 is a reply to message #1754923] Fri, 24 February 2017 08:22 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior Member
The package is provided by the com.google.guava bundle. It is contained in the GEF target.
Re: Migrating GEF 3 project [message #1756366 is a reply to message #1754931] Wed, 15 March 2017 22:03 Go to previous messageGo to next message
Ken Keefe is currently offline Ken KeefeFriend
Messages: 41
Registered: April 2012
Member
My RCP application is feature based. Do you know if there is a feature that contains com.google.guava?
Re: Migrating GEF 3 project [message #1759296 is a reply to message #1756366] Mon, 10 April 2017 02:23 Go to previous message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

Can be had from Orbit, e.g.:

http://download.eclipse.org/tools/orbit/downloads/drops/R20170307180635/
Previous Topic:MULTIPLE GEF views in an editor
Next Topic:[GEF4-5] Resize children of Visible part of InfiniteCanvas
Goto Forum:
  


Current Time: Tue Apr 16 21:55:08 GMT 2024

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

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

Back to the top