V - The vertex typepublic class CircleLayoutCalc<V extends Vertex>
extends java.lang.Object
| Constructor and Description |
|---|
CircleLayoutCalc() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<V,java.awt.geom.Point2D> |
calculatePosition(java.util.List<V> vertices,
double radius,
java.awt.geom.Point2D center)
Calculates positions of the provided vertices so that they are apices of
of regular polygon and belonging to a circle with the provided center and radius
|
double |
calculateRadius(java.util.List<V> vertices,
double treshold)
Calculates optimum radius of a circle on which centers of the provided vertices
should lay and where the distances between neighbouring vertices should not be
smaller than the provided value
|
java.util.List<V> |
organizeVerticesBySize(java.util.List<V> vertices)
Sorts the given vertices by size
|
public java.util.Map<V,java.awt.geom.Point2D> calculatePosition(java.util.List<V> vertices, double radius, java.awt.geom.Point2D center)
vertices - Vertices whose positions need to be setradius - Radius of the circlecenter - Center of the circlepublic java.util.List<V> organizeVerticesBySize(java.util.List<V> vertices)
vertices - Vertices to be sortedpublic double calculateRadius(java.util.List<V> vertices, double treshold)
vertices - Vertices whose centers belong to the circletreshold - Distance between neighbouring vertices