Class ObservableCachingLayout<V,​E>

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

    public class ObservableCachingLayout<V,​E>
    extends edu.uci.ics.jung.algorithms.layout.LayoutDecorator<V,​E>
    implements ChangeEventSupport, Caching
    A LayoutDecorator that fires ChangeEvents when certain methods are called. Used to wrap a Layout so that the visualization components can be notified of changes.
    See Also:
    LayoutDecorator
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected ChangeEventSupport changeSupport  
      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
      ObservableCachingLayout​(edu.uci.ics.jung.algorithms.layout.Layout<V,​E> delegate)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addChangeListener​(javax.swing.event.ChangeListener l)  
      void clear()
      clear cache
      boolean done()  
      void fireStateChanged()  
      javax.swing.event.ChangeListener[] getChangeListeners()
      Returns an array of all the ChangeListeners added with addChangeListener().
      void init()
      ititialize resources for a cache
      void initialize()  
      void removeChangeListener​(javax.swing.event.ChangeListener l)
      Removes a ChangeListener.
      void setGraph​(edu.uci.ics.jung.graph.Graph<V,​E> graph)  
      void setLocation​(V v, java.awt.geom.Point2D location)  
      void step()  
      java.awt.geom.Point2D transform​(V v)  
      • Methods inherited from class edu.uci.ics.jung.algorithms.layout.LayoutDecorator

        getDelegate, getGraph, getSize, isLocked, lock, reset, setDelegate, setInitializer, setSize
      • 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

      • ObservableCachingLayout

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

      • step

        public void step()
        Specified by:
        step in interface edu.uci.ics.jung.algorithms.util.IterativeContext
        Overrides:
        step in class edu.uci.ics.jung.algorithms.layout.LayoutDecorator<V,​E>
        See Also:
        edu.uci.ics.jung.algorithms.layout.Layout#step()
      • initialize

        public void initialize()
        Specified by:
        initialize in interface edu.uci.ics.jung.algorithms.layout.Layout<V,​E>
        Overrides:
        initialize in class edu.uci.ics.jung.algorithms.layout.LayoutDecorator<V,​E>
        See Also:
        Layout.initialize()
      • done

        public boolean done()
        Specified by:
        done in interface edu.uci.ics.jung.algorithms.util.IterativeContext
        Overrides:
        done in class edu.uci.ics.jung.algorithms.layout.LayoutDecorator<V,​E>
        See Also:
        IterativeContext.done()
      • setLocation

        public void setLocation​(V v,
                                java.awt.geom.Point2D location)
        Specified by:
        setLocation in interface edu.uci.ics.jung.algorithms.layout.Layout<V,​E>
        Overrides:
        setLocation in class edu.uci.ics.jung.algorithms.layout.LayoutDecorator<V,​E>
        Parameters:
        v -
        location -
        See Also:
        Layout.setLocation(java.lang.Object, java.awt.geom.Point2D)
      • removeChangeListener

        public void removeChangeListener​(javax.swing.event.ChangeListener l)
        Description copied from interface: ChangeEventSupport
        Removes a ChangeListener.
        Specified by:
        removeChangeListener in interface ChangeEventSupport
        Parameters:
        l - the listener to be removed
      • getChangeListeners

        public javax.swing.event.ChangeListener[] getChangeListeners()
        Description copied from interface: ChangeEventSupport
        Returns an array of all the ChangeListeners added with addChangeListener().
        Specified by:
        getChangeListeners in interface ChangeEventSupport
        Returns:
        all of the ChangeListeners added or an empty array if no listeners have been added
      • 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>