Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Graphviz - installation of first project(Dot graphs in Java)
Graphviz - installation of first project [message #1707575] Mon, 07 September 2015 13:24 Go to next message
ela szmyd is currently offline ela szmydFriend
Messages: 1
Registered: September 2015
Junior Member
I wrote this java code to display a simple graph using Graphviz and GEF4 framework. What's important, I am using Window Builder in Eclipse too. I created SWT/JFace Java project, then converted it into Plug-in project.

I added in BuildPaths libraries, then added dependencies in manifest.

import org.eclipse.gef4.dot.*;
import org.eclipse.gef4.graph.Graph;
import org.eclipse.gef4.layout.algorithms.SpringLayoutAlgorithm;
import org.eclipse.gef4.zest.fx.ZestProperties;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class Abc {
	
	public static void main(String[] args) {
		Display display = Display.getDefault();
		Shell shell = new Shell();
		shell.setSize(450, 300);
		shell.setText("SWT Application");
		
		Graph.Builder graph2 = new Graph.Builder().attr(ZestProperties.GRAPH_LAYOUT, new SpringLayoutAlgorithm());
		new DotImport("digraph{1->2}").into(graph2);
		new DotImport("node[label=zested]; 2->3; 2->4").into(graph2);
		new DotImport("edge[style=dashed]; 3->5; 4->6").into(graph2);
		//SpringLayoutAlgorithm SLA= new SpringLayoutAlgorithm(); 
		graph2.build();

		shell.open();
		shell.layout();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
	}

}


Errors:
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/emf/ecore/EStructuralFeature
	at org.eclipse.gef4.dot.DotImport.load(DotImport.java:81)
	at org.eclipse.gef4.dot.DotImport.loadFrom(DotImport.java:63)
	at org.eclipse.gef4.dot.DotImport.init(DotImport.java:55)
	at org.eclipse.gef4.dot.DotImport.<init>(DotImport.java:46)
	at Abc.main(Abc.java:17)
Caused by: java.lang.ClassNotFoundException: org.eclipse.emf.ecore.EStructuralFeature
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 5 more


Have you got any idea, what could I miss? Thank you for any help!
Re: Graphviz - installation of first project [message #1707669 is a reply to message #1707575] Tue, 08 September 2015 12:50 Go to previous message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 392
Registered: July 2015
Senior Member
Hi,

the DOT feature of GEF4 has multiple external dependencies, including Xtext and EMF. Are they all added to your build path? More specifically, the code you have found seems to require EMF.

Cheers,
Zoltán
Previous Topic:ADD PaletteEntry Tool in GEF canvas editor
Next Topic:Mouse location in FreeformViewPort on vertical scrolling.
Goto Forum:
  


Current Time: Fri Apr 19 20:16:15 GMT 2024

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

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

Back to the top