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,Point2D>, Function<V,Point2D>

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 Details

  • Constructor Details

    • RandomLocationTransformer

      public RandomLocationTransformer(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(Dimension d, long seed)
      Creates an instance with the specified dimension and random seed.
      Parameters:
      d - the size of the layout area
      seed - the seed for the internal random number generator
  • Method Details