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 ChangeEventSupport
private List
<LayoutChangeListener<V, E>> Fields inherited from class edu.uci.ics.jung.algorithms.layout.LayoutDecorator
delegate
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addLayoutChangeListener
(LayoutChangeListener<V, E> listener) void
clear()
clear cacheboolean
done()
private void
void
Returns an array of all theChangeListener
s added with addChangeListener().void
init()
ititialize resources for a cachevoid
Initializes fields in the node that may not have been set during the constructor.void
Removes a ChangeListener.void
removeLayoutChangeListener
(LayoutChangeListener<V, E> listener) void
void
setLocation
(V v, Point2D location) Changes the layout coordinates ofv
tolocation
.void
step()
Advances one step.Methods inherited from class edu.uci.ics.jung.algorithms.layout.LayoutDecorator
getDelegate, getGraph, getSize, isLocked, lock, reset, setDelegate, setInitializer, setSize, transform
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:IterativeContext
Advances one step.- Specified by:
step
in interfaceIterativeContext
- Overrides:
step
in classLayoutDecorator<V,
E>
-
initialize
public void initialize()Description copied from interface:Layout
Initializes fields in the node that may not have been set during the constructor. Must be called before the iterations begin.- Specified by:
initialize
in interfaceLayout<V,
E> - Overrides:
initialize
in classLayoutDecorator<V,
E>
-
done
public boolean done()- Specified by:
done
in interfaceIterativeContext
- Overrides:
done
in classLayoutDecorator<V,
E> - Returns:
true
if this iterative process is finished, andfalse
otherwise.
-
setLocation
Description copied from interface:Layout
Changes the layout coordinates ofv
tolocation
.- Specified by:
setLocation
in interfaceLayout<V,
E> - Overrides:
setLocation
in classLayoutDecorator<V,
E> - Parameters:
v
- the vertex whose location is to be specifiedlocation
- the coordinates of the specified location
-
addChangeListener
- Specified by:
addChangeListener
in interfaceChangeEventSupport
-
removeChangeListener
Description copied from interface:ChangeEventSupport
Removes a ChangeListener.- Specified by:
removeChangeListener
in interfaceChangeEventSupport
- Parameters:
l
- the listener to be removed
-
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
-
setGraph
-
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 -
apply
-
fireLayoutChanged
-
addLayoutChangeListener
- Specified by:
addLayoutChangeListener
in interfaceLayoutEventSupport<V,
E>
-
removeLayoutChangeListener
- Specified by:
removeLayoutChangeListener
in interfaceLayoutEventSupport<V,
E>
-