java - layout a graph in JDesktopPane -
i have objects build graph. each object node of graph , represented jinternalframe in jdesktoppane. want layout frames correspondig graph. diplaying edges not problem, proper positions each frame(node).
have advice aproach this? tried build graph jung library, allow jung calculate positions of nodes , transfere them swing components. not satisfied solution there result kind of random.
br tobias
i can understand pain here . same . ie. in java application take various inputs , combine produce graph . challenge remains output graph on screen can meaningfully understood user of application . graphs can extremely big . here :
1 . utilize graphiz dot library generate graph . in case unfamiliar graphiz, popular graph layouting tool . same thing jung library . since have never used jung not speak . graphiz dot engine computes position of vertex , edges .
2 . have created graphical editor can parse (x,y) co-ordinates specified in .dot file( output file generated graphiz ) , show on screen . parsing part tricky editor takes care of of visualization aspects ( zooming , drag , drop edges , vertex , etc ) . can check out editor here jgraphx . download source code , have @ grapheditor illustration . run illustration , see . allow me know if want me more help .
i think have achieved 1 , need accomplish 2 . hope reply helps.
java swing layout graph
No comments:
Post a Comment