Menu

adding of Labels with same zoom properties

2006-12-27
2013-05-29
  • Nobody/Anonymous

    Hi,

    can I add a label or a a text field in the VisualizationViewer which has the same zoom properties like the Vertices. I want also that the GraphZoomScrollPane works correctly with Labels.

    Is there any features in JUNG to do this?

    Thanks for help

    Sebastian

     
    • Tom Nelson

      Tom Nelson - 2006-12-27

      The jung VisualizationViewer is just a JPanel, so you can add any java lightweight
      components to it that you like. The jung code does not, however, provide any
      specific support for doing so, and any interaction between the graph and
      your components would have to be coded by you.

      The layout algorithms only consider the center positions of the vertices,
      not the actual vertex shapes nor any labels associated with the vertices.
      As such, you may find that the labels or shapes are cut-off at the edges
      when you draw the graph. There is not way to avoid this, other than
      re-writing the code for either the layout dimensions or the view dinensions.
      Even though the GraphZoomScrollPane only knows about the view and layout
      sizes, you can drag with the mouse to make any part of the graph fully visible,
      even if you can't use the scroll bars to get the same view.

      Tom Nelson

       

Log in to post a comment.