Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

GEF/GEF4/DOT

< GEF‎ | GEF4
Revision as of 18:12, 25 March 2014 by Alexander.nyssen.itemis.de (Talk | contribs) (Created page with "''Note to non-wiki readers: This documentation is generated from the Eclipse wiki - if you have corrections or additions it would be awesome if you added them in [http://wiki....")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Note to non-wiki readers: This documentation is generated from the Eclipse wiki - if you have corrections or additions it would be awesome if you added them in the original wiki page.

Introduction

The GEF4 DOT component is intended to deliver Graphviz DOT support. It bundles a Xtext-based DOT-editor, as well as import/export functionality from/to GEF4 Graph.

UI

In Zest 2, graphs can be created from DOT input. For instance, for the following DOT input, the Zest graph below is drawn, see also the complete documentation. The Zest graph view can be used with the included DOT editor to visualize a DOT file or to display embedded DOT in other files, e.g. in source code comments or in wiki markup.

digraph simple { 
 n1[label="Node 1"]
 n2[label="Node 2"]
 n1 -> n2[style=dotted label="A dotted edge"]
}

GEF4-DOT-DotGraphView.png

API

Using the API, DOT can be imported to Zest graphs, and Zest graphs can be exported to DOT (see below). To use the API, create a new Plug-in project and add org.eclipse.gef4.zest.core to the MANIFEST.MF dependencies.

Graph graph = new DotImport("digraph{ 1->2; 2->3; 2->4 }").newGraphInstance();
GraphWidget widget = new GraphWidget(graph, shell, SWT.NONE);
System.out.println(new DotExport(graph).toDotString());

The complete sample usage is available in the repository, as well as DOT input samples.

Back to the top