• No results found

Project Report on Family Tree Generator in JAVA

N/A
N/A
Protected

Academic year: 2021

Share "Project Report on Family Tree Generator in JAVA"

Copied!
46
0
0

Loading.... (view fulltext now)

Full text

(1)

A

A

PROJECT REPORT

PROJECT REPORT

ON

ON

Family Tree Generator 

Family Tree Generator 

In partial fulfillment of 

In partial fulfillment of 

B. Tech IV Year (Computer Science Engineering)

B. Tech IV Year (Computer Science Engineering)

Session 2012-13

Session 2012-13

S

Su

ub

bm

miitttte

ed

d T

To

o:

:

S

Su

ub

bm

miitttte

ed

d b

by

y::

P

Prro

off.

. V

Viirre

en

nd

drra

a S

So

on

ni

i

P

Prriiy

ya

an

nk

ka

a R

Ra

ajjp

pu

urro

oh

hiitt

P

Prro

offe

es

ss

so

or

r

IIV

V

Y

Ye

ea

ar

r

/

/

V

VIII

I

S

Se

em

m

Department of Computer Science Engineering

Department of Computer Science Engineering

JIET School of Engineering &

JIET School of Engineering & Technology for Girls

Technology for Girls

Jodhpur 

(2)

Certificate

Certificate

This is to certify that the Major Project entitled

This is to certify that the Major Project entitled Family Tree GeneratorFamily Tree Generator has been has been carriedcarried out by the student of college

out by the student of college JIET School of Engineering & Technology for Girls,JIET School of Engineering & Technology for Girls, Jodhpur

Jodhpur under my guidance and supervision in partial fulfillment of the degree of Bachelor under my guidance and supervision in partial fulfillment of the degree of Bachelor  of Technology in Computer Science Engineering of Rajasthan Technical University, Kota of Technology in Computer Science Engineering of Rajasthan Technical University, Kota during the academic year 2012-13.

during the academic year 2012-13.

Team: Team: Priyanka Rajpurohit Priyanka Rajpurohit Date: 25/10/2012 Date: 25/10/2012

Place: JIET-SETG, Jodhpur  Place: JIET-SETG, Jodhpur 

S

Siig

gn

na

attu

urre

e o

of

f G

Gu

uiid

de

e

S

Siig

gn

na

attu

urre

e o

of

f H

HO

OD

D

---

---N

Na

am

me

e o

of

f G

Gu

uiid

de

e

P

Prro

off.

. M

Ma

am

mtta

a G

Ga

arrg

g

A

As

ss

siis

stta

an

nt

t P

Prro

offe

es

ss

so

or

r

H

He

ea

ad

d o

of

f D

De

ep

pa

arrttm

me

en

ntt,,

D

De

ep

pa

arrttm

me

en

nt

t o

of

f C

CS

SE

E

D

De

ep

pa

arrttm

me

en

nt

t o

of

f C

CS

SE

E,,

J

(3)

Certificate

Certificate

This is to certify that the Major Project entitled

This is to certify that the Major Project entitled Family Tree GeneratorFamily Tree Generator has been has been carriedcarried out by the student of college

out by the student of college JIET School of Engineering & Technology for Girls,JIET School of Engineering & Technology for Girls, Jodhpur

Jodhpur under my guidance and supervision in partial fulfillment of the degree of Bachelor under my guidance and supervision in partial fulfillment of the degree of Bachelor  of Technology in Computer Science Engineering of Rajasthan Technical University, Kota of Technology in Computer Science Engineering of Rajasthan Technical University, Kota during the academic year 2012-13.

during the academic year 2012-13.

Team: Team: Priyanka Rajpurohit Priyanka Rajpurohit Date: 25/10/2012 Date: 25/10/2012

Place: JIET-SETG, Jodhpur  Place: JIET-SETG, Jodhpur 

S

Siig

gn

na

attu

urre

e o

of

f G

Gu

uiid

de

e

S

Siig

gn

na

attu

urre

e o

of

f H

HO

OD

D

---

---N

Na

am

me

e o

of

f G

Gu

uiid

de

e

P

Prro

off.

. M

Ma

am

mtta

a G

Ga

arrg

g

A

As

ss

siis

stta

an

nt

t P

Prro

offe

es

ss

so

or

r

H

He

ea

ad

d o

of

f D

De

ep

pa

arrttm

me

en

ntt,,

D

De

ep

pa

arrttm

me

en

nt

t o

of

f C

CS

SE

E

D

De

ep

pa

arrttm

me

en

nt

t o

of

f C

CS

SE

E,,

J

(4)

Acknowledgment

Acknowledgment

This project involved the collection and analysis of information from a wide variety of  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 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

achieve the results reported in this document without their help, support and encouragement.

encouragement.

I am highly indebted to Prof. Virendra Soni professor of computer science department, for  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

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  information regarding the minor project & also for their support in completing the minor   project.  project. Priyanka Rajpurohit Priyanka Rajpurohit October 25, 2012 October 25, 2012

(5)

Abstract

Abstract

A strong family relationship can make changes in any one’s life!!! Any family has its share A strong family relationship can make changes in any one’s life!!! Any family has its share of challenges in life – the children grow up, move out, change jobs, and move to different 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. communities. Other routine events are various births, deaths, marriages, and illnesses etc. that restruc

that restructure the family. It is a ture the family. It is a fact that families are a major force in fact that families are a major force in the develothe development of pment of  society. But with today’s busy lifestyles, somehow the family members tend to drift apart society. But with today’s busy lifestyles, somehow the family members tend to drift apart and these bonds become less strong.

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  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 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 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. 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 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 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 have little knowledge of our culture or how we fit in. You will also come to understand more about your purpose in life.

more about your purpose in life.

The project Family Tree Generator gives the user the ability to track back to his ancestral 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. 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 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 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, diseases or genetic illnesses. Doctors monitor medical issues such as heart problems, diabetes, strokes and cancer with this data.

diabetes, strokes and cancer with this data.

As you research your ancestral roots you will increase your skills in a number of areas. 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 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

categorize information. Compiling your family tree is a priceless legacy for future generations.

(6)

Table of Contents

Certificate...

2

Acknowledgment...

3

Abstract...

4

Table of Contents...

5

1.

Introduction...

6

2.

Literature Survey... 8

3.

Requirement Specification...10

4.

Architectural Design...13

5.

Test Planning...33

6.

Work Distribution...37

7.

Results...38

8.

Conclusion & Future Work...44

Glossary... 45

(7)

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 user’s 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 user’s 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 

(8)

  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

(9)

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).

(10)

 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;

(11)

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 Req.

Development Tools, including Java FX SDK 245 MB

Source Code 27MB

Public Java Runtime Environment 124 MB And 32 bit platform- Pentium 2 266 MHz processor. 4. Specific

functiona) 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.

ii. 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.

(12)

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.

iv. 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.

 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 

(13)

Use case diagram:

-Edit current

person

Add Father

Add Mother

Add Child

Add Spouse

Make new

family tree

Open

existing

family tree

(14)

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-• 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 time.

(15)

Functional Block Diagram MDI SELECT MODE EDIT VIEW Create new tree Create new family tree Open an existing family tree Open an existing family tree Edit current  person Add Mother 

Add Father Add Spouse Add Child

Enter details viz. First name, gender, birth surname, paragraph,

etc. UPDATE SAVE EXIT EXIT BLOCK  SELECTION BLOCK 

(16)

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

Module Dependencies:

• Input Dependencies: Actionlistener, click event • Output Dependencies: NA

3. MDI

Functional Block Diagram

(17)

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

(18)

Data Description

Data Flow Diagram

Edit/view

Select mode

Create new

family tree

Open

existing tree

Edit Details

Save/update

Exit

Edit/view Edit/view Edit Edi Edit Open file Edit/view

(19)

Flow Chart

Start

Select

mode

Create/ open family tree Create/ open family tree Enter file

name Enter filename

Edit details

View family

tree

Update/Save

View family

tree

Edit Vie Ope Ope Create Create found found  Not found  Not found

(20)

User Interface Design

User Interface

--File Mode Help

Edit Current Add Father Add Mother Add Child

(21)

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 FamilyMember-getFirstName

 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 

(22)

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

(23)

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

(24)

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

(25)

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

(26)

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

(27)

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

FamilyMemberGUI-repaintGUI

 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

FamilyMemberList-add

 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

(28)

Pseudo code

Module

Name-Selection 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:  [email protected]");

}

8. else if father button is clicked, make him as the current person. Repaint GUI ( e.getSource() == fatherButton){

(29)

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 

(30)

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;

}

(31)

}

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

(32)

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(); }

(33)

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 /

Test ID

Module/ Class Features

1 FamilyMemberGUI This class demonstrates a family tree using a GUI

2 FamilyMember This class provides definiton of   FamilyMember 

3 FamilyMemberList This class provides definition of   FamilyMember class to handle family member arrays

(34)

setup:-

 Hardware:-The basic requirements for hardware are a normal   PC setup that may be as described below:

• User interface : Keyboard and Mouse.

• Processor : Pentium 2 266 MHz or higher.

• RAM : 240 MBor more.

• Hard disk : 2 GB or more.

 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

(35)

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

(36)

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 user’s 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.

(37)

6. Work Distribution

Name of function/

module Start Date End Date

Responsible Person

1.

Designing of user 

interface 15-09-2012 22-09-2012

Priyanka Rajpurohit

2. RepaintGUI() 15-09-2012 22-09-2012 Priyanka Rajpurohit 3. FamilyMember 23-09-2012 30-09-2012 Priyanka Rajpurohit 4. FamilyMemberGUI 1-10-2012 7-10-2012 Priyanka Rajpurohit 5. FamilyMemberList 8-10-2012 14-10-2012 Priyanka Rajpurohit 6.

Module Integration

& testing 15-10-2012 20-10-2012

(38)

7. Results

First user interface

(39)

Using Edit current person option

(40)

Using Add Father option

(41)

Updated family tree

(42)

Using Add Child option

(43)
(44)

Test Status Report

S.No. Module Name Status (Pass/Fail) Error Status

(Fixed/Open) Remarks

1 Repaint Pass Fixed When repainted the child panel was

still visible to remove it I used familyPanel.remove(childPanel)

 before new JPanel()

2. FamilyMemberGUI Pass Fixed Use actionlistiner interface when  performing action on button. I resolve it by implementing ActionListiner  Interface.

3. FamilyMemberList Pass Fixed No error  

4. FamilyMember Pass Fixed I got error as I didn’t initialize father=mother=spouse=null in the constructor.

(45)

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 isn’t restricted to one side of the family branch, as in it will show you your dad’s father tree with your grandfather, great grandfather and mother, etc but it will also show your maternal grandpa and grandma. This feature doesn’t 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 doesn’t 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, it’s 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.

(46)

Glossary

Abbreviation Description

GUI Graphic User Interface

MDI Multiple Document Interface

Container class

 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

awt Abstract Windowing Toolkit

References

Related documents

As was discussed above, grammatical relations are a complex issue in Algonquian languages, and can be detected only in particular clause types; symmetrical-voice systems like

When the selected value for the optical density corresponds to either the venous oxygen saturation (Case II) or the arterial oxygen saturation (Case III), the output signal

Alfendri, Yogica &amp; Lufri 206 belum tersedianya media pembelajaran berupa multimedia interaktif menggunakan macromedia flash disertai metode drill tentang materi

% Title Mr/Mrs/Etc: Forename: Middle Name(s): Surname: Maiden Name: Gender: Date of Birth: Marital Status: dd mm yyyy Male Female Step 1 In FULL (If applicable) Contact

If an applicant wishes to register using any form of their name other than as it appears exactly on their birth certificate (not including a change of surname that can be evidenced

Date of Employment From : To: Position held and main duties – giving grade and salary if known.. Reason

the physical layer and is in charge of transmitting data from a node of a network to another node which is directly connected. to the

Feb 2 – Mar 15 Application Period A: Applicants who have had their Pre-Application forms approved should submit their Application for Admission with all required documents, as