Class RandomLocationTransformer<V>
java.lang.Object
edu.uci.ics.jung.algorithms.layout.util.RandomLocationTransformer<V>
- Type Parameters:
V
- the vertex type
public class RandomLocationTransformer<V>
extends Object
implements com.google.common.base.Function<V,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.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance with the specified size which uses the current time as the random seed.RandomLocationTransformer
(Dimension d, long seed) Creates an instance with the specified dimension and random seed. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.common.base.Function
equals
-
Field Details
-
d
-
random
Random random
-
-
Constructor Details
-
RandomLocationTransformer
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
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
-
-
Method Details