CERTIFIC ATE This is to certify that ROHIT AGGARWAL the student of B.TECH(COMPUTER SCIENCE) IV semester at Shree Ram Mulkh Instt. of Engg. & Tech.,Ambala has undergone training in Java languge for a period of six weeks on the project entitled “Notepad”. He has completed his training and project successfully in time. During the period of training his conduct was very good. He was sincere and always ready to learn things and use them practically. I wish him all the success in the future. SUPERVISIOR (Poonam Sehrawat) NIIT Najafgarh
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
CERTIFICATE
This is to certify that ROHIT AGGARWAL the student of B.TECH(COMPUTER SCIENCE) IV semester at Shree Ram Mulkh Instt. of Engg. & Tech.,Ambala has undergone training in Java languge for a period of six weeks on the project entitled “Notepad”. He has completed his training and project successfully in time.
During the period of training his conduct was very good. He was sincere and always ready to learn things and use them practically.
I wish him all the success in the future.
SUPERVISIOR(Poonam Sehrawat)NIITNajafgarh
ACKNOWLEDGEMENTS
It is my privilege to express my profound sense of gratitude to my supervisor Ms.
Poonam Sehrawat for their invaluable guidance, positive attitude and constant
encouragement throughout my project work. It has been wonderful to work under
her supervision, which gave me motivation and experience.
I am grateful to Ms. Poonam Sehrawat Head of Department of Java, NIIT, New
Delhi and other faculty members of the department for their providing us
necessary facilities I needed at various stages of this work.
I am thankful to all my colleagues and friends.
Finally, I would like to express my gratitude to my family members for their moral
support and encouragement.
(Rohit Aggarwal)
PREFACE
This six weeks training is the part of four year degree course. It was really a great
experience to work in computer lab of NIIT , one gets an opportunity to see from
close quarters about the environment in which an engineer works.
We joined the computer lab of NIIT under the guidance of skilled and experienced
teachers in JAVA, we had learned a lot during the training and really enjoyed my
work at the laboratory.
Table of contents
S.No. Contents
1. NIIT
2. Abstract
3. Objective of the Project
4. Requirement Analysis
4.1 Need and Justification
4.2 Feasibility Study
4.3 Use Case Diagram
4.4 Flow Chart
4.5 System Requirement specification
5. System Design
6. Coding and snapshots
7. Software testing
8. Further Enhancement
9. References
NIIT
NIIT is a leading Global Talent
Development Corporation, building a
skilled manpower pool for global industry
requirements. The company which was set
up in 1981, to help the nascent IT industry
overcome its human resource challenges,
has today grown to rank among the
world’s leading talent development
organisations offering learning solutions
to Individuals, Enterprises and Institutions
across 40 countries.
NIIT’s training solutions in IT, Business
Process Outsourcing, Banking, Finance
and Insurance, Executive Management
Education, and Communication and
Professional Life Skills, touch five million
learners every year. NIIT’s expertise in
learning content development, training
delivery and education process
management make us the most preferred
training partner, worldwide.
Research-based Innovation, a key driver at NIIT, has enabled us to develop
programmes and curricula that use cutting-edge instructional design
methodologies and training delivery. NIIT’s Individual Learning Solutions include
industry-endorsed IT training programmes like GNIIT, Integrated programmes for
Engineers (NIIT Edgeineers) and Infrastructure Management programmes (NIIT
GlobalNet+).
NIIT Imperia, Centre for Advanced Learning, brings Executive Management
Education Programmes from premier B-schools in India, to the doorsteps of
working professionals.
NIIT Institute of Finance Banking & Insurance (IFBI), set up by NIIT with equity
participation from ICICI Bank, offers programmes for individuals and corporates
in the Banking, Financial Services and Insurance segments.
NIIT Institute of Finance Banking & Insurance (IFBI), set up by NIIT with equity
participation from ICICI Bank, offers programmes for individuals and corporates
in the Banking, Financial Services and Insurance segments.
NIIT Uniqua, Centre for Process Excellence, addresses the increasing demand for
skilled workers in the business and technology services industry by providing
training programmes in relevant areas. This initiative is a part of the NIIT Institute
of Process Excellence, a NIIT-Genpact joint venture.
NIIT’s School Learning Solutions offer turnkey IT integration programmes for
schools and has provided computer-based learning to nearly 7.8 million students
in over 9,500 Government and private schools. NIIT eGuru, a comprehensive
range of learning solutions for schools is powering NIIT’s portfolio for the K-12
segment.
In order to address the vast population of underprivileged, school-aged children,
NIIT launched the Hole-in-the-Wall education initiative, which has been
recognised and acclaimed globally. Our achievements in the area of Minimally
Invasive Education earned us the coveted Digital Opportunity Award,
conferred by the World Information Technology Services Alliance (WITSA)
in 2008.
NIIT’s Corporate Learning Solutions business offers integrated learning solutions,
including strategic consulting, learning design, content development, delivery,
technology, assessment and learning management to Fortune 500 companies,
Universities, Technology companies, Training corporations and Publishing
houses. Element K, the spearhead of our corporate learning solutions, provides a
tailored combination of catalogue learning products, technology, and services to
customers and partners. The offerings include: vLab®: hands-on labs, instructor-
led courseware, comprehensive e-reference libraries, technical journals, and
KnowledgeHub™ , a hosted learning management platform. NIIT, together with
Element K, is now the first and the best choice for comprehensive learning
solutions, worldwide.
Abstract
Notepad is a basic text editor that can be used to create simple documents. The
most common use for Notepad is to view or edit text (.txt) files, but many users
find Notepad a simple tool for creating Web pages. It has been a quest for many
programmers to build Notepad using different programming languages. I have
built up a basic Notepad program using Java technology. This Notepad supports
basic text editing features such as cut, copy, paste, delete etc.
Objectives of the Project
The basic objective of this project is to provide its users an easy to use Notepad
application.
The Objectives can be categorized as:
Easily accessible Notepad application.
Allow easy file maintenance.
Allow easy document editing.
Requirement Analysis
Requirements analysis in systems engineering and software engineering,
encompasses those tasks that go into determining the needs or conditions to meets
for a new or altered product, taking account of the possibly conflicting
requirements of the various stakeholders, such as beneficiaries or users.
Requirements analysis is critical to the success of a development project.
Requirements must be actionable, measurable, testable, related to identified
business needs or opportunities, and defined to a level of detail sufficient for
system design.
Requirements for this application are gathered from the various sites so as to have
the idea about the type and working. Books on different websites are referred.
Need and justification
Notepad is easy to use, volatile application which can be used for preparing files
of various formats, like web pages, programs of many languages etc.
Keeping in mind the popularity of the use of Notepad for preparing almost all
The proposed application is technically feasible because the
hardware and software required to develop and implement this
application can be made available easily. It uses easy to navigate
user interface thus, this will reduce the length of the process required
to complete a request.
o Economical Feasibility
According to the economic point of view the system seems feasible
because after the one time cost of the hardware and the development
of the software, the running cost is minimal. The user just needs to
use the application as and when required.
o Operational Feasibility
The proposed application is very simple to operate. This is because
of the reason that a Notepad is very easy to learn and use, no special
training is needed to use it.
o Time and Resources
The time required to use the application is very less. And the various
resources required to develop the application were easily available.
Use Case Diagram
A use case is a methodology used in system analysis to identify, clarify, and organize system requirements. The use case is made up of a set of possible sequences of interactions between systems and users in a particular environment and related to a particular goal. It consists of a group of elements (for example, classes and interfaces) that can be used together in a way that will have an effect larger than the sum of the separate elements combined. The use case should contain all system activities that have significance to the users. A use case can be thought of as a collection of possible scenarios related to a particular goal, indeed, the use case and goal are sometimes considered to be synonymous.
A use case (or set of use cases) has these characteristics:
Organizes functional requirements Models the goals of system/actor (user) interactions Records paths (called scenarios) from trigger events to goals Describes one main flow of events (also called a basic course of action),
and possibly other ones, called exceptional flows of events (also called alternate courses of action)
Is multi-level, so that one use case can use the functionality of another one.
Use cases can be employed during several stages of software development, such as planning system requirements, validating design, testing software, and creating an outline for online help and user manuals.
File related tasks
Editing the document
FormattingUser Application
Help
<<include>>
Open, Close, Save
Copy, Cut, Paste, Delete
Font, Word Wrap
<<include>>
<<include>>
USE CASE FOR THE APPLICATION:
Flowchart
A flowchart is a common type of chart, that represents an algorithm or process, showing the steps as boxes of various kinds, and their order by connecting these with arrows. Flowcharts are used in analyzing, designing, documenting or managing a process or program in various fields.
Flow chart building blocks:
Symbols
A typical flowchart from older Computer Science textbooks may have the following kinds of symbols:
Start and end symbols Represented as lozenges, ovals or rounded rectangles, usually containing the word "Start" or "End", or another phrase signaling the start or end of a process, such as "submit enquiry" or "receive product".
Arrows Showing what's called "flow of control" in computer science. An arrow coming from one symbol and ending at another symbol represents that control passes to the symbol the arrow points to.
Processing steps Represented as rectangles. Examples: "Add 1 to X"; "replace identified part"; "save changes" or similar.
Input/Output Represented as a parallelogram. Examples: Get X from the user; display X.
Conditional or decision Represented as a diamond (rhombus). These typically contain a Yes/No question or True/False test. This symbol is unique in that it has two arrows coming out of it, usually from the bottom point and right point, one corresponding to Yes or True, and one corresponding to No or False. The arrows should always be labeled. More than two arrows can be used, but this is normally a clear indicator that a complex decision is being taken, in
which case it may need to be broken-down further, or replaced with the "pre-defined process" symbol.
A number of other symbols that have less universal currency, such as:
A Document represented as a rectangle with a wavy base; A Manual input represented by parallelogram, with the top irregularly
sloping up from left to right. An example would be to signify data-entry from a form;
A Manual operation represented by a trapezoid with the longest parallel side at the top, to represent an operation or adjustment to process that can only be made manually.
A Data File represented by a cylinder
Flowcharts may contain other symbols, such as connectors, usually represented as circles, to represent converging paths in the flow chart. Circles will have more than one arrow coming into them but only one going out. Some flow charts may just have an arrow point to another arrow instead. These are useful to represent an iterative process (what in Computer Science is called a loop). A loop may, for example, consist of a connector where control first enters, processing steps, a conditional with one arrow exiting the loop, and one going back to the connector. Off-page connectors are often used to signify a connection to a (part of another) process held on another sheet or screen. It is important to remember to keep these connections logical in order. All processes should flow from top to bottom and left to right.
else if(e.getSource()==hNotepad){JOptionPane.showMessageDialog(this,"Created by ROHIT AGGARWAL","Notepad",JOptionPane.INFORMATION_MESSAGE);}
}}
JFontChooser.java
Import java.awt.*;public class JFontChooser extends javax.swing.JDialog { public static final int RET_CANCEL = 0; public static final int RET_OK = 1; private Font font; public JFontChooser(java.awt.Frame parent, Font font) { super(parent); this.font = font; initComponents(); lblPreview.setFont(font); } public JFontChooser(java.awt.Frame parent) { super(parent); this.font = new Font("Dialog",Font.PLAIN,12); initComponents(); lblPreview.setFont(font); } public JFontChooser(Font font) { super((javax.swing.JFrame)null); this.font = font; initComponents(); lblPreview.setFont(font); } public JFontChooser() { super((javax.swing.JFrame)null); this.font = new Font("Dialog",Font.PLAIN,12); initComponents(); lblPreview.setFont(font); } public Font getFont(){ return font; }
public int getReturnStatus() { return returnStatus; } private void initComponents() { java.awt.GridBagConstraints gridBagConstraints;
mainPanel = new javax.swing.JPanel(); fontPanel = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); lstFont = new javax.swing.JList(GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames()); jScrollPane2 = new javax.swing.JScrollPane(); lstStyle = new javax.swing.JList(); jScrollPane3 = new javax.swing.JScrollPane(); lstSize = new javax.swing.JList(); previewPanel = new javax.swing.JPanel(); lblPreview = new javax.swing.JLabel(); buttonPanel = new javax.swing.JPanel(); okButton = new javax.swing.JButton(); cancelButton = new javax.swing.JButton();
The following figures show some of the snapshots of the application Start page of application
When user wishes to open a previously existing file, an open file dialog box is shown, as is shown in the following snapshot
When user needs to save his/her file, the user is shown a save file dialog box to achieve this, as shown below
The application also provides provision for document editing tasks, the possible options are shown in the following snapshot
The formatting option is also there
If user wishes to set the font of the text to be typed in the document, he/she can use the font menu item from format menu as shown in following snapshot
The help menu is used to show the information about the application as follows
As can be seen from the snapshots, this application provides its users an easy to use text editor, where the user can either open or save files and also can use editing options.
Software Testing
The software engineering process may be viewed as the spiral illustrated in Figure. Initially, system engineering defines the role of software and leads to software requirements analysis, where the information domain, function, behavior, performance, constraints, and validation criteria for software are established. Moving inward along the spiral, we come to design and finally to coding. To develop computer software, we spiral inward along streamlines that decrease the level of abstraction on each turn.
Software testing steps
Unit Testing
The module interface is tested to ensure that information properly flows into and out of the program unit under test.
Unit Test
Integration Testing
Integration testing is a systematic technique for constructing the program structure while at the same time conducting tests to uncover errors associated with interfacing. The objective is to take unit tested components and build a program structure that has been dictated by design.
Top-down Integration:
Top-down integration testing is an incremental approach to construction of program structure. Modules are integrated by moving downward through the control hierarchy, beginning with the main control module (main program). Modules subordinate (and ultimately subordinate) to the main control module are incorporated into the structure in either a depth-first or breadth-first manner.
Then, the central and right hand control paths are built. Breadth-first integration incorporates all components directly subordinate at each level, moving across the structure horizontally. From the figure, components M2, M3, and M4 (a replacement for stub S4) would be integrated first. The next control level, M5, M6, and so on, follows.
Validation Testing
At the culmination of integration testing, software is completely assembled as a package, interfacing errors have been uncovered and corrected, and a final series of software tests—validation testing—may begin.
System Testing
Testing is the last phase before the final softwareis delivered. So we need to have a perfect testing plan which can detect any type of error that may exist in the software.
Though we put our effort in detecting errors soon after they are produced by verifying them on each phases of development, however, most of these verification activities has been made in early phases of software development which is mostly based on human evaluation so it cannot guarantee that the system software do not have any errors.
Finally to rectify these errors we have made a test plan which works as follows:
Test PlanIn our test plan we divided testing on different level so that testing can be
performed from basic unit testing to final acceptance testing.
Unit Testing
1. Test Units We first try to find out or fix the units to be tested and we found that two or
more modules can be taken together and can be dealt as a single unit. For this we keep our project in mind so that testing should be performed in accordance with the requirements of the projects. As our project using developer as front-end tool we made every form and each report (among various types of reports) as basic units. For each unit, test cases have been made and their output verified. Then we came to integration of modules for integration testing.
2. Features TestedAll the functional features specified in the requirements have been tested.
3. Approach for testingWe adopted both the methods means white box testing as well as Black box
testing.In Unit Testing our main emphasis was to look for branching. If branching
is correct it will ensure that flow of control will be perfect. After branch testing, we tested units on functional level.
System testing was largely functional testing in which we had put data and checked for desired output.
4. Acceptance Testing With ModulesAnd the last phase of testing was acceptance testing in which we had put
real time data which has been collected during analysis, and tested for their performance as well as correctness.
This way, we have done rigorous testing of software which ensures that the software will be robust and reliable.
Further Enhancement
This Notepad application provides various functionalities like saving a file,
opening an existing file, and also some of the editing options.
Further enhancement of the application can contain options like file printing
option, page setup option, file compression and expansion options, which are not
included in this version of the application.
References
1. NIIT courseware
2. Head First Java, Second Edition by Kathy Sierra & Bert Bates
3. The Complete Reference, Second Edition by Thomas Powell & Fritz Schneider