Vous êtes sur la page 1sur 32

A

Project Report
Of
Summer Training Project At

On

BASIC CALCULATOR
Submitted
In The partial fulfilment of
Bachelor of Technology
Department Of Computer Science and Engineering

Ambedkar Institute of Advanced Communication


Technologies & Research
Submitted To:

Submitted By:
Name:

AZHAR MIZAN

Btech (C.S.E): 3rd Year


Semester:

5th

Roll number: 04110102713

ACKNOWLEDGEMENT
Gratitude is not a thing of expression. It is more matter of feeling.
There is always a sense of gratitude towards for their help and supervision in
achieving the goals. The formal piece of acknowledgement is an attempt to
express the feeling of gratitude towards people who helpful me in successfully
completing of my training.
Above all no words can express my feelings to my parents. Friends all those
person who supported me during my project. I am also thankful to all the
responders whose cooperation & support has helped me a lot in collecting
necessary information.

Table of Content
Content

page no.

Cover page..... 1
Training Certificate.. 2
Acknowledgement. 3
Table of content............. 4
Company profile. 7
Abstract.
1. Introduction
1.1 Project Overview.
1.2 Java Overview ......................................................................... 15
1.3 History of Java: ......................................................................................... 16
1.4 Tools you will need: .................................................................................. 16
2. Java Environment setup:.
3. Design model:.
4. Java Basic Syntax ....................................................................
4.1 Java Identifiers: ........................................................................................ 20

4.2 Java Modifiers: ......................................................................................... 21


4.3 Java Variables: ......................................................................................... 21
4.4 Java Arrays: ............................................................................................. 21
4.5 Java Enums: ............................................................................................. 21
5.

Java Object & Classes ............................................................. 24


5.1 Objects in Java: ........................................................................................ 24
5.2 Classes in Java: ....................................................................................... 25
5.3 Constructors: ............................................................................................ 25

6. Main Project
6.1 Project preview
6.2 Project code
6.2.1 Running state snapshot

6.3 Uses of Implemented Calculator


3

7. Main Java Technology Uses


7.1 Javax.swing package
7.2 AWT EVENT HANDLING
7.2.1
7.2.2
7.2.3
7.2.4

What is an Event?
Types of Event 86
What is Event Handling?
Callback Methods

Company profile
Internshala is a dot com business with the heart of dot org.
At the core of the idea is the belief that internships, if managed well, can make
a positive difference to the student, to the employer, and to the society at
large. Hence, the ad-hoc culture surrounding internships in India should and
would change. Internshala aims to be the driver of this change.
Internshala is different things to different people-

For million plus students struggling to get a meaningful internship every year,
Internshala is a friend, a mentor, an affectionate senior, and a boon.

Introduction
This document presents the System Architecture of Calculator project implemented in swing (Java).
The System Architecture described would be used for development of the product and
will be used as an input to the various development and testing phases of the Software
Development Lifecycle.

This document is also comprising of the topics I covered during my training period. Each and every
topic is described briefly and efficiently. Topics are observed carefully and large amount of
knowledge is gained from each and every point denoted in the document field. As well as coding is
also done for the corresponding coding topic I studied.

This document also have the brief denotation of the Tools I used at the Internshala
for various works. Every tool written over here is learned by the practical usage in the company.

The document is broken into three main sections: The Main Project, Topics I studied during
Training, and Tools I used during Training. The Main project represents the high level view of the
system as a box, depicting various interacting blocks belonging to its execution environment. Topics
I studied during Training is further drilled down to logically define each and every topic I studied
during my training period.
These topics cover the area related to Project as well as for general studies of the Technical
information. Finally, The Tools I used during Training, which outlines various tools I used during
my training period for observation of code, doing review work and entering the details of the daily
work done.

This would document the methodology being anticipated for achieving the non-functional goals of
an expected functionality.

1. Introduction
1.1

Project Overview

A calculator is a device that performs arithmetic operations on numbers. The simplest


calculators can do only addition, subtraction, multiplication, and division. More sophisticated
calculators can handle exponential operations, roots, logarithms, trigonometric functions, and
hyperbolic functions. Internally, some calculators actually perform all of these functions by
repeated processes of addition.
A software calculator is a calculator that has been implemented as a computer program,
rather than as a physical hardware device.
They are among the simpler interactive software tools, and, as such, they:

Provide operations for the user to select one at a time.

Can be used to perform any process that consists of a sequence of steps each of which applies
one of these operations.

Have no purpose other than these processes, because the operations are the sole, or at least
the primary, features of the calculator, rather than being secondary features that support other
functionality that is not normally known simply as calculation.

As a calculator, rather than a computer, they usually:

Have a small set of relatively simple operations.

Perform short processes that are not compute intensive.

Do not accept large amounts of input data or produce many results

1.2

Java Overview

Java programming language was originally developed by Sun Microsystems which was initiated
by James

Gosling and released in 1995 as core component of Sun Microsystems Java platform (Java 1.0
[J2SE]).

As of December 2008, the latest release of the Java Standard Edition is 6 (J2SE). With the
advancement of Java

Its widespread popularity, multiple configurations were built to suite various types of platforms.
Ex: J2EE for
8

Enterprise Applications, J2ME for Mobile Applications.

Sun Microsystems has renamed the new J2 versions as Java SE, Java EE and Java ME,
respectively. Java is

Guaranteed to be Write Once, Run Anywhere.

Java is:

Object Oriented: In Java, everything is an Object. Java can be easily extended since it is based
on the

Object model.

Platform independent: Unlike many other programming languages including C and C++, when
Java is

Compiled, it is not compiled into platform specific machine, rather into platform independent byte
code.

This byte code is distributed over the web and interpreted by virtual Machine (JVM) on
whichever platform

It is being run.

Simple Java is designed to be easy to learn. If you understand the basic concept of OOP,Java
would be

Easy to master.

Secure: With Java's secure feature, it enables to develop virus-free, tamper-free systems.
Authentication

Techniques are based on public-key encryption.

Architectural-neutral:- Java compiler generates an architecture-neutral object file format, which


makes

The compiled code to be executable on many processors, with the presence of Java runtime
system.

Portable: Being architectural-neutral and having no implementation dependent aspects of the

specification makes Java portable. Compiler inJava is written in ANSI C with a clean portability
boundary

which is a POSIX subset.

Robust:Java makes an effort to eliminate error prone situations by emphasizing mainly on


compile time

error checking and runtime checking.

1.3

History of Java
James Gosling initiated the Java language project in June 1991 for use in one of his many settop box projects.The language, initially called Oak after an oak tree that stood outside Gosling's
office, also went by the namGreen and ended up later being renamed as Java, from a list of
random words Sun released the first public implementation as Java 1.0 in 1995. It promised
Write Once, Run Anywhere (WORA), providing no-cost run-times on popular platforms.On 13
November 2006, Sun released much of Java as free and open source software under the terms
of the GNU General Public License (GPL).On 8 May 2007, Sun finished the process, making all
of Java's core code free and open-source, aside from a small portion of code to which Sun did
not hold the copyright.

1.4

Tools Used

For performing the examples discussed in this tutorial, you will need a Pentium 200-MHz
computer with a minimum of 64 MB of RAM (128 MB of RAM recommended).You also will need
the following softwares:
Linux 7.1 or Windows 95/98/2000/XP operating system.
Java JDK 5
Microsoft Notepad or any other text editor
This tutorial will provide the necessary skills to create GUI, networking, and Web applications
using Java.

1. Java Environment SetUp

Before we proceed further, it is important that we set up the Java environment correctly. This
section guides you on how to download and set up Java on your machine. Please follow the
following steps to set up the environment.Java SE is freely available from the link Download
Java. So you download a version based on your operation system.Follow the instructions to
download Java and run the .exe to install Java on your machine. Once you installed Java on
10

your machine, you would need to set environment variables to point to correct installation
directories:
Setting up the path for windows 2000/XP:
Assuming you have installed Java in c:\Program Files\java\jdk directory:
Right-click on 'My Computer' and select 'Properties'.
Click on the 'Environment variables' button under the 'Advanced' tab.
Now, alter the 'Path' variable so that it also contains the path to the Java executable. Example,
if the path is
currently set to 'C:\WINDOWS\SYSTEM32', then change your path to read
'C:\WINDOWS\SYSTEM32;c:\Program Files\java\jdk\bin'.

2. Design model

Project is developing over the Waterfall model of SDLC life cycle. Currently the HSAN project is going
on High level Design of Design face.
Waterfall model consist of following phases-

11

1- RequirementsAll requirements specification from first phase are studied in this phase and system design
is prepared. System design helps in specifying hardware and system requirements and also
helps in defining overall system architecture.
2- System DesignThe requirement specifications from first phase are studied in this phase and system design
is prepared. System Design helps in specifying hardware and system requirements and also
helps in defining overall system architecture.
3- Coding OR ImplementationWith inputs from system design, the system is first developed in small programs called
units, which are integrated in the next phase. Each unit is developed and tested for its
functionality which is referred to as Unit Testing.
4- Integration and TestingAll the units developed in the implementation phase are integrated into a system after
testing of each unit. Post integration the entire system is tested for any faults and failures.

12

5- Development of systemOnce the functional and non-functional testing is done, the product is deployed in the
customer environment or released into the market.
6- MaintenanceThere are some issues which come up in the client environment. To fix those issues patches
are released. Also to enhance the product some better versions are released. Maintenance is
done to deliver these changes in the customer environment.

Waterfall Model Pros & Cons

Advantage
The advantage of waterfall development is that it allows for departmentalization and control. A
schedule can be set with deadlines for each stage of development and a product can proceed through
the development process model phases one by one.
Development moves from concept, through design, implementation, testing, installation,
troubleshooting, and ends up at operation and maintenance. Each phase of development proceeds
in strict order.

Disadvantage
The disadvantage of waterfall development is that it does not allow for much reflection or revision.
Once an application is in the testing stage, it is very difficult to go back and change something that
was not well-documented or thought upon in the concept stage.

13

3. JAVA BASIC SYNTAX


3.1. Java Identifiers

All Java components require names. Names used for classes, variables and methods are called
identifiers.In Java, there are several points to remember about identifiers. They are as follows:
All identifiers should begin with a letter (A to Z or a to z), currency character ($) or an underscore
(_).
After the first character, identifiers can have any combination of characters.
A keyword cannot be used as an identifier.
Most importantly identifiers are case sensitive.
Examples of legal identifiers: age, $salary, _value, __1_value
Examples of illegal identifiers: 123abc, -salary

3.2. Java Modifiers

Like other languages, it is possible to modify classes, methods, etc., by using modifiers. There are
two categories of modifiers:
Access Modifiers: default, public, protected, private
Non-access Modifiers: final, abstract, strictfp
We will be looking into more details about modifiers in the next section.

3.3. Java Variable


We would see following type of variables in Java:
Local Variables
Class Variables (Static Variables)
Instance Variables (Non-static variables)
14

4.4 Java Array


Arrays are objects that store multiple variables of the same type. However, an array itself is an object
on the heap.
We will look into how to declare, construct and initialize in the upcoming chapters.

4.5 Java Enumeration


Enums were introduced in java 5.0. Enums restrict a variable to have one of only a few predefined
values. The values in this enumerated list are called enums.With the use of enums, it is possible to
reduce the number of bugs in your code.For example, if we consider an application for a fresh juice
shop, it would be possible to restrict the glass size tosmall, medium and large. This would make sure
that it would not allow anyone to order any size other than the specified one.

4. Java Object & Classes ............................................................. 24


Java is an Object-Oriented Language. As a language that has the Object Oriented feature, Java
supports the following fundamental concepts:
Polymorphism
Inheritance
Encapsulation
Abstraction
Classes
Objects
Instance
Method
Message Parsing

15

In this chapter, we will look into the concepts Classes and Objects.
Object - Objects have states and behaviors. Example: A dog has states-color, name, breed as well
as behaviors -wagging, barking, eating. An object is an instance of a class.
Class - A class can be defined as a template/blue print that describes the behaviors/states that
object of its type support.

4.1.

Objects in Java:

Let us now look deep into what are objects. If we consider the real-world we can find many objects
around us, Cars, Dogs, Humans, etc. All these objects have a state and behavior. If we consider a dog,
then its state is - name, breed, color, and the behavior is - barking, wagging, running If you compare
the software object with a real world object, they have very similar characteristics.
Software objects also have a state and behavior. A software object's state is stored in fields and
behavior is shown via methods. So in software development, methods operate on the internal state
of an object and the object-to-object communication is done via methods.

5.2 Classes in Java: ....................................................................................... 25


A class is a blue print from which individual objects are created.
A sample of a class is given below:
public class Dog{
String breed;
int age;
String color;
void barking(){
}
void hungry(){
}
16

void sleeping(){
}
}
A class can contain any of the following variable types.
Local variables: Variables defined inside methods, constructors or blocks are called local variables.
The variable will be declared and initialized within the method and the variable will be destroyed
when the method has completed.
Instance variables: Instance variables are variables within a class but outside any method. These
variables are instantiated when the class is loaded. Instance variables can be accessed from inside
any method,constructor or blocks of that particular class.
Class variables: Class variables are variables declared within a class, outside any method, with the
static keyword. A class can have any number of methods to access the value of various kinds of
methods. In the above example,barking(), hungry() and sleeping() are methods.

5.3 Constructors: ............................................................................................ 25


When discussing about classes, one of the most important subtopic would be constructors. Every
class has a constructor. If we do not explicitly write a constructor for a class the Java compiler builds
a default constructor for that class.Each time a new object is created, at least one constructor will be
invoked. The main rule of constructors is that they should have the same name as the class. A class
can have more than one constructor.
Example of a constructor is given below:
public class Puppy{
public Puppy(){
}public Puppy(String name){
// This constructor has one parameter, name.
}}
17

6. Main Project
6.1 Project preview

A software calculator is a calculator that has been implemented as a computer program,


rather than as a physical hardware device.
They are among the simpler interactive software tools, and, as such, they:

Provide operations for the user to select one at a time.

Can be used to perform any process that consists of a sequence of steps each of which applies
one of these operations.

Have no purpose other than these processes, because the operations are the sole, or at least
the primary, features of the calculator, rather than being secondary features that support other
functionality that is not normally known simply as calculation.

As a calculator, rather than a computer, they usually:

Have a small set of relatively simple operations.

Perform short processes that are not compute intensive.

Do not accept large amounts of input data or produce many results.

Simulation of hardware calculators


Calculators have been used since ancient times and until the advent of software calculators they
were physical, hardware machines. The most recent hardware calculators are electronic hand-held
devices with buttons for digits and operations, and a small window for inputs and results.
The first software calculators imitated these hardware calculators by implementing the same
functionality with mouse-operated, rather than finger-operated, buttons. Such software calculators
first emerged in the 1980s as part of the Windows operating system.
Some software calculators directly simulate one of the hardware calculators, by presenting an image
that looks like the calculator, and by providing the same functionality.

18

Software calculators on the Internet


There is now a very wide range of software calculators, and searching the Internet produces very
large numbers of programs that are called calculators.

The results include numerical calculators that apply arithmetic operations or mathematical functions
to numbers, and that produce numerical results or graphs of numerical functions, plus some nonnumerical tools and games that are also called calculators.

Many of the results are calculators that do not imitate or simulate hardware calculators, but that take
advantage of the greater power of computer software to implement alternative types of calculators.
Software calculators are provided on the Internet which are customizable to use any conceivable
algebraic expression.

These user-customizable software calculators can also be used in conjunction with formula or
equation creation capabilities so that the software calculator can now be created to perform all
possible mathematical functions. No longer limited to a set of trigonometric and simple algebraic
expressions, versions of the software calculator are now tailored to any and all topical applications.

19

6.2 Project code


import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.lang.Exception;
public class Calculator extends JFrame implements ActionListener{

JPanel [] row = new JPanel[5];


JButton [] button = new JButton[18];
String[]
buttonString
","1","2","3","*",".","/","c","sqrt","+/-","0"};

{"7","8","9","+","4","5","6","-

int [] dimW = {300,45,100,90};


int [] dimH = {35,40};
Dimension
Dimension(dimW[0],dimH[0]);

displayDimension

new

Dimension
Dimension(dimW[1],dimH[1]);

regularDimension

new

Dimension
Dimension(dimW[2],dimH[1]);

rColumnDimension

new

Dimension
Dimension(dimW[3],dimH[1]);

zeroButDimension

new

boolean [] function = new boolean[4];


double [] temporary = {0,0};
JTextArea display = new JTextArea(1,20);
Font font = new Font("Times new Roman",Font.BOLD,14);
Calculator(){
super("Calculator");
setDesign();
setSize(380,250);
setResizable(false);
20

setDefaultCloseOperation(EXIT_ON_CLOSE);
GridLayout grid = new GridLayout(5,5);
setLayout(grid);
for(int i=0;i<4;i++)
function[i] = false;

FlowLayout f1 = new FlowLayout(FlowLayout.CENTER);


FlowLayout f2 = new FlowLayout(FlowLayout.CENTER,1,1);
for(int i=0;i<5;i++)
row[i] = new JPanel();
row[0].setLayout(f1);
for(int i=1;i<5;i++)
row[i].setLayout(f2);
for(int i=0;i<18;i++){
button[i] = new JButton();
button[i].setText(buttonString[i]);
button[i].setFont(font);
button[i].addActionListener(this);
}
display.setFont(font);
display.setEditable(false);
display.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
display.setPreferredSize(displayDimension);
for(int i=0;i<14;i++)
button[i].setPreferredSize(regularDimension);
for(int i=14;i<18;i++)
button[i].setPreferredSize(rColumnDimension);
button[17].setPreferredSize(zeroButDimension);
row[0].add(display);
21

add(row[0]);
for(int i=0;i<4;i++)
row[1].add(button[i]);
add(row[1]);
for(int i=4;i<8;i++)
row[2].add(button[i]);
add(row[2]);
for(int i=8;i<12;i++)
row[3].add(button[i]);
add(row[3]);
row[4].add(button[17]);
for(int i=12;i<14;i++)
row[4].add(button[i]);
row[4].add(button[17]);
add(row[4]);
row[5].add(button[14]);
row[5].add(button[15]);
row[5].add(button[16]);
add(row[5]);
setVisible(true);
}

public void clear(){


try{
display.setText("");
for(int i=0;i<4;i++)
function[i] = false;
for(int i=0;i<2;i++)
temporary[i] = 0;
}catch(NullPointerException e){
22

}
}

public void getSqrt(){


try{
double value = Math.sqrt(Double.parseDouble(display.getText()));
display.setText(Double.toString(value));
}catch(NumberFormatException e){}
}

public void getPosNeg(){


try{
double value = Double.parseDouble(display.getText());
if(value!=0)
value = value * (-1);
else {}
}catch(NumberFormatException e){
}
}

public void getResult(){


double result = 0;
temporary[1] = Double.parseDouble(display.getText());
String tempo = Double.toString(temporary[0]);
String temp1 = Double.toString(temporary[1]);
try{
if(tempo.contains("-")){
String tempoo[] = tempo.split("-",2);
temporary[0] = (Double.parseDouble(tempoo[1])*-1);
}
23

if(temp1.contains("-")){
String [] temp11 = temp1.split("-",2);
temporary[1]

(Double.parseDouble(temp11[1])*-1);
}
}catch(ArrayIndexOutOfBoundsException e){}
try{
if(function[2]==true)
result = temporary[0]*temporary[1];
else if(function[3]==true)
result = temporary[0]/temporary[1];
else if(function[0]==true)
result = temporary[0]+temporary[1];
else if(function[1]==true)
result = temporary[0]-temporary[1];
display.setText(Double.toString(result));
for(int i=0;i<4;i++)
function [i] = false;

}catch(NumberFormatException e){}
}

public final void setDesign(){


try{
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAnd
Feel");

}catch(Exception e){}
24

}
public void actionPerformed(ActionEvent e){
if(e.getSource()==button[0])
display.append("7");
if(e.getSource()==button[1])
display.append("8");
if(e.getSource()==button[2])
display.append("9");
if(e.getSource()==button[3]){
temporary[0] = Double.parseDouble(display.getText());
function[0] = true;
//display.setText("");
}
if(e.getSource()==button[4])
display.append("4");
if(e.getSource()==button[5])
display.append("5");
if(e.getSource()==button[6])
display.append("6");
if(e.getSource()==button[7]){
temporary[0] = Double.parseDouble(display.getText());
function[1] = true;
//display.setText("");
}
if(e.getSource()==button[8])
display.append("1");
if(e.getSource()==button[9])
display.append("2");
if(e.getSource()==button[10])
display.append("3");
25

if(e.getSource()==button[11]){
temporary[0] = Double.parseDouble(display.getText());
function[2] = true;
//display.setText("");
}
if(e.getSource()==button[12])
display.append(".");
if(e.getSource()==button[13]){
temporary[0] = Double.parseDouble(display.getText());
function[3] = true;
//display.setText("");
}
if(e.getSource()==button[14])
clear();
if(e.getSource()==button[15])
getSqrt();
if(e.getSource()==button[16])
getPosNeg();
if(e.getSource()==button[17])
getResult();
if(e.getSource()==button[17])
display.append("0");

}
public static void main(String s[]){
new Calculator();
}
}
26

6.2.1 Running state snapshot

6.3 Uses of Implemented Calculator

The Simple Virtual Calculator supports the following operations:


Addition (key '+')
Subtraction (key '-')
Multiplication (key 'X')
Division (key '/')

Memory Operation
The calculator has one memory that can be used for storing values temporarily. To clear the memory
(set it's value to 0), press the key 'MC'. To recall the value stored in memory use the key 'MR'. To
add to the value in memory, press 'M+'. To subtract a value from the memory use the key 'M-'.

Percentages
The Simple Virtual Calculator can be used to calculate percentages even though it doesn't have a
'%' key. Read how on this document: Percentage.

27

7. Main Java Technology Uses


7.1 Javax.swing Package

Swing is a GUI widget toolkit for Java. It is part of Oracle's Java Foundation Classes (JFC)
an API for providing a graphical user interface (GUI) for Java programs.
Swing was developed to provide a more sophisticated set of GUI components than the
earlier Abstract Window Toolkit (AWT). Swing provides a native look and feel that emulates the look
and feel of several platforms, and also supports apluggable look and feel that allows applications to
have a look and feel unrelated to the underlying platform. It has more powerful and flexible
components than AWT. In addition to familiar components such as buttons, check boxes and labels,
Swing provides several advanced components such as tabbed panel, scroll panes, trees, tables, and
lists.
Unlike AWT components, Swing components are not implemented by platform-specific code.
Instead, they are written entirely in Java and therefore are platform-independent. The term
"lightweight" is used to describe such an element.[1]
Swing is currently in the process of being replaced by JavaFX.

Provides a set of "lightweight" (all-Java language) components that, to the maximum degree
possible, work the same on all platforms.

28

Swing is a platform-independent, Model-View-Controller GUI framework for Java, which follows


a single-threaded programming model.[4] Additionally, this framework provides a layer of
abstraction between the code structure and graphic presentation of a Swing-based GUI.

AWT EVENT HANDLING .................................................................................................. 86


What is an Event? ................................................................................................................................. 86

Change in the state of an object is known as event i.e. event describes the change in state of
source. Events are generated as result of user interaction with the graphical user interface
components. For example, clicking on a button, moving the mouse, entering a character through
keyboard,selecting an item from list, scrolling the page are the activities that causes an event to
happen.
Types of Event .......................................................................................................................................
86
The events can be broadly classified into two categories:
Foreground Events - Those events which require the direct interaction of user.They are generated
as consequences of a person interacting with the graphical components in Graphical User Interface.
For example, clicking on a button, moving the mouse, entering a character through
keyboard,selecting an item from list, scrolling the page etc.

29

Background Events - Those events that require the interaction of end user are known as background
events. Operating system interrupts, hardware or software failure, timer expires, an operation
completion are the example of background events.

What is Event Handling?


....................................................................................................................... 86
Event Handling is the mechanism that controls the event and decides what should happen if an
event occurs. This mechanism have the code which is known as event handler that is executed
when an event occurs. Java Uses the Delegation Event Model to handle the events. This model
defines the standard mechanism to generate and handle the events.Let's have a brief introduction to
this model.

The Delegation Event Model has the following key participants namely:

Source - The source is an object on which event occurs. Source is responsible for providing
information of the occurred event to it's handler. Java provide as with classes for source
object.

Listener - It is also known as event handler.Listener is responsible for generating response


to an event. From java implementation point of view the listener is also an object. Listener
waits until it receives an event. Once the event is received , the listener process the event an
then returns.

The benefit of this approach is that the user interface logic is completely separated from the logic that
generates the event. The user interface element is able to delegate the processing of an event to the
separate piece of code. In this model ,Listener needs to be registered with the source object so that
the listener can receive the event notification. This is an efficient way of handling the event because
the event notifications are sent only to those listener that want to receive them.

30

1.

Steps involved in event handling

Now the object of concerned event class is created automatically and information about the source
and the event get populated with in same object.Event object is forwarded to the method of registered
listener class.The method is now get executed and returns.
The User clicks the button and the event is generated.

Callback Methods .................................................................................................................................. 87

These are the methods that are provided by API provider and are defined by the application
programmer and invoked by the application developer. Here the callback methods represents an
event method. In response to an event java jre will fire callback method. All such callback methods
are provided in listener interfaces.
If a component wants some listener will listen to it's events the the source must register itself to the
listener.

Other software I used1- Microsoft Word


2- Microsoft Excel (for the preparation of MOM (Minutes of Meeting)
sheet
3- VMware (for using Linux in windows)
4- Google Chrome

31

Bibliography
1234567-

http://www.tutorialspoint.com/sdlc/sdlc_waterfall_model.htm
https://sites.google.com/site/amitsciscozone/home/gpon/gpon-fundamentals
https://en.wikipedia.org/wiki/Line_card
https://en.wikipedia.org/wiki/Fiber_optic_splitter
http://searchtelecom.techtarget.com/definition/passive-optical-network
https://en.wikipedia.org/wiki/Optical_line_termination
http://courses.cs.washington.edu/courses/cse451/10au/tutorials/tutorial_ctags.ht
ml
8- http://vim.wikia.com/wiki/Cscope
9- http://www.tutorialspoint.com/makefile/
10- http://www.tutorialspoint.com/svn/svn_basic_concepts.htm
11- http://www.softpanorama.org/Utilities/teraterm.shtml
12- https://en.wikipedia.org/wiki/PuTTY
13- http://www.tutorialspoint.com/data_communication_computer_network/data_link
_layer_introduction.htm
14- http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html
15- http://www.linux-tutorial.info/modules.php?name=MContent&pageid=268
16- http://www.comptechdoc.org/os/linux/programming/c/linux_pgcmutex.html
17- http://www.9tut.com/virtual-local-area-network-vlan-tutorial
18- http://www.guru99.com/jira-tutorial-a-complete-guide-for-beginners.html
19- https://en.wikipedia.org/wiki/Vim_(text_editor)

32