Class RandomLocationTransformer<V>
- java.lang.Object
-
- edu.uci.ics.jung.algorithms.layout.util.RandomLocationTransformer<V>
-
- Type Parameters:
V
- the vertex type
- All Implemented Interfaces:
com.google.common.base.Function<V,java.awt.geom.Point2D>
,java.util.function.Function<V,java.awt.geom.Point2D>
public class RandomLocationTransformer<V> extends java.lang.Object implements com.google.common.base.Function<V,java.awt.geom.Point2D>
Provides a random vertex location within the bounds of the Dimension property. This provides a random location for unmapped vertices the first time they are accessed.Note: the generated values are not cached, so apply() will generate a new random location for the passed vertex every time it is called. If you want a consistent value, wrap this layout's generated values in a
StaticLayout
instance.- Author:
- Tom Nelson
-
-
Constructor Summary
Constructors Constructor Description RandomLocationTransformer(java.awt.Dimension d)
Creates an instance with the specified size which uses the current time as the random seed.RandomLocationTransformer(java.awt.Dimension d, long seed)
Creates an instance with the specified dimension and random seed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.geom.Point2D
apply(V v)
-
-
-
Constructor Detail
-
RandomLocationTransformer
public RandomLocationTransformer(java.awt.Dimension d)
Creates an instance with the specified size which uses the current time as the random seed.- Parameters:
d
- the size of the layout area
-
RandomLocationTransformer
public RandomLocationTransformer(java.awt.Dimension d, long seed)
Creates an instance with the specified dimension and random seed.- Parameters:
d
- the size of the layout areaseed
- the seed for the internal random number generator
-
-