You are to read a file of genealogy and display a pedigree chart of the genealogy in the file.
1. Create a class Genealogy that has a "main" method. This class is the root of your application this class should find a file name as its first command line argument and should build a GenealogyModel object from that file. It should then open a JFrame that contains a PedigreeView object that displays the GenealogyModel.
2. Create a class GenealogyModel that conforms to the specification here. DO NOT CHANGE THIS SPEC. You should add code to the bodies of the methods and you will probably need to create other classes to provide the implementation, but the specified method interface should not change.
Note that the specification includes a method for regression testing of your model. This must be implemented fully.
The file format for genealogy files to be read by the GenealogyModel class is a series of text lines. Each line is an individual. The items on the line are separated by spaces and each item should not contain any spaces. If spaces are required (as in the surname Van Heflin), then an underscore should be used (i.e. Van_Heflin).
The format of an individual in the file is:
<ID> <givenName> <surName> <birthDate> <birthPlace> <fatherID> <motherID>
The ID is an integer number to identifies this individual. If there is no father or no mother, then zeros should be used for their ids. The first individual read from the file becomes the initial RootID for the model.
3. Create a PedigreeView object as a subclass of JPanel that displays the contents of the GenealogyModel object starting with the RootID (see GenealogyModel.java). The pedigree view display should conform to the following design sketch. The root person appears at the far left with their givenName /surname/, birth place and birth date. There is a line between the name and the birth information. If there are children, their given names are listed below. If there is not enough room for the children then let them be clipped off of the bottom. If childrens names are longer than the space for the Root person (see below) then just let the children's names run over.
Root person gets all of the vertical space and enough horizontal space for the full name, birth place and birth date + 4 pixels. The remaining horizontal space is dedicated to the ancestors. The ancestor layout is recursive. Father and Mother divide the vertical space in half giving each of then a rectangle for themselves and their own ancestors. An ancestor gets their full name + 4 pixels with their remaining space divided between their mother and father. If there is not enough room left for the full name to appear then either the Father.gif ( ) or Mother.gif ( ) icons are used as appropriate. If there is no father or mother then the Nobody.gif ( ) icon is used in place of the name. You may draw your own icons or use these. The only lines to be drawn are the standard pedigree lines. If there is not enought room for the root person just let them be clipped rather than using an icon.
The ID number should appear next to the name or icon of every individual displayed (not Nobody.gif).
The behavior of this view is not always what a real genealogy program should do, but this is sufficient for you to demonstrate that you have learned the concepts.

|