Class LensVertexImageShaperDemo

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer

public class LensVertexImageShaperDemo extends JApplet
Demonstrates the use of images to represent graph vertices. The images are added to the DefaultGraphLabelRenderer and can either be offset from the vertex, or centered on the vertex. Additionally, the relative positioning of the label and image is controlled by subclassing the DefaultGraphLabelRenderer and setting the appropriate properties on its JLabel superclass FancyGraphLabelRenderer The images used in this demo (courtesy of slashdot.org) are rectangular but with a transparent background. When vertices are represented by these images, it looks better if the actual shape of the opaque part of the image is computed so that the edge arrowheads follow the visual shape of the image. This demo uses the FourPassImageShaper class to compute the Shape from an image with transparent background.
See Also:
  • Field Details

  • Constructor Details

    • LensVertexImageShaperDemo

      public LensVertexImageShaperDemo()
      create an instance of a simple graph with controls to demo the zoom features.
  • Method Details

    • createVertices

      private Number[] createVertices(int count)
      create some vertices
      Parameters:
      count - how many to create
      Returns:
      the Vertices in an array
    • createEdges

      void createEdges(Number[] v)
      create edges for this demo graph
      Parameters:
      v - an array of Vertices to connect
    • main

      public static void main(String[] args)