wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes visualize a Tree and tree traversal Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "visualize a Tree and tree traversal" Watch "visualize a Tree and tree traversal" New topic
Author

visualize a Tree and tree traversal

Yi Meng
Ranch Hand

Joined: May 07, 2003
Posts: 270
hi,
I have to visualize an xml file as a tree and to show tree traversal by hightlighting the edges.
can anyone suggest where can i strat or is there any open source project for java tree implementation and visualization?
thanks


Meng Yi
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

The easiest thing to do would probably be to use JDOM... it uses DefaultMutableTreeNodes to represent XML elements, and these can be pulled directly into your TreeModel. As far as visualization, you'll need to do that yourself, but it sounds like all you need to do is highlight nodes, and a JTree already does that. If you need to do anything extra, you just need to extend DefaultTreeCellRenderer and provide the custom rendering in the getTreeCellRendererComponent() method.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
 
subject: visualize a Tree and tree traversal
 
Similar Threads
Recursively Set Tester in a Recursive Tree
When do i say that a binary search tree is unique?!
Constructing a binary tree from its traversals
visualize a Tree and tree traversal
Employee Class problem