title: How can I get the edge label and value in JUNG?
body: <p>I have problem with JUNG and edge (vertex) labels.</p>
  
  <p>My application is based on JUNG. It needs to calculate some values from given graph. Graph needs to be drown "by hand", and on that graph I need to set "starting values". I was thinking to use labels for that values (names for vertex, length for edges).</p>
  
  <p>Now, I can draw a graph; I can get the number of vertexes and edges, but I don't know how to get the labels and values.</p>
  
  <p>I tried using custom classes for edges and vertexes, but than I don't know how to set labels at all.</p>
  
  <p>This is part of my code. It is taken from documentation. Can somebody tell me what to change so I can set labels while drawing graph and after that retrieve values?</p>
  
  <pre><code>graph = new SparseMultigraph&lt;Number, Number&gt;();
  
      this.layout = new StaticLayout&lt;Number, Number&gt;(graph,
              new Dimension(600, 600));
  
      vv = new VisualizationViewer&lt;Number, Number&gt;(layout);
      vv.setBackground(Color.white);
  
      vv.getRenderContext().setVertexLabelTransformer(
              MapTransformer.&lt;Number, String&gt;getInstance(LazyMap.&lt;Number, String&gt;decorate(
              new HashMap&lt;Number, String&gt;(),
              new ToStringLabeller&lt;Number&gt;())));
  
      vv.getRenderContext().setEdgeLabelTransformer(
              MapTransformer.&lt;Number, String&gt;getInstance(LazyMap.&lt;Number, String&gt;decorate(
              new HashMap&lt;Number, String&gt;(),
              new ToStringLabeller&lt;Number&gt;())));
  
      vv.setVertexToolTipTransformer(vv.getRenderContext().getVertexLabelTransformer());
  
      Container content = getContentPane();
      final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv);
      content.add(panel);
      Factory&lt;Number&gt; vertexFactory = new VertexFactory();
      Factory&lt;Number&gt; edgeFactory = new EdgeFactory();
  
      final EditingModalGraphMouse&lt;Number, Number&gt; graphMouse = new EditingModalGraphMouse&lt;Number, Number&gt;(
              vv.getRenderContext(), vertexFactory, edgeFactory);
  
      vv.setGraphMouse(graphMouse);
      vv.addKeyListener(graphMouse.getModeKeyListener());
  </code></pre>