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 ChangeEventSupport
changeSupport
protected 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 void
addChangeListener(javax.swing.event.ChangeListener l)
void
clear()
clear cacheboolean
done()
void
fireStateChanged()
javax.swing.event.ChangeListener[]
getChangeListeners()
Returns an array of all theChangeListener
s added with addChangeListener().void
init()
ititialize resources for a cachevoid
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)
-
-
-
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:
addChangeListener
in interfaceChangeEventSupport
-
removeChangeListener
public void removeChangeListener(javax.swing.event.ChangeListener l)
Description copied from interface:ChangeEventSupport
Removes a ChangeListener.- Specified by:
removeChangeListener
in interfaceChangeEventSupport
- Parameters:
l
- the listener to be removed
-
getChangeListeners
public javax.swing.event.ChangeListener[] getChangeListeners()
Description copied from interface:ChangeEventSupport
Returns an array of all theChangeListener
s added with addChangeListener().- Specified by:
getChangeListeners
in interfaceChangeEventSupport
- Returns:
- all of the
ChangeListener
s added or an empty array if no listeners have been added
-
fireStateChanged
public void fireStateChanged()
- Specified by:
fireStateChanged
in interfaceChangeEventSupport
-
clear
public void clear()
Description copied from interface:Caching
clear cache
-
init
public void init()
Description copied from interface:Caching
ititialize resources for a cache
-
-