| Free tutorials for Java, Eclipse and Web programming |
Version 1.0
Copyright © 2009 -2010 Lars Vogel
03.06.2010
| Revision History | ||
|---|---|---|
| Revision 0.1 | 07.06.2009 | Lars Vogel |
| Created Article | ||
| Revision 0.2 | 16.06.2009 | Lars Vogel |
| First example | ||
| Revision 0.3 | 21.06.2009 | Lars Vogel |
| Added PDE Dependency Visualization | ||
| Revision 0.4 | 04.08.2009 | Lars Vogel |
| Minor corrections | ||
| Revision 0.5 | 24.09.2009 | Lars Vogel |
| Added Zest JFace | ||
| Revision 0.6 | 28.09.2009 | Lars Vogel |
| Added IGraphEntityContentProvider | ||
| Revision 0.7 | 29.09.2009 | Lars Vogel |
| Added Filter | ||
| Revision 0.8 | 25.11.2009 | Lars Vogel |
| Fixed typo | ||
| Revision 0.9 | 31.05.2010 | Lars Vogel |
| Fixed errors | ||
| Revision 1.0 | 03.06.2010 | Lars Vogel |
| Updated to Eclipse Helios | ||
Table of Contents
Eclipse Zest is a visualization toolkit for graphs. It is based on SWT / Draw2D. Zest supports the viewer concept from JFace and therefore allows to separate the model from the graphical representation of the model. This article assumes that you are already familiar with Eclipse RCP or Eclipse Plugin development .
Eclipse Zest has the following components:
GraphNode - Node in the graph with the properties
GraphConnections - Arrow / Edge of the graph which connections to two nodes
GraphContainer - Use for a graph within a graph
Graph - holds the other elements (nodes, connections, container)
Eclipse Zest provides graph layout managers. A graph layout manager determines how the nodes (and the arrows) of a graph are arranged on the screen. The following layout managers are provided:
Table 1. Layout Manager
| Layout Manager | Description |
|---|---|
| TreeLayoutAlgorithm | Graph is displayed in the form of a vertical tree |
| HorizontalTreeLayoutAlgorithm | Similar to TreeLayoutAlgorithm but layout is horizontal |
| RadialLayoutAlgorithm | Root is in the center, the others nodes are placed around this node |
| GridLayoutAlgorithm | |
| SpringLayoutAlgorithm | Layout the graph so that all connections should have approx. the same length and that the edges overlap minimal |
| HorizontalShift | Moves overlapping nodes to the right |
| CompositeLayoutAlgorithm | Combines other layout algorithms, for example HorizontalShift can be the second layout algorithm to move nodes which were still overlapping if another algorithm is used |
You can also define filters (org.eclipse.zest.layouts.Filter) on the layout managers via the method setFilter(filter). This defines which nodes and connections should be displayed. The filter receives an LayoutItem, the actual graph element can be received with the method getGraphData().