Class CachingLayout<V,​E>

  • All Implemented Interfaces:
    com.google.common.base.Function<V,​java.awt.geom.Point2D>, Layout<V,​E>, IterativeContext, Caching, java.util.function.Function<V,​java.awt.geom.Point2D>

    public class CachingLayout<V,​E>
    extends LayoutDecorator<V,​E>
    implements Caching
    A LayoutDecorator that caches locations in a clearable Map. This can be used to ensure that edge endpoints are always the same as vertex locations when they are drawn in the render loop during the time that the layout's relaxer thread is changing the locations.
    See Also:
    LayoutDecorator
    • Field Detail

      • locations

        protected com.google.common.cache.LoadingCache<V,​java.awt.geom.Point2D> locations
    • Constructor Detail

      • CachingLayout

        public CachingLayout​(Layout<V,​E> delegate)
    • Method Detail

      • clear

        public void clear()
        Description copied from interface: Caching
        clear cache
        Specified by:
        clear in interface Caching
      • init

        public void init()
        Description copied from interface: Caching
        ititialize resources for a cache
        Specified by:
        init in interface Caching
      • apply

        public java.awt.geom.Point2D apply​(V v)
        Specified by:
        apply in interface com.google.common.base.Function<V,​E>
        Specified by:
        apply in interface java.util.function.Function<V,​E>