edu.uci.ics.jung.visualization.decorators
Class VertexIconShapeTransformer<V>

java.lang.Object
  extended by edu.uci.ics.jung.visualization.decorators.VertexIconShapeTransformer<V>
All Implemented Interfaces:
org.apache.commons.collections15.Transformer<V,Shape>
Direct Known Subclasses:
VertexImageShaperDemo.DemoVertexIconShapeTransformer

public class VertexIconShapeTransformer<V>
extends Object
implements org.apache.commons.collections15.Transformer<V,Shape>

A default implementation that stores images in a Map keyed on the vertex. Also applies a shaping function to images to extract the shape of the opaque part of a transparent image.

Author:
Tom Nelson

Field Summary
protected  org.apache.commons.collections15.Transformer<V,Shape> delegate
           
protected  Map<V,Icon> iconMap
           
protected  Map<Image,Shape> shapeMap
           
 
Constructor Summary
VertexIconShapeTransformer(org.apache.commons.collections15.Transformer<V,Shape> delegate)
           
 
Method Summary
 org.apache.commons.collections15.Transformer<V,Shape> getDelegate()
           
 Map<V,Icon> getIconMap()
           
 Map<Image,Shape> getShapeMap()
           
 void setDelegate(org.apache.commons.collections15.Transformer<V,Shape> delegate)
           
 void setIconMap(Map<V,Icon> iconMap)
           
 void setShapeMap(Map<Image,Shape> shapeMap)
           
 Shape transform(V v)
          get the shape from the image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shapeMap

protected Map<Image,Shape> shapeMap

iconMap

protected Map<V,Icon> iconMap

delegate

protected org.apache.commons.collections15.Transformer<V,Shape> delegate
Constructor Detail

VertexIconShapeTransformer

public VertexIconShapeTransformer(org.apache.commons.collections15.Transformer<V,Shape> delegate)
Method Detail

getDelegate

public org.apache.commons.collections15.Transformer<V,Shape> getDelegate()
Returns:
Returns the delegate.

setDelegate

public void setDelegate(org.apache.commons.collections15.Transformer<V,Shape> delegate)
Parameters:
delegate - The delegate to set.

transform

public Shape transform(V v)
get the shape from the image. If not available, get the shape from the delegate VertexShapeFunction

Specified by:
transform in interface org.apache.commons.collections15.Transformer<V,Shape>

getIconMap

public Map<V,Icon> getIconMap()
Returns:
the iconMap

setIconMap

public void setIconMap(Map<V,Icon> iconMap)
Parameters:
iconMap - the iconMap to set

getShapeMap

public Map<Image,Shape> getShapeMap()
Returns:
the shapeMap

setShapeMap

public void setShapeMap(Map<Image,Shape> shapeMap)
Parameters:
shapeMap - the shapeMap to set


Copyright © 2009. All Rights Reserved.