- java.lang.Object
- 
- org.jgrapht.alg.drawing.CircularLayoutAlgorithm2D<V,E>
 
- 
- Type Parameters:
- V- the vertex type
- E- the edge type
 - All Implemented Interfaces:
- LayoutAlgorithm2D<V,E>
 
 public class CircularLayoutAlgorithm2D<V,E> extends java.lang.ObjectCircular 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. - Author:
- Dimitrios Michail
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.util.Comparator<java.lang.Double>comparatorprotected java.util.function.Function<V,Point2D>initializerA model initializerprotected doubleradiusprotected java.util.Comparator<V>vertexComparator
 - 
Constructor SummaryConstructors Constructor Description CircularLayoutAlgorithm2D()Create a new layout algorithmCircularLayoutAlgorithm2D(double radius)Create a new layout algorithmCircularLayoutAlgorithm2D(double radius, java.util.Comparator<V> vertexComparator)Create a new layout algorithm.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.function.Function<V,Point2D>getInitializer()Get the initializerprotected voidinit(Graph<V,E> graph, LayoutModel2D<V> model)Initialize a model using the initializer.voidlayout(Graph<V,E> graph, LayoutModel2D<V> model)Layout a graph.voidsetInitializer(java.util.function.Function<V,Point2D> initializer)Set the initializer
 
- 
- 
- 
Constructor Detail- 
CircularLayoutAlgorithm2Dpublic CircularLayoutAlgorithm2D() Create a new layout algorithm
 - 
CircularLayoutAlgorithm2Dpublic CircularLayoutAlgorithm2D(double radius) Create a new layout algorithm- Parameters:
- radius- the circle radius
 
 - 
CircularLayoutAlgorithm2Dpublic CircularLayoutAlgorithm2D(double radius, java.util.Comparator<V> vertexComparator)Create a new layout algorithm. The algorithm will iterate over the vertices of the graph using the provided ordering.- Parameters:
- radius- the circle radius
- vertexComparator- the vertex comparator. Can be null.
 
 
- 
 - 
Method Detail- 
layoutpublic void layout(Graph<V,E> graph, LayoutModel2D<V> model) Description copied from interface:LayoutAlgorithm2DLayout a graph.- Parameters:
- graph- the graph
- model- the layout model to use
 
 - 
getInitializerpublic java.util.function.Function<V,Point2D> getInitializer() Get the initializer- Returns:
- the initializer
 
 - 
setInitializerpublic void setInitializer(java.util.function.Function<V,Point2D> initializer) Set the initializer- Parameters:
- initializer- the initializer
 
 - 
initprotected void init(Graph<V,E> graph, LayoutModel2D<V> model) Initialize a model using the initializer.- Parameters:
- graph- the graph
- model- the model
 
 
- 
 
-