Class IconShapeFunction<T>
- java.lang.Object
-
- org.jungrapht.visualization.decorators.IconShapeFunction<T>
-
- Direct Known Subclasses:
VertexImageShaperDemo.DemoIconShapeFunction
public class IconShapeFunction<T> extends Object implements Function<T,Shape>
A default implementation that stores images in a Map keyed on the input T. Also applies a shaping function to images to extract the shape of the opaque part of a transparent image.- Author:
- Tom Nelson
-
-
Constructor Summary
Constructors Constructor Description IconShapeFunction(Function<T,Shape> delegate)Creates an instance with the specified delegate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Shapeapply(T t)get the shape from the image.Function<T,Shape>getDelegate()Function<Image,Shape>getShapeFunction()voidsetDelegate(Function<T,Shape> delegate)voidsetIconFunction(Function<T,Icon> iconFunction)voidsetShapeFunction(Function<Image,Shape> shapeFunction)
-
-
-
Method Detail
-
setDelegate
public void setDelegate(Function<T,Shape> delegate)
- Parameters:
delegate- The delegate to set.
-
apply
public Shape apply(T t)
get the shape from the image. If not available, get the shape from the delegate ShapeFunction
-
setIconFunction
public void setIconFunction(Function<T,Icon> iconFunction)
- Parameters:
iconFunction- the iconFunction to set
-
-