Class ObservableCachingLayout<V,E>
- java.lang.Object
-
- edu.uci.ics.jung.algorithms.layout.LayoutDecorator<V,E>
-
- edu.uci.ics.jung.visualization.layout.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 ChangeEventSupportchangeSupportprotected java.util.Map<V,java.awt.geom.Point2D>locationMap
-
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 voidaddChangeListener(javax.swing.event.ChangeListener l)voidclear()clear cachebooleandone()voidfireStateChanged()javax.swing.event.ChangeListener[]getChangeListeners()Returns an array of all theChangeListeners added with addChangeListener().voidinit()ititialize resources for a cachevoidinitialize()voidremoveChangeListener(javax.swing.event.ChangeListener l)Removes a ChangeListener.voidsetGraph(edu.uci.ics.jung.graph.Graph<V,E> graph)voidsetLocation(V v, java.awt.geom.Point2D location)voidstep()java.awt.geom.Point2Dtransform(V v)
-
-
-
Field Detail
-
changeSupport
protected ChangeEventSupport changeSupport
-
locationMap
protected java.util.Map<V,java.awt.geom.Point2D> locationMap
-
-
Method Detail
-
step
public void step()
-
initialize
public void initialize()
-
done
public boolean done()
-
setLocation
public void setLocation(V v, java.awt.geom.Point2D location)
-
addChangeListener
public void addChangeListener(javax.swing.event.ChangeListener l)
- Specified by:
addChangeListenerin interfaceChangeEventSupport
-
removeChangeListener
public void removeChangeListener(javax.swing.event.ChangeListener l)
Description copied from interface:ChangeEventSupportRemoves a ChangeListener.- Specified by:
removeChangeListenerin interfaceChangeEventSupport- Parameters:
l- the listener to be removed
-
getChangeListeners
public javax.swing.event.ChangeListener[] getChangeListeners()
Description copied from interface:ChangeEventSupportReturns an array of all theChangeListeners added with addChangeListener().- Specified by:
getChangeListenersin interfaceChangeEventSupport- Returns:
- all of the
ChangeListeners added or an empty array if no listeners have been added
-
fireStateChanged
public void fireStateChanged()
- Specified by:
fireStateChangedin interfaceChangeEventSupport
-
clear
public void clear()
Description copied from interface:Cachingclear cache
-
init
public void init()
Description copied from interface:Cachingititialize resources for a cache
-
-