In this assignment, you will implement code tomodel a problem tree structure domain of your choice, whether it be an org chart, a restaurant menu (appetizers, main dishes, salads, desserts, etc), group-types of animals, etc. Be creative.
Once you have your tree model, you will use a Java graph component to visualize your model!
Don't worry, most of the code to do all this will be given to you. You will just need to modify the existing code to fit your problem set. You must implement something with a theme, that is a domain of your choice. If you turn in something Root-Child-Grandchilde-GreatGrandchild, you will get very few points.
Let's get to it.
Step 1:
- Download theJGraphX2.zip
downloadzip file and extract it into your IntelliJ IdeaProjects home directory. My IdeaProjects home directory is at c:\users\\IdeaProjects
- Open the project JGraphX2 in IntelliJ by navigating to that directory and using File/Open.
- There are two executables of interest in this project all built for you: SimpleTreeNode and JGraphX2. TrySimpleTreeNodefirst by pressing the Run menu. If the class does not appear in the Run menu, open the class in the editor, and press thesecondRun. You should see all the available executables to choose from. SelectSimpleTreeNode.
This program will load a tree data structure and print out the data. You should see something like this:Root:Child1:Grandchild1
Root:Child1:Grandchild2
Root:Child2:Grandchild3
Root:Child3:GrandChild4
Root:Child4
Root:Child5
Root:Child6
As you can see, this tree has a root with 6 children. Child1 has 2 children. Child2 and Child3 have 1 child each. This is the textual representation of our tree.
4. Now you can visualize this tree using the JGraphx library by running the executable JGraphX2. You should see a graphical version of the sample tree like this:
Step 2:
- Now it's your turn. Decide what problem domain you are going to use foryourtree.
- Modify the SimpleTreeNode executable and get your tree working with your data to print a textual representation of your model, as we did above. Your tree should contain at least 15 nodes and 3-5 levels.
- Then modify JGraphX2 such that it models your data correctly. If you see something anomalous, for example, a line from root directly to say the third level, or an unconnected node, you have a coding error.
- Provide a paragraph narrative of your model and the relationships you are modeling and what it all means, in case it's not obvious. Please model something meaningful to you. And in your narrative tell us what have you learned?
- Include your narrative in your submission comments or as a separate document. Your narrative and your domain choice will be at least 20% of your grade.