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:
com.google.common.base.Function<V,Point2D>, Layout<V, E>, IterativeContext, LayoutEventSupport<V, E>, Caching, ChangeEventSupport, Function<V, Point2D>
- Direct Known Subclasses:
PersistentLayoutImpl
public class ObservableCachingLayout<V,E>
extends LayoutDecorator<V,E>
implements ChangeEventSupport, Caching, LayoutEventSupport<V,E>
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ChangeEventSupportprivate List<LayoutChangeListener<V, E>> Fields inherited from class LayoutDecorator
delegate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddLayoutChangeListener(LayoutChangeListener<V, E> listener) voidclear()clear cachebooleandone()private voidvoidReturns an array of all theChangeListeners added with addChangeListener().voidinit()ititialize resources for a cachevoidInitializes fields in the node that may not have been set during the constructor.voidRemoves a ChangeListener.voidremoveLayoutChangeListener(LayoutChangeListener<V, E> listener) voidvoidsetLocation(V v, Point2D location) Changes the layout coordinates ofvtolocation.voidstep()Advances one step.Methods inherited from class LayoutDecorator
getDelegate, getGraph, getSize, isLocked, lock, reset, setDelegate, setInitializer, setSize, transformMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.common.base.Function
equals
-
Field Details
-
changeSupport
-
locations
-
layoutChangeListeners
-
-
Constructor Details
-
ObservableCachingLayout
-
-
Method Details
-
step
public void step()Description copied from interface:IterativeContextAdvances one step.- Specified by:
stepin interfaceIterativeContext- Overrides:
stepin classLayoutDecorator<V,E>
-
initialize
public void initialize()Description copied from interface:LayoutInitializes fields in the node that may not have been set during the constructor. Must be called before the iterations begin.- Specified by:
initializein interfaceLayout<V,E> - Overrides:
initializein classLayoutDecorator<V,E>
-
done
public boolean done()- Specified by:
donein interfaceIterativeContext- Overrides:
donein classLayoutDecorator<V,E> - Returns:
trueif this iterative process is finished, andfalseotherwise.
-
setLocation
Description copied from interface:LayoutChanges the layout coordinates ofvtolocation.- Specified by:
setLocationin interfaceLayout<V,E> - Overrides:
setLocationin classLayoutDecorator<V,E> - Parameters:
v- the vertex whose location is to be specifiedlocation- the coordinates of the specified location
-
addChangeListener
- Specified by:
addChangeListenerin interfaceChangeEventSupport
-
removeChangeListener
Description copied from interface:ChangeEventSupportRemoves a ChangeListener.- Specified by:
removeChangeListenerin interfaceChangeEventSupport- Parameters:
l- the listener to be removed
-
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
-
setGraph
-
clear
-
init
-
apply
-
fireLayoutChanged
-
addLayoutChangeListener
- Specified by:
addLayoutChangeListenerin interfaceLayoutEventSupport<V,E>
-
removeLayoutChangeListener
- Specified by:
removeLayoutChangeListenerin interfaceLayoutEventSupport<V,E>
-