public class HierarchyLayoutAlgorithm extends AbstractLayoutAlgorithm
Algorithm to transform a graph of vertices and edges into a hierarchical structure of a 2D plane. It is a geometric transformation which does not change the graph but the x and y position of its vertices.
The algorithm generates the layout correctly if only one root element exists or if there are no vertices at all If no root element exists, a random vertex from the graph is picked and defined as root. If multiple root elements exist, a parent of those is created and called dummy root element. This ensures that there is only one root element.
The current graph to be transformed is extracted from the
Basically all its vertices are transformed and then the new layout is set back to the GraphContainer by executing
|Constructor and Description|
|Modifier and Type||Method and Description|
Updates the current layout by extracting the containers graph and then perform a (x,y) tranformation of all vertices.
initializer, initializer, selectLayoutSize
public void updateLayout(GraphContainer graphContainer)
Copyright © 2017. All rights reserved.