1.1. Overview
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 Tutorials .
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().
0 comments:
Post a Comment