Sie sind auf Seite 1von 46

A PROJECT REPORT ON Family Tree Generator In partial fulfillment of B.

Tech IV Year (Computer Science Engineering)

Session 2012-13 Submitted To: Prof. Virendra Soni Professor Submitted by: Priyanka Rajpurohit IV Year / VII Sem Department of Computer Science Engineering JIET School of Engineering & Technology for Girls Jodhpur

Certificate
This is to certify that the Major Project entitled Family Tree Generator has been carried out by the student of college JIET School of Engineering & Technology for Girls, Jodhpur under my guidance and supervision in partial fulfillment of the degree of Bachelor of Technology in Computer Science Engineering of Rajasthan Technical University, Kota during the academic year 2012-13. Team: Priyanka Rajpurohit Date: 25/10/2012 Place: JIET-SETG, Jodhpur

Signature of Guide ------------------------Name of Guide Assistant Professor Department of CSE JIET-SETG

Signature of HOD -----------------------Prof. Mamta Garg Head of Department, Department of CSE, JIET-SETG

Acknowledgment
This project involved the collection and analysis of information from a wide variety of sources and the efforts of many people beyond me. Thus it would not have been possible to achieve the results reported in this document without their help, support and encouragement. I am highly indebted to Prof. Virendra Soni professor of computer science department, for their timely guidance and constant supervision as well as for providing necessary information regarding the minor project & also for their support in completing the minor project.

Priyanka Rajpurohit October 25, 2012

Abstract
A strong family relationship can make changes in any ones life!!! Any family has its share of challenges in life the children grow up, move out, change jobs, and move to different communities. Other routine events are various births, deaths, marriages, and illnesses etc. that restructure the family. It is a fact that families are a major force in the development of society. But with todays busy lifestyles, somehow the family members tend to drift apart and these bonds become less strong. Each person that is born is granted the gift of life by their parents. This gift of life is a link to their ancestors who lived before them. From the beginning of time people have sensed a need to belong. It is noteworthy that even the Bible contains lists of genealogy. People felt it was significant to be able to trace their lineage to Adam, Noah, Abraham, David and so on. Genealogy is a unique and personalized form of history. It is passed from one generation to the next via written and oral history. Without this connection to our ancestors we would have little knowledge of our culture or how we fit in. You will also come to understand more about your purpose in life. The project Family Tree Generator gives the user the ability to track back to his ancestral roots, know and preserve the information in the most structured and well organized manner. Information concerning your family history is useful to medical professionals. It helps them determine whether you or other family members have increased risk for various hereditary diseases or genetic illnesses. Doctors monitor medical issues such as heart problems, diabetes, strokes and cancer with this data. As you research your ancestral roots you will increase your skills in a number of areas. Your organizational skills will be sharpened as you take notes in a loose leaf binder and categorize information. Compiling your family tree is a priceless legacy for future generations.

Table of Contents
Certificate........................................................................................ Acknowledgment............................................................................ Abstract........................................................................................... Table of Contents........................................................................... 1. 2. 3. 4. 5. 6. 7. 8. Introduction............................................................................ Literature Survey.................................................................... Requirement Specification....................................................10 Architectural Design..............................................................13 Test Planning..........................................................................33 Work Distribution...................................................................37 Results....................................................................................38 Conclusion & Future Work.....................................................44 45 2 3 4 5 6 8

Glossary............................................................................................

References......................................................................................... 46

1. Introduction
A family tree generator or a family tree builder (FTB) is genealogy software that creates family trees. A family tree generator keeps a track of the ancestral hierarchy of the users family. The software would generate a family tree that assists family historians in tracking, organizing, and sharing the family history. The software is based on Java programming language, the interfaces are built to be user friendly and simple in nature yet provide with valuable information regarding the users family history. It is possible to view three generations at a time. User can save his/her family tree that can be viewed, edited or updated later. So, the user can take his time to build the family tree with all the details leisurely. It is also possible to add not just the basic details like First Name, Last Name, Married Surname, and Gender but also detailed description of that family member- his qualification, interests, current profile, achievements, traits, etc can also be written in the paragraph section. This section provides the user to add as much as details of the person possible. It is exceptionally rewarding to be able to trace your ancestral roots. Through discovering your roots you become aware of who you are as a person. The Java Development Kit (JDK) is an Oracle Corporation product aimed at Java developers. Since the introduction of Java, it has been by far the most widely used Java Software Development Kit (SDK). The JDK has as its primary components a collection of programming tools, including:

appletviewer this tool can be used to run and debug Java applets without a web browser apt the annotation-processing tool[2] extcheck a utility which can detect JAR-file conflicts idlj the IDL-to-Java compiler. This utility generates Java bindings from a given Java IDL file. java the loader for Java applications. This tool is an interpreter and can interpret the class files generated by the javaccompiler. Now a single launcher is used for both development and deployment. The old deployment launcher, jre, no longercomes with Sun JDK, and instead it has been replaced by this new java loader. javac the Java compiler, which converts source code into Java bytecode javadoc the documentation generator, which automatically generates documentation from source code comments jar the archiver, which packages related class libraries into a single JAR file. This tool also helps manage JAR files. javah the C header and stub generator, used to write native methods javap the class file disassembler javaws the Java Web Start launcher for JNLP applications JConsole Java Monitoring and Management Console jdb the debugger jhat Java Heap Analysis Tool (experimental) jinfo This utility gets configuration information from a running Java process or crash dump. (experimental)

jmap This utility outputs the memory map for Java and can print shared object memory maps or heap memory details of a given process or core dump. (experimental) jps Java Virtual Machine Process Status Tool lists the instrumented HotSpot Java Virtual Machines (JVMs) on the target system. (experimental) jrunscript Java command-line script shell. jstack utility which prints Java stack traces of Java threads (experimental) jstat Java Virtual Machine statistics monitoring tool (experimental) jstatd jstat daemon (experimental) keytool tool for manipulating the keystore pack200 JAR compression tool policytool the policy creation and management tool, which can determine policy for a Java runtime, specifying which permissions are available for code from various sources VisualVM visual tool integrating several command-line JDK tools and lightweight[clarification needed] performance and memory profiling capabilities wsimport generates portable JAX-WS artifacts for invoking a web service. xjc Part of the Java API for XML Binding (JAXB) API. It accepts an XML schema and generates Java classes.

2. Literature Survey
A family tree, or pedigree chart, doesn't represent family relationships in a conventional tree structure. The more detailed family trees used in medicine and social work are known as genograms. Genealogy software is computer software used to record, organize, and publish genealogical data. Features At a minimum, genealogy software collects the date and place of an individual's birth, marriage, and death, and stores the relationships of individuals to their parents, spouses, and children. Some programs are more flexible than others in allowing for the input of children born out of wedlock or for varying types of spousal relationships. Additionally, most genealogy programs handle additional events in an individual's life, notes, photographs and multimedia, and source citations. Genealogy software programs can produce a variety of graphical charts and text reports, such as pedigree charts, ahnentafel reports, and Register reports. Some desktop applications generate HTML pages for web publishing; there are stand-alone web applications, as well. Most genealogy programs can import and export using the GEDCOM standard. Some programs include additional fields relevant to particular religions. Others focus on certain geographical regions. For example, having a field for the family's coat of arms is only relevant if the family comes from a part of the world that uses them. While most programs and applications are desktop-based, there are a number of web-based products in the genealogy software market. Many genealogy applications focus on data management in that they allow users to manage all the information they collect on individuals, families, and events. Other tools available to the genealogist include research management tools, mapping tools, charting programs, and web-publishing programs. Sharing Most genealogy software allows export of data in GEDCOM format, which can then be shared with people using different genealogy software. Some genealogy applications use GEDCOM internally and therefore work directly with GEDCOM data. Certain programs allow the user to restrict what information is shared, usually by removing information about living people for privacy reasons. Abstract Window Toolkit (AWT) A generic Abstract Window Toolkit (AWT) container object is a component that can contain other AWT components. Components added to a container are tracked in a list. The order of the list will define the components' front-to-back stacking order within the container. If no index is specified when adding a component to a container, it will be added to the end of the list (and hence to the bottom of the stacking order).

Class Container 8

java.lang.Object java.awt.Component java.awt.Container All Implemented Interfaces: ImageObserver, MenuContainer, Serializable Direct Known Subclasses: BasicSplitPaneDivider, CellRendererPane, DefaultTreeCellEditor.EditorContainer, JCompo nent, Panel, ScrollPane, Window Swing: User Interfaces in Java Java has a fairly rich framework for creating user interfaces "out of the box". That framework is called Swing. Before learning Swing, it's worth making sure that you really understand the following:

the basic concepts of object-oriented programming (e.g. the notion of classes, object creation, inheritance); basic Java syntax: how to call methods, how to create loops etc; interfaces, in the programming sense.

Essentially, because the Swing framework is highly object-oriented. It contains various classes that extend one another, and the notion of extending a base class to add required functionality to that class is key to user interface programming in Java (and indeed in other languages). Another key part of Swing programming is the notion of listeners: classes or components that "listen out for" a particular event happening such as a button being clicked. And listeners are generally implemented as Java interfaces (in the programming sense), so they're also an important notion to understand. In any GUI-based program, a lot of the functionality comes from responding to events: mouse clicks, button clicks, key presses etc. So the first challenge with GUI programming is often turning the program flow that we have in our head into an event-based flow. The basic idea of an event-based approach is that:

most of the time, our program does nothing; the "system" will call routines that we have written when "interesting things" happen (mouse clicks etc). add a button to our window; wait for the user to click the button; when the user clicks a button, pop up a message.

3. Requirement Specification
GENERAL DESCRIPTION 1. Product perspective: - the software family tree enables the user to build his/her family tree. 2. Product features :-the product is so designed so that it can fulfill the following requirements a) Add details like name, birth surname, married surname and gender. b) Adding personal and random details like qualification, interests, current profile, achievements, traits, etc c) Adding father, mother, spouse and children options d) Saving the generated family tree. 3. General constraints:Software Java JDK Language used Java Disk Space Requirements for JDK JDK Source Code Public Java Runtime Environment Req. 27 MB 124 MB Development Tools, including Java FX SDK 245 MB

And 32 bit platform- Pentium 2 266 MHz processor. 4. Specific function:a) Functional requirement:i. Functional requirement number 1:1) Introduction:-the add feature of family tree is to add a new family member in the family tree with his details- First name, birth surname, married surname, gender , etc. 2) Input, processing, outputs:-when the user uses the add functionality of the software family tree generator he/she will be able to enter the family member in the family tree. The details in the family tree include first name, birth surname, married surname, gender. By using the text boxes in the software the user will be able to save the inserted the details. Functional requirement number 2:1) Introduction:- to be able to add personal details of a family member other than first name, birth surname, married surname, gender.

ii.

10

2) Input, processing, outputs: - when the user uses the add functionality of the software family tree he/she will be able to add personal and random details like qualification, interests, current profile, achievements, traits, etc. by using the paragraph field. iii. Functional requirement number 3:1) Introduction:- to be able to add father, mother, spouse and children to a family member 2) Input, processing, outputs: - by using the add father, add mother, add spouse, add child functionalities of the software the user will be able to add father, mother, spouse and children to a family member. Functional requirement number 4:1) Introduction:-to be able to save the family tree so generated by the user, or open an existing family tree to edit or update it. 2) Input, processing, outputs:- by using save option in the menu and the open option the user will be able to save, edit or update the family tree so created.

iv.

b) Performance requirement
The performance of our product is at its best when it is working offline, as the response time will be much faster. If the product is accessed via internet, the performance is limited by the connection speed. The only unforeseen limitation is that of web server response. c) Design constraints The software address book undergoes through various framework activities: Communication Planning Modeling Construction Deployment

d) Testing
The software will be tested module by module. Each module is integrated and system testing is performed. The software product will be tested for all functionalities.

e) External interface requirement


User interface:-the input from the user will be through keyboard or mouse click. The user will navigate from the software by clicking on icons. The icon will give appropriate response to the input. Hardware:-RAM (2GB) Software: - Java JDK

11

Use case diagram: -

Edit current person Add Father

Add Mother

Add Spouse

Add Child

Open existing family tree Make new family tree

12

4. Architectural Design
Functional Description
A family tree generator generates a family tree using Graphic User Interface (GUI). To edit any detail the edit mode needs to be selected, and then edit current person option should be clicked. Its takes details of the family members first name, birth surname, married surname, gender, etc.

Any other miscellaneous detail related to the person can be added in the paragraph section. To add a new member related to the current person, following options are available time. Add Father Add Mother Add Spouse Add Child

A hierarchical family is shown using 3 panels- that means 3 generations can be seen at a

13

Functional Block Diagram

SELECT MODE SELECTION BLOCK EDIT VIEW

Create new family tree

Open an existing family tree

Create new tree

Open an existing family tree

Edit current person

Add Father

Add Mother

Add Spouse

Add Child

MDI Enter details viz. First name, gender, birth surname, paragraph, etc. UPDATE

SAVE

EXIT

EXIT BLOCK

14

Functional Partitions

Module Name:
1. SELECTION BLOCK

Functional Block Diagram

Module Dependencies: Input Dependencies: Actionlistener; view is the default mode. Output Dependencies: Swing class to disable or enable the buttons/panel when view or edit mode is selected respectively.

2. EXIT BLOCK

Functional Block Diagram

EXIT

Module Dependencies: Input Dependencies: Actionlistener, click event


3. MDI

Output Dependencies: NA

Functional Block Diagram

15

Module Dependencies: Input Dependencies: java.lang.String- to add mother/father/spouse/child, details entered by the user Output Dependencies: class FamilyMember to get all the details entered by the user Data structures and types used Array Int String Boolean

16

Data Description
Data Flow Diagram

Edit/view

Create new family tree Select mode

Open file Edit/view Edit

Open existing tree


Edi Edit/view

Edit Details

Edit

Save/update
Edit/view

Exit

17

Flow Chart

Start

Edit

Select mode

Vie

Create Create Create/ open family tree Ope n Create/ open family tree Ope n

Not found found

Not found

View family tree

Enter file name

Enter file name

found

Edit details
View family tree

Update/Save

Stop
18

User Interface Design


User Interface

-File

Mode

Help Add Father Add Mother Add Child

Edit Current Person

On editing the Current Person

19

Module Description
Module Name: Selection Module & GUI Family Member Family Member List

Class Name: 1. FamilyMember- Provide definition of FamilyMember class. 2. FamilyMemberGUI- To demonstrate a family tree using a GUI 3. FamilyMemeberList- Provide definition of FamilyMember class to handle family member arrays.

Class Functions, declaration & returns value

1. Class FamilyMembergetFirstName public java.lang.String getFirstName() Gets the first name Returns: a String specifying the first name getBirthSurname public java.lang.String getBirthSurname() Gets the surname at birth Returns: a String specifying the surname at birth getMarriedSurname public java.lang.String getMarriedSurname() Gets the married surname Returns: a String specifying the married surname getGender public boolean getGender() Gets the gender Returns: a boolean specifying the gender getParagraph public java.lang.String getParagraph() 20

Gets the short paragraph Returns: a String specifying the short paragraph about family member setFirstName public void setFirstName(java.lang.String firstNm) Sets the first name Parameters: firstNm - the first name setBirthSurname public void setBirthSurname(java.lang.String birthNm) Sets the surname at birth Parameters: birthNm - the surname at birth setMarriedSurname public void setMarriedSurname(java.lang.String marriedNm) Sets the married surname Parameters: marriedNm - the married surname setGender public void setGender(boolean fe) Sets the gender (true - if person is a female, false - if person is a male) setParagraph public void setParagraph(java.lang.String para) Sets the short paragraph Parameters: para - the short paragraph about a family member addSpouse public void addSpouse(FamilyMember sp) Add a spouse to the family member Parameters: sp - a family member addFather public void addFather(FamilyMember fa) Add a father to the family member Parameters: fa - a family member addMother public void addMother(FamilyMember mo) Add a mother to the family member Parameters: mo - a family member getSpouseFirstName public java.lang.String getSpouseFirstName() Get the first name of the spouse if the spouse exists Returns: the first name of the spouse otherwise an empty string getSpouseBirthName public java.lang.String getSpouseBirthName() 21

Get the birth surname of the spouse if the spouse exists Returns: the spouse birth surname otherwise an empty string getFatherFirstName public java.lang.String getFatherFirstName() Get the first name of the father if the father exists Returns: the father first name otherwise an empty string getMotherFirstName public java.lang.String getMotherFirstName() Get the first name of the mother if the mother exists Returns: the mother first name otherwise an empty string addChild public void addChild(FamilyMember c) Add a child to the family member Parameters: c - a family member getFullName public java.lang.String getFullName() Get the full name of the family member Returns: first name and birth surname if married surname's length <= 0 otherwise first name, married surname and birth surname getMotherFullName public java.lang.String getMotherFullName() Get the full name of mother if mother exists Returns: the full name of mother otherwise an empty string getFatherFullName public java.lang.String getFatherFullName() Get the full name of father if father exists Returns: the full name of father otherwise an empty string getSpouseFullName public java.lang.String getSpouseFullName() Get the full name of spouse if spouse exists Returns: the full name of spouse otherwise an empty string getFatherParagraph public java.lang.String getFatherParagraph() Get the paragraph of father if father exists Returns: the paragraph of father otherwise an empty string getMotherParagraph public java.lang.String getMotherParagraph() Get the paragraph of mother if mother exists Returns: the paragraph of mother otherwise an empty string

22

getSpouseParagraph public java.lang.String getSpouseParagraph() Get the paragraph of spouse if spouse exists Returns: the paragraph of spouse otherwise an empty string getChildParagraph public java.lang.String getChildParagraph(int i) Get the paragraph of the ith child Parameters:i - the index number of the children array list Returns: the paragraph of the ith child getFatherMarriedName public java.lang.String getFatherMarriedName() Get the married surname of the father Returns: the married surname of the father getFatherBirthSurname public java.lang.String getFatherBirthSurname() Get the birth surname of the father Returns: the birth surname of the father getMotherBirthSurname public java.lang.String getMotherBirthSurname() Get the birth surname of the mother Returns: the birth surname of the mother getMotherMarriedSurname public java.lang.String getMotherMarriedSurname() Get the married surname of the mother Returns: the married surname of the mother getSpouseMarriedSurname public java.lang.String getSpouseMarriedSurname() Get the married surname of the spouse Returns: the married surname of the spouse set public void set(FamilyMember a) Set a family member to the current family member Parameters: a - a family member getFather public FamilyMember getFather() Get the father Returns: the father getMother public FamilyMember getMother() Get the mother 23

Returns: the mother getSpouse public FamilyMember getSpouse() Get the spouse Returns: the spouse getChild public FamilyMember getChild(int i) Get the ith child Parameters: i - the index number of the children array list Returns: the ith child getChildrenSize public int getChildrenSize() Get the size of the children Returns: the number of children getChildFullName public java.lang.String getChildFullName(int i) Get the ith child's full name Parameters: i - the index number of the children array list Returns: the ith child's full name getChildBirthSurname public java.lang.String getChildBirthSurname(int i) Get the birth surname of the ith child Parameters: i - the index number of the children array list Returns: the ith child's birth surname getChildMarriedSurname public java.lang.String getChildMarriedSurname(int i) Get the ith child's married surname Parameters: i - the index number of the children array list Returns: the ith child's married surname hasSpouse public boolean hasSpouse() Get a boolean value whether a spouse exists Returns: true if spouse exists otherwise false hasMother public boolean hasMother() Get a boolean value whether a mother exists Returns: true if mother exists otherwise false hasFather public boolean hasFather() 24

Gets a boolean value whether a father exists Returns: true if father exists otherwise false setFatherFirstName public void setFatherFirstName(java.lang.String firstNm) Set the first name of the father Parameters: firstNm - the first name setMotherFirstName public void setMotherFirstName(java.lang.String firstNm) Set the first name of the mother Parameters: firstNm - the first name setSpouseFirstName public void setSpouseFirstName(java.lang.String firstNm) Set the first name of the spouse Parameters: firstNm - the first name setFatherBirthName public void setFatherBirthName(java.lang.String birthNm) Set the birth surname of the father Parameters: birthNm - the birth surname setMotherBirthName public void setMotherBirthName(java.lang.String birthNm) Set the birth surname of the mother Parameters: birthNm - the birth surname setSpouseBirthName public void setSpouseBirthName(java.lang.String birthNm) Set the birth surname of the spouse Parameters: birthNm - the birth surname setFatherMarriedName public void setFatherMarriedName(java.lang.String marriedNm) Set the married surname of the father Parameters: marriedNm - the married surname setMotherMarriedName public void setMotherMarriedName(java.lang.String marriedNm) Set the married surname of the mother Parameters: marriedNm - the married surname setSpouseMarriedName public void setSpouseMarriedName(java.lang.String marriedNm) Set the married surname of the spouse Parameters: marriedNm - the married surname

25

setFatherParagraph public void setFatherParagraph(java.lang.String para) Set the paragraph of the father Parameters: para - the paragraph setMotherParagraph public void setMotherParagraph(java.lang.String para) Set the paragraph of the mother Parameters: para - the paragraph setSpouseParagraph public void setSpouseParagraph(java.lang.String para) Set the paragraph of the spouse Parameters: para - the paragraph

2. Class FamilyMemberGUIrepaintGUI public void repaintGUI() Method to repaint the GUI by setting up the correct immediate relatives of the current family member in a tree main public static void main(java.lang.String[] args) Main method of FamilyMemberGUI

3. Class FamilyMemberListadd public void add(FamilyMember c) Adds a family member to array Parameters: c - a family member get public FamilyMember get(int i) Get a family member based on the index number Parameters: i - the index number of the family member array list Returns: the ith family member of the children array list size public int size() Get the size of the family member list Returns: an integer size of the children array list

26

Pseudo code Module NameSelection Module & GUI 1. if exit item is clicked, quit program System.exit(0); 2. edit mode is selected and make top panel buttons enabled else if( e.getSource() == modes[0]){ addFather.setEnabled(true); addMother.setEnabled(true); addSpouse.setEnabled(true); addChild.setEnabled(true); editCurrent.setEnabled(true); } 3. viewable mode is selected and make top panel buttons enabled and make bottom panel invisible else if( e.getSource() == modes[1]){ addFather.setEnabled(false); addMother.setEnabled(false); addSpouse.setEnabled(false); addChild.setEnabled(false); editCurrent.setEnabled(false); bottomPanel.setVisible(false); } 4. else if if open is clicked open file dialog and open file and repaint GUI ( e.getSource() == openItem){ openFile(); repaintGUI(); } 5. else if save is clicked, open file dialog and save tree to a file ( e.getSource() == save){ saveFile(); } 6. else if userguide is click open a dialog ( e.getSource() == userguide){ JOptionPane.showMessageDialog(FamilyMemberGUI.this, "Look for User Guide); } 7. else if about is click open a dialog ( e.getSource() == about){ showMessageDialog(FamilyMemberGUI.this, "Family Tree 2001\nCopyright (c) 2012\nB306 Minor Project, Semester 7, 2012\nBy Priyanka Rajpurohit\nEmail: priyanka.rajpurohit@live.com"); } 8. else if father button is clicked, make him as the current person. Repaint GUI ( e.getSource() == fatherButton){ paragraphArea.setText(current.getFatherParagraph()); current = current.getFather(); 27

repaintGUI(); } 9. else if mother button is clicked, make her as the current person. Repaint GUI 10. else if spouse button is clicked, make him/her as the current person. Repaint GUI. Repaint GUI() Method to repaint the GUI by setting up the correct immediate relatives of the current family member in a tree 1. if father exists then set the father button with correct member (current.getFather() != null){ fatherButton.setVisible(true); fatherButton.setText(current.getFatherFullName()); } else{ if father does not exist then hide father button fatherButton.setVisible(false); } 2. if(current.getMother() != null){ // if mother exists then set the mother button with correct member else{ motherButton.setVisible(false); // mother does not exist then hide mother button } 3. if spouse exists then set the spouse button with correct member (current.getSpouse() != null) else if spouse does not exist then hide spouse button 4. set the current button with the current family member 5. current button is set to yellow background 6. update paragraph for the current family member 7. remove child buttons as there are abitrary no. of children for a family member for(int i = 0; i < childButton.length; i++){ childPanel.remove(childButton[i]); } 8. remove child panel to start afresh familyPanel.remove(childPanel); 9. create new child panel childPanel = new JPanel(); childPanel.setLayout(new FlowLayout()); 10. create [children size] no. of child buttons 11. create [children size] no. of child buttons childButton = new JButton[current.getChildrenSize()]; 12. each child button gets a child name for(int i=0; i<current.getChildrenSize(); i++){ childButton[i] = new JButton(current.getChildFullName(i)); 13. each child button gets an action listener childButton[i].addActionListener(new ActionListener() { 28

for (int i=0; i<childButton.length; i++){ if (e.getSource() == childButton[i]){ // if a certain child button is pressed paragraphArea.setText(current.getChildParagraph(i)); // updates the paragraph for particular child current = current.getChild(i); // make child as the current person repaintGUI(); // repaint the GUI for immediate relatives } } } 14. make first name textfield (at bottom panel) get the current person's first name 15. make birth name get the current person's birth surname 16. make married name get the current person's married surname 17. make paragraph get the current person's paragraph.

Family Member 1. Default constructor public FamilyMember(){ father = mother = spouse = null; children = new FamilyMemberList(); firstName = birthSurname = marriedSurname = paragraph = ""; female = false; } 2. FamilyMember constructor { setFirstName(firstNm); setBirthSurname(birthNm); marriedSurname = ""; setParagraph(para); female = fe; father = mother = spouse = null; children = new FamilyMemberList(); } 3. Get first name public String getFirstName(){ return firstName; } 4. Get the surname at birth 5. Get the married surname 6. Get the gender 7. Get the short paragraph 8. Set the first name public void setFirstName(String firstNm){ firstName = firstNm; } 9. Set the surname at birth public void setBirthSurname(String birthNm){ birthSurname = birthNm; 29

} 10. Set the married surname 11. Set the gender 12. Set the short paragraph 13. Add a spouse to the family member public void addSpouse(FamilyMember sp){ spouse = sp; } 14. Add a father to the family member 15. Add a mother to the family member 16. Get the first name of the spouse if the spouse exists public String getSpouseFirstName(){ if(spouse != null) return spouse.getFirstName(); return ""; } 17. Get the birth surname of the spouse if the spouse exists public String getSpouseBirthName(){ if(spouse != null) return spouse.getBirthSurname(); return ""; } 18. Get the first name of the father if the father exists 19. Get the first name of the mother if the mother exists 20. Add a child to the family member public void addChild(FamilyMember c){ children.add(c); } 21. Get the full name of the family member @return first name and birth surname if married surname's length <= 0 otherwise first name, married surname and birth surname public String getFullName(){ if(marriedSurname == "" || marriedSurname.length() <= 0) return firstName + ' ' + birthSurname; else return firstName + ' ' + marriedSurname + " (nee " + birthSurname + ")"; } 22. Get the full name of mother if mother exists @return the full name of mother otherwise an empty string 23. Get the full name of father if father exists 24. Get the full name of spouse if spouse exists (Similarly define for all family members) Family Member List 1. Children array list private ArrayList childrenList = new ArrayList(); 30

2. Add a family member to array, c is a family member public void add(FamilyMember c) { childrenList.add(c); } 3. Get a family member based on the index number; I is the index number of the family member array list So, return the ith family member of the children array list public FamilyMember get(int i) { return (FamilyMember)childrenList.get(i); } 4. Get the size of the family member list & return an integer size of the children array list public int size() { return childrenList.size(); }

31

5. Test Planning
System test:System passing Criteria Overview of System test for family tree generator: - Testing is the process of executing the program with intent of finding an error. A good test case is one that has a high probability of finding as-yet undiscovered errors. A successful test is one that uncovers a yet-to-be-discovered error. System testing tests a completely integrated system to verify that it meets its requirements. First of all the user selects the mode- either view or edit. When view mode is selected the lower panel, edit current person, add father, add mother, add spouse, add child buttons are disabled. When the user selects the edit mode the user can edit and update the family members. Later on, the appropriate details of a particular user are to be updated and displayed properly. All these requirements are to be satisfied in order to pass the system. Functionality Test:Functions are tested by feeding the input and examining the output, and internal program structure is rarely considered. In Functional testing we need to check that each component is functioning as expected or not, so it is also called as Component Testing. Functional testing is to testing the functionality of the software application under test. Basically, it is to check the basic functionality mentioned in the functional specification document. Also check whether software application is meeting the user expectations. We can also say that checking the behavior of the software application against test specification. Require ment ID / Module/ Class Test ID 1 FamilyMemberGUI 2 3 FamilyMember FamilyMemberList Features This class demonstrates a family tree using a GUI This class provides definiton of FamilyMember This class provides definition of FamilyMember class to handle family member arrays

Test setup:-

32

Hardware:The basic requirements for hardware are a normal PC setup that may be as described below: : Keyboard and Mouse. : Pentium 2 266 MHz or higher. : 240 MB or more. : 2 GB or more.

User interface Processor RAM Hard disk

Software: Operating System: Windows 2000, XP, Vista, 7. JAVA JDK Test Configuration Execution of test case is done with the various stepwise checking of modules and various functions. First of all the users have to pass the select mode test through which user will be able to either view or edit a family tree. User interface consists of panel where details need to be filled in like the first name, birth surname, married surname, gender, etc. The user will fill the details of the current person which are to be displayed on the user friendly interface. User should also be able to add random miscellaneous details of the current user in the paragraph section. After the complete entries made by user and updated, the updates should be viewed then and there. Other options like add father, add mother, add spouse and add child should also work properly displaying details in the correct panel.

Test case specifications:Test Case: 1 Objectives: - The test case will cover the check to see whether the whole GUI module is functioning properly or not. Module /Class /Function Module: GUI Class: FamilyMemberGUI Test Configuration Steps to be followed to run this test case are: 1) User should be able to view the interface when the application is launched. 2) 3 menu labels- file, mode and help should be visible 3) User should be able to use the options present in these menus.

33

Expected Output or Results:The user should be able to launch the application and view the options- buttons, menus and frames.

Test Case: 2 Objectives: - The test case will cover the check to see whether the whole selection module is functioning properly or not. Module /Class /Function Module: Selection Class: FamilyMemberGUI Test Configuration Steps to be followed to run this test case are: 1) Click on the mode menu and click on the view radio button to select the view mode. The user should be able to open an existing family tree. User should be able to create a new family tree but should be unable to edit it. User should not be able to edit the family tree opened. User should be able to exit the application. 2) Click on the mode menu and click on the edit radio button to select the edit mode. User should be able to create a new family tree User should be able to open an existing family tree User should be able to edit, update the family tree User should be able to save the family tree. User should be able to exit the application. Expected Output or Results:The user should be able to select and work appropriately with the modes- edit and view. Test Case: 3 Objectives: - The test case will cover the check to see whether the MemberMember module is functioning properly or not. Module /Class /Function Module: Member Member Class: MemberMember Test Configuration Steps to be followed to run this test case are: 1) User should be able to get the details of an existing family tree or newly created family tree - first name, surname, gender, short paragraph, etc of the entire family member. 2) User should be able to set the details of an existing family tree or newly created family tree- first name, surname, gender, short paragraph, etc of all the family members. 3) User should be able to add father, mother, spouse and child of the family members. 34

4) User should be able to get all the details (if exist) of the family tree- all the 3 generations at a time. Expected Output or Results:Details of all the family members should be set and fetched by the user. Test Case: 4 Objectives: - The test case will cover the check to see whether the Family List module is functioning properly or not. Module /Class /Function Module: Family List Class: FamilyList Test Configuration Steps to be followed to run this test case are: 1) In order to check whether the family member array is functioning properly, a family member is added to the array. 2) User should be able to get all the details of that family member. 3) Now, add child to the current person, and one more child. 4) Both the children should be displayed below the current users panel. 5) To test again, we may use different set of inputs and then observe the results obtained. Expected Output or Results The output obtained depends on the family member array created by the user. The family member is retrieved successfully. Test Passing Criteria All the inputs must be correct and should satisfy a normal family relational tree. There is no room for second marriages, although the details of second marriage can be added but the first marriage details then has to be removed. Although the divorcee or single parent is allowed in the family tree. Test Passing Criteria 1. The user should enter valid real life relations. 2. The user should not enter the details of two or more marriages in a single family tree as the application does not support it.

35

6. Work Distribution
Name of function/ module 1. 2. 3. 4. 5. 6. Start Date End Date 22-09-2012 22-09-2012 30-09-2012 7-10-2012 14-10-2012 20-10-2012 Priyanka Rajpurohit Priyanka Rajpurohit Priyanka Rajpurohit Priyanka Rajpurohit Priyanka Rajpurohit Responsible Person Priyanka Rajpurohit

Designing of user interface 15-09-2012 RepaintGUI() FamilyMember FamilyMemberGUI FamilyMemberList 15-09-2012 23-09-2012 1-10-2012 8-10-2012

Module Integration & testing 15-10-2012

36

7. Results
First user interface

Selecting Edit mode

37

Using Edit current person option

New family member added to the tree

38

Using Add Father option

Using Add Mother option

39

Updated family tree

Using Add Spouse option

40

Using Add Child option

Generated Family Tree

41

42

Test Status Report S.No. 1 Module Name Repaint Status (Pass/Fail) Pass Error Status (Fixed/Open) Fixed Remarks When repainted the child panel was still visible to remove it I used familyPanel.remove(childPanel) before new JPanel() Use actionlistiner interface when performing action on button. I resolve it by implementing ActionListiner Interface. No error I got error as I didnt initialize father=mother=spouse=null in the constructor.

2.

FamilyMemberGUI

Pass

Fixed

3. 4.

FamilyMemberList FamilyMember

Pass Pass

Fixed Fixed

43

8. Conclusion & Future Work


The family tree generator is a user friendly application that is attracts the buyer as its difficult to maintain the family history and record in a hard book style, as their preservation is much of a doubt and even if typed and preserved as a softcopy, is not much readable and easy to use and deduce facts from it. Hence, such an application in which preservation as well as readability is assured becomes a necessity. The family tree generator so created isnt restricted to one side of the family branch, as in it will show you your dads father tree with your grandfather, great grandfather and mother, etc but it will also show your maternal grandpa and grandma. This feature doesnt depend on the gender of a person but it depends on who the current person is. So, you can take place of your grandfather and see how it feels to have son like your father! Genealogy is a very diverse field; it doesnt just restrict to family ties but can be very helpful in determining the genetic disorders, diseases or any hereditary warnings. Information concerning your family history is thus useful to medical professionals. It helps them determine whether you or other family members have increased risk for various hereditary diseases or genetic illnesses. Doctors monitor medical issues such as heart problems, diabetes, strokes and cancer with this data. Hence, its not just a have fun kind of application but can prove to be of vital importance in future. We can work in this aspect- by applying an algorithm to determine which are the high risk diseases for a family and what precautions should be taken by them.

44

Glossary
Abbreviation Description

GUI MDI Container class awt JDK

Graphic User Interface Multiple Document Interface A class that is used to contain other java objects. They contain methods for adding and removing objects, as well as ways to iterate through them Abstract Windowing Toolkit Java Development Kit

45

References
1. 2. 3. 4. 5. 6. Java Swing, 2nd Edition - O'Reilly Media Family Tree by Martin Smales docs.oracle.com/javase/tutorial/uiswing/events/actionlistener.html www.myheritage.com/ familytreeproject.codeplex.com/ Core Java, Vol. 2: Advanced Features, 8th Edition- Cay S. Horstmann, Garry Cornell

46

Das könnte Ihnen auch gefallen