I intend to display a tree in Java GUI.
The nodes of the tree will depict the function names of the program which the user will enter during runtime and the edges of the tree will depict a function call. So if main calls func1, there will be 2 nodes in the tree (main and func1) and an edge from main to func1. It will differ according to the program which the user entered. This tree may not be a binary tree since a single function may call more than two functions and may be recursive.
I studied JTree and I felt I wont be getting the desired output in the desired design using it.
I even consider tools such as Prefuse but that will increase the size of my application. Is there any other way of displaying the above?
Desired Output - If the program is
void main() //program begins here
{
func1();
func2();
}
void func1()
{
x=0;
if(x<5)
{
func1();
x++;
}
}
void func2()
{
sum();
diff();
mul();
}
void sum()
{
printf("2+5=7");
}
void diff()
{
printf("2-5=-3");
}
void mul()
{
printf("2*5=10");
}
Its output should be-
main
/ \
/ \
----->func1 func2
|-------| / \ \
/ \ \
sum diff mul
I was not able to display the image. Its in http://postimg.org/image/5uovbguz9/