Class VertexIconShapeTransformer<V>

java.lang.Object
edu.uci.ics.jung.visualization.decorators.VertexIconShapeTransformer<V>
All Implemented Interfaces:
com.google.common.base.Function<V,Shape>, Function<V,Shape>
Direct Known Subclasses:
VertexImageShaperDemo.DemoVertexIconShapeTransformer

public class VertexIconShapeTransformer<V> extends Object implements com.google.common.base.Function<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.
  • Field Details

    • shapeMap

      protected Map<Image,Shape> shapeMap
    • iconMap

      protected Map<V,Icon> iconMap
    • delegate

      protected com.google.common.base.Function<V,Shape> delegate
  • Constructor Details

    • VertexIconShapeTransformer

      public VertexIconShapeTransformer(com.google.common.base.Function<V,Shape> delegate)
      Creates an instance with the specified delegate.
      Parameters:
      delegate - the vertex-to-shape function to use if no image is present for the vertex
  • Method Details

    • getDelegate

      public com.google.common.base.Function<V,Shape> getDelegate()
      Returns:
      Returns the delegate.
    • setDelegate

      public void setDelegate(com.google.common.base.Function<V,Shape> delegate)
      Parameters:
      delegate - The delegate to set.
    • apply

      public Shape apply(V v)
      get the shape from the image. If not available, get the shape from the delegate VertexShapeFunction
      Specified by:
      apply in interface com.google.common.base.Function<V,Shape>
      Specified by:
      apply in interface Function<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