Class VertexIconShapeTransformer<V>
- java.lang.Object
-
- edu.uci.ics.jung.visualization.decorators.VertexIconShapeTransformer<V>
-
- All Implemented Interfaces:
org.apache.commons.collections4.Transformer<V,java.awt.Shape>
public class VertexIconShapeTransformer<V> extends java.lang.Object implements org.apache.commons.collections4.Transformer<V,java.awt.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.
-
-
Constructor Summary
Constructors Constructor Description VertexIconShapeTransformer(org.apache.commons.collections4.Transformer<V,java.awt.Shape> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.commons.collections4.Transformer<V,java.awt.Shape>
getDelegate()
java.util.Map<V,javax.swing.Icon>
getIconMap()
java.util.Map<java.awt.Image,java.awt.Shape>
getShapeMap()
void
setDelegate(org.apache.commons.collections4.Transformer<V,java.awt.Shape> delegate)
void
setIconMap(java.util.Map<V,javax.swing.Icon> iconMap)
void
setShapeMap(java.util.Map<java.awt.Image,java.awt.Shape> shapeMap)
java.awt.Shape
transform(V v)
get the shape from the image.
-
-
-
Constructor Detail
-
VertexIconShapeTransformer
public VertexIconShapeTransformer(org.apache.commons.collections4.Transformer<V,java.awt.Shape> delegate)
-
-
Method Detail
-
getDelegate
public org.apache.commons.collections4.Transformer<V,java.awt.Shape> getDelegate()
- Returns:
- Returns the delegate.
-
setDelegate
public void setDelegate(org.apache.commons.collections4.Transformer<V,java.awt.Shape> delegate)
- Parameters:
delegate
- The delegate to set.
-
transform
public java.awt.Shape transform(V v)
get the shape from the image. If not available, get the shape from the delegate VertexShapeFunction- Specified by:
transform
in interfaceorg.apache.commons.collections4.Transformer<V,java.awt.Shape>
-
getIconMap
public java.util.Map<V,javax.swing.Icon> getIconMap()
- Returns:
- the iconMap
-
setIconMap
public void setIconMap(java.util.Map<V,javax.swing.Icon> iconMap)
- Parameters:
iconMap
- the iconMap to set
-
getShapeMap
public java.util.Map<java.awt.Image,java.awt.Shape> getShapeMap()
- Returns:
- the shapeMap
-
setShapeMap
public void setShapeMap(java.util.Map<java.awt.Image,java.awt.Shape> shapeMap)
- Parameters:
shapeMap
- the shapeMap to set
-
-