java.lang.Object
org.jgrapht.alg.drawing.BaseLayoutAlgorithm2D<V,E>
org.jgrapht.alg.drawing.CircularLayoutAlgorithm2D<V,E>
- Type Parameters:
V
- the vertex typeE
- the edge type
- All Implemented Interfaces:
LayoutAlgorithm2D<V,
E>
Circular layout.
The algorithm places the graph vertices on a circle evenly spaced. The vertices are iterated based on the iteration order of the vertex set of the graph. The order can be adjusted by providing an external comparator.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Comparator
<Double> protected double
protected Comparator
<V> Fields inherited from class org.jgrapht.alg.drawing.BaseLayoutAlgorithm2D
initializer
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new layout algorithmCircularLayoutAlgorithm2D
(double radius) Create a new layout algorithmCircularLayoutAlgorithm2D
(double radius, Comparator<V> vertexComparator) Create a new layout algorithm. -
Method Summary
Methods inherited from class org.jgrapht.alg.drawing.BaseLayoutAlgorithm2D
getInitializer, init, setInitializer
-
Field Details
-
radius
protected double radius -
comparator
-
vertexComparator
-
-
Constructor Details
-
CircularLayoutAlgorithm2D
public CircularLayoutAlgorithm2D()Create a new layout algorithm -
CircularLayoutAlgorithm2D
public CircularLayoutAlgorithm2D(double radius) Create a new layout algorithm- Parameters:
radius
- the circle radius
-
CircularLayoutAlgorithm2D
Create a new layout algorithm. The algorithm will iterate over the vertices of the graph using the provided ordering.- Parameters:
radius
- the circle radiusvertexComparator
- the vertex comparator. Can be null.
-
-
Method Details
-
layout
Description copied from interface:LayoutAlgorithm2D
Layout a graph.- Parameters:
graph
- the graphmodel
- the layout model to use
-