- java.lang.Object
-
- org.jgrapht.alg.drawing.BaseLayoutAlgorithm2D<V,E>
-
- org.jgrapht.alg.drawing.RescaleLayoutAlgorithm2D<V,E>
-
- Type Parameters:
V
- the vertex typeE
- the edge type
- All Implemented Interfaces:
LayoutAlgorithm2D<V,E>
public class RescaleLayoutAlgorithm2D<V,E> extends BaseLayoutAlgorithm2D<V,E>
A layout algorithm which re-scales vertex positions to (center-scale,center+scale) in all dimensions. The algorithm first subtracts the mean on each axis separately, then all values are adjusted so that the maximum magnitude becomes scale. The result is finally translated back to the old center. This procedure preserves the aspect ratio.
-
-
Field Summary
Fields Modifier and Type Field Description private double
scale
-
Fields inherited from class org.jgrapht.alg.drawing.BaseLayoutAlgorithm2D
initializer
-
-
Constructor Summary
Constructors Constructor Description RescaleLayoutAlgorithm2D(double scale)
Create a new layout algorithm
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
layout(Graph<V,E> graph, LayoutModel2D<V> model)
Layout a graph.-
Methods inherited from class org.jgrapht.alg.drawing.BaseLayoutAlgorithm2D
getInitializer, init, setInitializer
-
-
-
-
Method Detail
-
layout
public void layout(Graph<V,E> graph, LayoutModel2D<V> model)
Description copied from interface:LayoutAlgorithm2D
Layout a graph.- Parameters:
graph
- the graphmodel
- the layout model to use
-
-