DocumentsDownloadsWikiCommunityBlogAbout

OpenFlow GUI Extension - Layout

From OpenFlow Wiki

Jump to: navigation, search

Graphs need to be carefully laid out in order for people to be able to understand them. Support is included for automatically laying out graphs using the JUNG library which is included with the OpenFlow GUI. General graph layout is a hard problem though, so JUNG provides many layout algorithms to choose from. Most are iterative and nodes will be smoothly animated to an appropriate position (computed whenever nodes are added and until the layout settles into a stable state). The example code sets the layout engine to the spring layout:

 gm.setLayout(new edu.uci.ics.jung.algorithms.layout.SpringLayout2<Vertex, Edge>(gm.getGraph()));

You can also create your own layout algorithm as long as you implement the appropriate JUNG interface. Alternatively, you can not set any layout algorithm and use the setPos() method on Layoutable objects to manually layout nodes.

Users are able to manually position nodes by simply dragging them to a new location. In the future we plan to support a mechanism for saving these manually positioned layouts to a file so they can be reused across runs.

Copyright 2008 by the OpenFlow Consortium. All rights reserved. Powered by MediaWiki and WordPress.