edu.uci.ics.jung.visualization.layout
Class CachingLayout<V,E>

java.lang.Object
  extended by edu.uci.ics.jung.algorithms.layout.LayoutDecorator<V,E>
      extended by edu.uci.ics.jung.visualization.layout.CachingLayout<V,E>
All Implemented Interfaces:
Layout<V,E>, IterativeContext, Caching, org.apache.commons.collections15.Transformer<V,Point2D>

public class CachingLayout<V,E>
extends LayoutDecorator<V,E>
implements Caching

A LayoutDecorator that caches locations in a clearable Map. This can be used to ensure that edge endpoints are always the same as vertex locations when they are drawn in the render loop during the time that the layout's relaxer thread is changing the locations.

Author:
Tom Nelson
See Also:
LayoutDecorator

Field Summary
protected  Map<V,Point2D> locationMap
           
 
Fields inherited from class edu.uci.ics.jung.algorithms.layout.LayoutDecorator
delegate
 
Constructor Summary
CachingLayout(Layout<V,E> delegate)
           
 
Method Summary
 void clear()
          clear cache
 void init()
          ititialize resources for a cache
 void setGraph(Graph<V,E> graph)
          setter for graph
 Point2D transform(V v)
           
 
Methods inherited from class edu.uci.ics.jung.algorithms.layout.LayoutDecorator
done, getDelegate, getGraph, getSize, initialize, isLocked, lock, reset, setDelegate, setInitializer, setLocation, setSize, step
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

locationMap

protected Map<V,Point2D> locationMap
Constructor Detail

CachingLayout

public CachingLayout(Layout<V,E> delegate)
Method Detail

setGraph

public void setGraph(Graph<V,E> graph)
Description copied from interface: Layout
setter for graph

Specified by:
setGraph in interface Layout<V,E>
Overrides:
setGraph in class LayoutDecorator<V,E>

clear

public void clear()
Description copied from interface: Caching
clear cache

Specified by:
clear in interface Caching

init

public void init()
Description copied from interface: Caching
ititialize resources for a cache

Specified by:
init in interface Caching

transform

public Point2D transform(V v)
Specified by:
transform in interface org.apache.commons.collections15.Transformer<V,Point2D>
Overrides:
transform in class LayoutDecorator<V,E>
See Also:
Transformer.transform(Object)


Copyright © 2009. All Rights Reserved.