Class CachingLayout<V,​E>

  • All Implemented Interfaces:
    edu.uci.ics.jung.algorithms.layout.Layout<V,​E>, edu.uci.ics.jung.algorithms.util.IterativeContext, Caching, org.apache.commons.collections4.Transformer<V,​java.awt.geom.Point2D>

    public class CachingLayout<V,​E>
    extends edu.uci.ics.jung.algorithms.layout.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 Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<V,​java.awt.geom.Point2D> locationMap  
      • Fields inherited from class edu.uci.ics.jung.algorithms.layout.LayoutDecorator

        delegate
    • Constructor Summary

      Constructors 
      Constructor Description
      CachingLayout​(edu.uci.ics.jung.algorithms.layout.Layout<V,​E> delegate)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      clear cache
      void init()
      ititialize resources for a cache
      void setGraph​(edu.uci.ics.jung.graph.Graph<V,​E> graph)  
      java.awt.geom.Point2D transform​(V v)  
      • Methods inherited from class edu.uci.ics.jung.algorithms.layout.LayoutDecorator

        done, getDelegate, getGraph, getSize, initialize, isLocked, lock, reset, setDelegate, setInitializer, setLocation, setSize, step
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • locationMap

        protected java.util.Map<V,​java.awt.geom.Point2D> locationMap
    • Constructor Detail

      • CachingLayout

        public CachingLayout​(edu.uci.ics.jung.algorithms.layout.Layout<V,​E> delegate)
    • Method Detail

      • setGraph

        public void setGraph​(edu.uci.ics.jung.graph.Graph<V,​E> graph)
        Specified by:
        setGraph in interface edu.uci.ics.jung.algorithms.layout.Layout<V,​E>
        Overrides:
        setGraph in class edu.uci.ics.jung.algorithms.layout.LayoutDecorator<V,​E>
      • 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
      • transform

        public java.awt.geom.Point2D transform​(V v)
        Specified by:
        transform in interface org.apache.commons.collections4.Transformer<V,​E>
        Overrides:
        transform in class edu.uci.ics.jung.algorithms.layout.LayoutDecorator<V,​E>