public class ObservableCachingLayout<V,E> extends LayoutDecorator<V,E> implements ChangeEventSupport, Caching, LayoutEventSupport<V,E>
LayoutDecorator
Modifier and Type | Field and Description |
---|---|
protected ChangeEventSupport |
changeSupport |
protected com.google.common.cache.LoadingCache<V,Point2D> |
locations |
delegate
Constructor and Description |
---|
ObservableCachingLayout(Layout<V,E> delegate) |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(ChangeListener l) |
void |
addLayoutChangeListener(LayoutChangeListener<V,E> listener) |
Point2D |
apply(V v) |
void |
clear()
clear cache
|
boolean |
done() |
void |
fireStateChanged() |
ChangeListener[] |
getChangeListeners()
Returns an array of all the
ChangeListener s added
with addChangeListener(). |
void |
init()
ititialize resources for a cache
|
void |
initialize()
Initializes fields in the node that may not have
been set during the constructor.
|
void |
removeChangeListener(ChangeListener l)
Removes a ChangeListener.
|
void |
removeLayoutChangeListener(LayoutChangeListener<V,E> listener) |
void |
setGraph(Graph<V,E> graph) |
void |
setLocation(V v,
Point2D location)
Changes the layout coordinates of
v to location . |
void |
step()
Advances one step.
|
getDelegate, getGraph, getSize, isLocked, lock, reset, setDelegate, setInitializer, setSize, transform
protected ChangeEventSupport changeSupport
public void step()
IterativeContext
step
in interface IterativeContext
step
in class LayoutDecorator<V,E>
public void initialize()
Layout
initialize
in interface Layout<V,E>
initialize
in class LayoutDecorator<V,E>
public boolean done()
done
in interface IterativeContext
done
in class LayoutDecorator<V,E>
true
if this iterative process is finished, and false
otherwise.public void setLocation(V v, Point2D location)
Layout
v
to location
.setLocation
in interface Layout<V,E>
setLocation
in class LayoutDecorator<V,E>
v
- the vertex whose location is to be specifiedlocation
- the coordinates of the specified locationpublic void addChangeListener(ChangeListener l)
addChangeListener
in interface ChangeEventSupport
public void removeChangeListener(ChangeListener l)
ChangeEventSupport
removeChangeListener
in interface ChangeEventSupport
l
- the listener to be removedpublic ChangeListener[] getChangeListeners()
ChangeEventSupport
ChangeListener
s added
with addChangeListener().getChangeListeners
in interface ChangeEventSupport
ChangeListener
s added or an empty
array if no listeners have been addedpublic void fireStateChanged()
fireStateChanged
in interface ChangeEventSupport
public void clear()
Caching
public void init()
Caching
public void addLayoutChangeListener(LayoutChangeListener<V,E> listener)
addLayoutChangeListener
in interface LayoutEventSupport<V,E>
public void removeLayoutChangeListener(LayoutChangeListener<V,E> listener)
removeLayoutChangeListener
in interface LayoutEventSupport<V,E>
Copyright © 2015. All rights reserved.