Date post: | 05-Jul-2018 |
Category: |
Documents |
Upload: | shubhamsaxena |
View: | 217 times |
Download: | 0 times |
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 1/109
TEXT EDITOR PLUS
Report submitted in partial fulfillment of the Requirement for the Diploma of
NATIONAL INSTITUTE OF ELECTRONICS AND INFOR ATION
TEC!NOLO"# $NIELIT%
&A LE'EL&
Submitted b() Submitted to)
DI'#A AR#A ****************
Re+ No, -./012
THE DELHI INSTITUTE OF COMPUTER SCIENCE
/3405 6est 7un8abi 9a+h5 Ne:Delhi*1;
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 2/109
CONTENTS
1. A<=no:led+ement
2. 7refa<e
3. Chapter /* Introdu<tion
odular des<ription of the 8ob
Features of Notepad
2, Chapter 1* S(stem requirements and Anal(is
Conte>t Dia+ram
Le?el*/ DFD
SRS of Notepad
3, Chapter 0* S(stem Desi+n
Desi+n of Notepad
Class dia+ram for Notepad
;, Chapter 2* S(stem De?elopment
Codin+
ain <lass for runnin+ the pro8e<t
6h( @A'A
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 3/109
Steps in Noteoad
B, Chapter 3* S(stem Testin+
Fun<tions of different menu items as stated in the s(stem
8. SOURCE CODE
9. Con<lusion
10. Future :or= and S<ope
11. Referen<es
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 4/109
ACKNOWLEGEMENT
On the ?er( outset of this report5 I :ould li=e to e>tend m(
sin<ere obli+ation to:ards all the persona+es :ho ha?e helped
me in this endea?our, I am ineffabl( indebted to
**************************** of DEL!I INSTITUTE OF CO 7UTER
SCIENCES5 7un8abi 9a+h5 for <ons<ientious +uidan<e and
en<oura+ement to a<<omplish this assi+nment,, 6ithout his
+uidan<e this pro8e<t :ould not ha?e materiali ed,
I :ould li=e to than= r, !E ES! S!AR A5 Dire<tor5
SA TRON S#STE 7?t, Ltd, for +i?in+ ne<essar( ad?i<es
and +uidan<e, I a<=no:led+e their <ontribution +ratefull(,
I also a<=no:led+e :ith deep sense of re?eren<e5 m(
+ratitude to:ards m( parents and members of famil(5 :ho
ha?e al:a(s supported me morall( as :ell as e<onomi<all(,Last but not the least5 +ratitude +oes to all of m( friends :ho
dire<tl( or indire<tl( helped me to <omplete this pro8e<t,
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 5/109
PREFACE
It +i?es me immense pleasure to present this
pro8e<t report on Notepad * a te>t editor 5 made in
Core @a?a, Notepad is a pro8e<t similar to that of
i<rosoft s notepad, In this notepad I ha?e +i?en as
man( features the user needs,
( spe<ial than=s to m( pro8e<t in<har+e5 m(
<olle+e tea<hers :ho ha?e al:a(s sho:n their faith
and <onfiden<e in me,
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 6/109
CHAPTER-1
INTRODUCTION OF
NOTEPAD
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 7/109
Notepad is a basi< 6indo:s utilit(, It is used for <reatin+
and4or editin+ unformatted te>t$,t>t% files, It has limitations5 but
it is surprisin+l( useful, Notepad strips all formattin+ from te>t
that is pasted on to it, 9oldfa<e5 itali<s all of it disappears and
(ou +et plain te>t instead, It <an be used on !T L <ode quite
ni<el(5 for e>ample, Li=e:ise5 if (ou ha?e a file of un=no:n
t(pe be<ause the e>tension has been deleted5 openin+ it in
notepad is a +ood :a( to ma=e sure that (ou do not s<re: it
up b( merel( openin+ it, That :a(5 (ou <an e>amine the
<ontents of file and possibl( fi+ure out :hat t(pe of file it
a<tuall( is, The file t(pe name <an be often found amon+st the
<ode at the be+innin+ or end of the file, This ?ersion of
notepad does not ha?e an( file si e limitation, The 6ord7ad
utilit( :as e?entuall( added to 6indo:s :ith the ad?anta+e of
ha?in+ more features and handlin+ lar+er files,
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 8/109
Notepad itself <an no: open and edit files of ?irtuall( an(
si e, If (ou :ant to ?ie: the sour<e file of an( :eb pa+e5
Internet e>plorer for e>ample :ill open notepad to sho: (ou the
sour<e, If (ou do not ha?e a te>t editor5 (ou <an use notepad
and print :hat (ou ha?e :ritten, If (ou :ant to :rite <ode for
!T L5 @A'ASCRI7T et<,5 notepad is ?er( useful, And I <ertainl(
ha?e noti<ed that :hile ta=in+ some online <ourses in other
=inds of s<ripts5 notepad is the editor of <hoi<e,
The :hole NOTE7AD is de?eloped usin+ @A'A usin+
8d= /,; and tested on 6INDO6S 75 'ISTA5 6INDO6SB
and 6INDO6S ,
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 9/109
FEATURES OF NOTEPAD
1· E?er( e?ent has Short<ut =e(s,
2· Line 6rap fun<tion,
3· Font Settin+,
4· No limit on file si e5 althou+h lar+e files ma( ta=e
time to load,
5· !T L files <an be made usin+ this te>t editor,
6· 7rintin+ fa<ilit(,
MODULAR DESCRIPTION OF THEJOB
Hardware and S !"ware Re#$%re&en"' ( 9efore startin+
an( ne: lan+ua+e :e must =no: :hat are its hard:are and
soft:are requirements, Also5 addin+ to our additional
=no:led+e5 :e :ere tau+ht about the installation pro<ess, So
this se<tion tells us about the !ard:are and Soft:are
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 10/109
requirements and installation of Core @A'A,
Hardware Re#$%re&en"'(
1· 13; 9 RA
S !"ware Re#$%re&enr'(
1· @DG /,;
O)era"%n* S+'"e& (
1· i<rosoft 6indo:s 74 'ista4 6indo:sB4 6indo:s
P,a'e' %n ",e Pr e."(
1· S(stem Requirements and Anal(sis
2· Desi+n 7hase
3· Codin+
4· Testin+
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 11/109
CHAPTER-/
S0STEM
RE IREMENTS AND
ANAL0SIS
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 12/109
C n"e2" D%a*ra&
Fi+ure*/) Conte>t Dia+ram or Le?el*. Data Flo: Dia+ram for
Notepad
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 13/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 14/109
SRS5S !"ware Re#$%re&en"' S)e.%!%.a"% n6 OF
NOTEPAD
1. In"r d$."% n1717 P$r) 'e
The Soft:are Requirements Spe<ifi<ation $SRS%
:ill pro?ide a detailed des<ription of the requirements
for the Notepad, This SRS :ill allo: for a <omplete
understandin+ of :hat is to be e>pe<ted of the
Notepad to be <onstru<ted, The <lear understandin+
of the Notepad and its fun<tionalit( :ill allo: for the
<orre<t soft:are to be de?eloped for the end user and
:ill be used for the de?elopment of the future sta+es
of the pro8e<t, This SRS :ill pro?ide the foundation
for the pro8e<t, From this SRS5 the Notepad <an be
desi+ned5 <onstru<ted5 and finall( tested,
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 15/109
This SRS :ill be used b( the soft:are en+ineers
<onstru<tin+ the Notepad and the end users, The
soft:are en+ineers :ill use the SRS to full( understand
the e>pe<tations of this Notepad to <onstru<t the
appropriate soft:are, The end users :ill be able to use
this SRS as a Htest to see if the soft:are en+ineers :ill
be <onstru<tin+ the s(stem to their e>pe<tations, If it is
not to their e>pe<tations the end users <an spe<if( ho: it
is not to their li=in+ and the soft:are en+ineers :ill
<han+e the SRS to fit the end users needs,
1.2 S. )e )
The soft:are produ<t to be produ<ed is a Notepad
:hi<h :ill be a te>t editor used for ?arious
operations, The first subs(stem is a File
s(stem used to <reate a ne: file5 edit a ne: or e>istin+
file and e>it from the te>t editor, The se<ond subs(stem is
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 16/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 17/109
s(stem
17; O3er3%ew (
The SRS is or+ani ed into t:o main se<tions, The first
is the o?erall des<ription and the se<ond is the Spe<ifi<
Requirements, The o?erall des<ription :ill des<ribe the
requirements of the ! S from a +eneral hi+h le?el
perspe<ti?e, The Spe<ifi< Requirements se<tion :ill
des<ribe in detail the requirements of the s(stem,
/7 T,e O3era44 De'.r%)"% n (
It des<ribes the +eneral fa<tors that affe<t the produ<t and
its requirements, This se<tion does not state spe<ifi<
requirements but it pro?ides a ba<=+round for those spe<ifi<
requirements and ma=es them easier to understand,
/71 Pr d$."Per')e."%3e (
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 18/109
The is an independent standJalone s(stem, It is
totall( self <ontained,
/7171 Hardware In"er!a.e'
The ! S :ill be pla<ed on 7C s throu+hout the
hostel,
/717/ S !"ware In"er!a.e'
The :hole NOTE7AD is made usin+ @A'A usin+
8d=/,;,
/7178 C &&$n%.a"% n In"er!a.e'
None
/717; Me& r+ C n'"ra%n"'
13; 9 :hi<h is required b( the 8d=,
/717< S%"e Ada)"a"% n Re#$%re&en" ,
The terminals at <lient site :ill ha?e to support the
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 19/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 20/109
1· Chan+es the font of the te>t,
2· Formattin+
3·Line :rappin+,
2.4 A''$&)"% n' and De)enden.%e'
None,
/7< A)) r"% n%n* ! re#$%re&en"'
Not required,
87 S)e.%!%. Re#$%re&en"'
This se<tion <ontains all the soft:are requirements at a le?el
of detail5 that :hen <ombined :ith the s(stem <onte>t
dia+ram5 use <ases5 and use <ase des<riptions5 is suffi<ient
to enable desi+ners to desi+n a s(stem to satisf( those
requirements5 and testers to test that the s(stem satisfies
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 21/109
those requirements,
3.1 E2"erna4 In"er!a.e'
The Notepad :ill use the standard input4 output de?i<es
for a personal <omputer, These in<lude the follo:in+ )
1· Ge(board
2· ouse
3· onitor
4· 7rinter$not mandator(%
3.2 F$n."% na4 Re#$%re&en"'
Fun<tional Requirements define the fundamental
a<tions that s(stem must perform, The fun<tional
requirements for the s(stem are di?ided into three main
<ate+ories5 student information s(stem5 room information
s(stem and billin+ se<tion, For further details5 refer to use
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 22/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 23/109
3. Se""%n*
3.1 The s(stem shall <han+e the font of the te>t to
the one spe<ified b( the user,
4. F r&a""%n*
4.1 The s(stem shall implement line :rappin+ :hen
spe<ified b( the user,
878 De'%*n C n'"ra%n"' ,
The Notepad shall be a stand*alone s(stem runnin+ in
a 6indo:s en?ironment or an( other operatin+ s(stem,
The s(stem shall be de?eloped usin+ Core @a?a,
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 24/109
CHAPTER-8
S0STEM DESIGN
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 25/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 26/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 27/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 28/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 29/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 30/109
• Ge(Listener
Ma%n .4a'' ! r r$nn%n* ",e )r e." (
<lass m(notepad
M
publi< stati< ?oid main$Strin+ s %
M
m(fr fPne: m(fr$QGani=a&s
NotepadQ% f,setSi e$2..52..%
f,set'isible$true%
f,setLo<ation$.5.%
U'a*e(
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 31/109
This <lass runs thepro8e<t and <alls the default <onstru<tor
of the &+!r <lass :hi<h is resposible for the Men$Bar and
MenI"e&' , In this <lass5 :e are definin+ thesi e of the
frame and lo<ation of the frame,
M+!r C4a''(
In the m(fr <lass5 :e ha?e implemented the interfa<es
A."% nL%'"ener and Ke+4%'"ener , These interfa<es are
resposible for the e3en" ,and4%n* in the notepad,
I ha?e +i?en short<ut =e(s to all the menu items in the notepad
li=e C"r4@N to new 5C"r4@O to O)en 5C"r4@S to Sa3e 5C"r4@F
to F n" et<,
I ha?e also +i?en the .,e.? : 2 in menu item for
L%newra))%n*7
C de ! r L%neWra))%n*(
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 32/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 33/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 34/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 35/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 36/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 37/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 38/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 39/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 40/109
Strin+ ar+sPae,+etA<tionCommand$%
if$ar+s,equals$QFontQ%%
M
font f1Pne: font$QFontQ5t/%
f1,setSi e$;..5B.%
f1,set'isible$true%
f1,setLo<ation$0..5/..%
if$ar+s,equals$QCutQ%%
M
t/,<ut$%
if$ar+s,equals$Q7asteQ%%
M
t/,paste$%
if$ar+s,equals$QCop(Q%%
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 41/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 42/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 43/109
M
Frame f/Pne: Frame$%
FileDialo+ fdPne: FileDialo+$f/5QSa?e #our
FileQ5FileDialo+,SA'E%
fd,setSi e$2..51..%
fd,set'isible$true%
this,setTitle$fd,+etFile$% Q*Gani=a&s
NotepadQ%
tr(
M
File6riter f:Pne:
File6riter$fd,+etDire<tor($%
fd,+etFile$%%
f:,:rite$t/,+etTe>t$%%
f:,<lose$%
<at<h$E><eption e%
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 44/109
M
if$ar+s,equals$QSele<t AllQ%%
M
t/,sele<tAll$%
if$ar+s,equals$Q7rintQ%%
M
ss s/ P ne: ss$%
s/,printRe<ord$t/,+etTe>t$%%
if$item/1,isSele<ted$%%
M
t/,setLine6rap$true%
else
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 45/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 46/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 47/109
@a?a pro+rammin+ lan+ua+e is unusual in that a pro+ram is both
<ompiled and interpreted, 6ith the <ompiler5 first (ou translate a
pro+ram into an intermediate lan+ua+e <alled Java bytecodes
",e )4a"! r&-%nde)enden" . de' %n"er)re"ed :+ ",e
%n"er)re"er n ",e Ja3a )4a"! r&7 The interpreter parses
and runs ea<h @a?a b(te<ode instru<tion on the <omputer,
Compilation happens 8ust on<e5 interpretation o<<urs ea<h
time the pro+ram is e>e<uted,
#ou <an thin= of @a?a b(te<odes as the ma<hine <ode
instru<tions for the Java Virtual Machine $@a?a ' %, E?er( @a?a
interpreter5 :hether it&s a de?elopment tool or a 6eb bro:ser
that <an run applets5 is an implementation of the @a?a ' ,
@a?a b(te<odes help ma=e Q:rite on<e5 run an(:hereQ
possible, #ou <an <ompile (our pro+ram into b(te<odes on an(
platform that has a @a?a <ompiler, The b(te<odes <an then be run
on an( implementation of the @a?a ' , That means that as lon+
as a <omputer has a @a?a ' 5 the same pro+ram :ritten in the
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 48/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 49/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 50/109
#ou =no: a lot about an ob8e<t b( =no:in+ its <lass, E?en
if (ou don&t =no: :hat a penn(*farthin+ is5 if I told (ou it
:as a bi<(<le5 (ou :ould =no: that it had t:o :heels5
handle bars5 and pedals,
Ob8e<t*oriented s(stems ta=e this a step further and
allo: <lasses to be defined in terms of other <lasses, For
e>ample5 mountain bi=es5 ra<in+ bi=es5 and tandems are all
=inds of bi<(<les, In ob8e<t*oriented terminolo+(5 mountain
bi=es5 ra<in+ bi=es5 and tandems are all '$:.4a''e' of the
bi<(<le <lass, Similarl(5 the bi<(<le <lass is the '$)er.4a''
of mountain bi=es5 ra<in+ bi=es5 and tandems, This
relationship is sho:n in the follo:in+ fi+ure)
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 51/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 52/109
add ?ariables and methods to the ones the( inherit from
the super<lass, Tandem bi<(<les ha?e t:o seats and t:o
sets of handle bars some mountain bi=es ha?e an e>tra
set of +ears :ith a lo:er +ear ratio,
Sub<lasses <an also 3err%de inherited methods and
pro?ide spe<iali ed implementations for those methods,
For e>ample5 if (ou had a mountain bi=e :ith an e>tra set
of +ears5 (ou :ould o?erride the Q<han+e +earsQ method
so that the rider <ould use those ne: +ears,
#ou are not limited to 8ust one la(er of inheritan<e, The
inheritan<e tree5 or <lass ,%erar.,+ 9 <an be as deep as
needed, ethods and ?ariables are inherited do:n throu+h
the le?els, In +eneral5 the farther do:n in the hierar<h( a
<lass appears5 the more spe<iali ed its beha?ior,
The Object <lass is at the top of <lass hierar<h(5 and ea<h
<lass is its des<endant $dire<tl( or indire<tl(%, A ?ariable of t(pe
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 53/109
Object <an hold a referen<e to an( ob8e<t5 su<h as an
instan<e of a <lass or an arra(, Object pro?ides beha?iors that
are required of all ob8e<ts runnin+ in the @a?a 'irtual a<hine,
For e>ample5 all <lasses inherit Object s to String method5
:hi<h returns a strin+ representation of the ob8e<t,
Inheritan<e offers the follo:in+ benefits)
1· Sub<lasses pro?ide spe<iali ed beha?iours from the
basis of <ommon elements pro?ided b( the super<lass,
Throu+h the use of inheritan<e5 pro+rammers <an reuse
the <ode in the super<lass man( times,
2· 7ro+rammers <an implement super<lasses <alled
a:'"ra." .4a''e' that define Q+eneri<Q beha?iours,
The abstra<t super<lass defines and ma( partiall(
implement the beha?iour5 but mu<h of the <lass is
undefined and unimplemented, Other pro+rammers fill
in the details :ith spe<iali ed sub<lasses,
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 54/109
17/ In"er!a.e
In En+lish5 an interfa<e is a de?i<e or a s(stem that
unrelated entities use to intera<t, A<<ordin+ to this definition5 a
remote <ontrol is an interfa<e bet:een (ou and a tele?ision set5
the En+lish lan+ua+e is an interfa<e bet:een t:o people5 and
the proto<ol of beha?iour enfor<ed in the militar( is the interfa<e
bet:een people of different ran=s, 6ithin the @a?a pro+rammin+
lan+ua+e5 an interfa<e is a de?i<e that unrelated ob8e<ts use to
intera<t :ith ea<h other, An interfa<e is probabl( most
analo+ous to a proto<ol $an a+reed on beha?iour%, In fa<t5 other
ob8e<t*oriented lan+ua+es ha?e the fun<tionalit( of interfa<es5
but the( <all their interfa<es proto<ols,
The bi<(<le <lass and its <lass hierar<h( defines :hat a
bi<(<le <an and <annot do in terms of its Qbi<(<leness,Q 9ut
bi<(<les intera<t :ith the :orld on other terms, For e>ample5 a
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 55/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 56/109
<an be implemented b( an( <lass an(:here in the <lass
hierar<h(, Interfa<es are useful for the follo:in+)
1· Capturin+ similarities amon+ unrelated <lasses
:ithout artifi<iall( for<in+ a <lass relationship,
2· De<larin+ methods that one or more <lasses are
e>pe<ted to implement,
3· Re?ealin+ an ob8e<t&s pro+rammin+ interfa<e :ithout
re?ealin+ its <lass,
1.3 O: e."
Ob8e<ts are =e( to understandin+ : e."- r%en"ed
te<hnolo+(, #ou <an loo= around (ou no: and see man(
e>amples of real*:orld ob8e<ts) (our do+5 (our des=5 (our
tele?ision set5 (our bi<(<le,
These real*:orld ob8e<ts share t:o <hara<teristi<s) The( all
ha?e state and behaviour , For e>ample5 do+s ha?e state $name5
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 57/109
<olor5 breed5 hun+r(% and beha?ior $bar=in+5 fet<hin+5 and
:a++in+ tail%, 9i<(<les ha?e state $<urrent +ear5 <urrent
pedal <aden<e5 t:o :heels5 number of +ears% and beha?ior
$bra=in+5 a<<eleratin+5 slo:in+ do:n5 <han+in+ +ears%,
Soft:are ob8e<ts are modeled after real*:orld ob8e<ts in that
the( too ha?e state and beha?ior, A soft:are ob8e<t
maintains its state in one or more 3ar%a:4e' 7 A ?ariable is an
item of data named b( an identifier, A soft:are ob8e<t
implements its beha?ior :ith &e", d' , A method is a
fun<tion $subroutine% asso<iated :ith an ob8e<t,
Definition of Ob8e<t ) An ob8e<t is a soft:are bundle of
?ariables and related methods,
#ou <an represent real*:orld ob8e<ts b( usin+ soft:are ob8e<ts,
#ou mi+ht :ant to represent real*:orld do+s as soft:are ob8e<ts
in an animation pro+ram or a real*:orld bi<(<le as soft:are
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 58/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 59/109
:orld bi<(<le :ould ha?e ?ariables that indi<ated the bi<(<le&s
<urrent state) its speed is /. mph5 its pedal <aden<e is -.
rpm5 and its <urrent +ear is the 3th +ear, These ?ariables are
formall( =no:n as %n'"an.e 3ar%a:4e' be<ause the( <ontain
the state for a parti<ular bi<(<le ob8e<t5 and in ob8e<t*oriented
terminolo+(5 a parti<ular ob8e<t is <alled an instance 7
F%*$re -=( B%.+.4e & de4ed a' a ' !"ware : e."
In addition to its ?ariables5 the soft:are bi<(<le :ould also
ha?e methods to bra=e5 <han+e the pedal <aden<e5 and <han+e
+ears, $The bi=e :ould not ha?e a method for <han+in+ the
speed of the bi<(<le5 as the bi=e&s speed is 8ust a side effe<t of
:hat +ear it&s in5 ho: fast the rider is pedallin+5 :hether the
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 60/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 61/109
a<<ess in @a?a is <o?ered in Controllin+ A<<ess to
embers of a Class,
En<apsulatin+ related ?ariables and methods into a neat
soft:are bundle is a simple (et po:erful idea that pro?ides
t:o primar( benefits to soft:are de?elopers)
1· M d$4ar%"+( The sour<e <ode for an ob8e<t <an be
:ritten and maintained independentl( of the sour<e
<ode for other ob8e<ts, Also5 an ob8e<t <an be easil(
passed around in the s(stem, #ou <an +i?e (our
bi<(<le to someone else5 and it :ill still :or=,
2· In! r&a"% n ,%d%n*( An ob8e<t has a publi< interfa<e
that other ob8e<ts <an use to <ommuni<ate :ith it, The
ob8e<t <an maintain pri?ate information and methods
that <an be <han+ed at an( time :ithout affe<tin+ the
other ob8e<ts that depend on it, #ou don&t need to
understand the +ear me<hanism on (our bi=e to use it,
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 62/109
17; C4a''
In the real :orld5 (ou often ha?e man( ob8e<ts of the same
=ind, For e>ample5 (our bi<(<le is 8ust one of man( bi<(<les in
the :orld, Usin+ ob8e<t*oriented terminolo+(5 :e sa( that (our
bi<(<le ob8e<t is an %n'"an.e of the <lass of ob8e<ts =no:n as
bi<(<les, 9i<(<les ha?e some state $<urrent +ear5 <urrent
<aden<e5 t:o :heels% and beha?iour $<han+e +ears5 bra=e% in
<ommon, !o:e?er5 ea<h bi<(<le&s state is independent of and
<an be different from that of other bi<(<les,
6hen buildin+ bi<(<les5 manufa<turers ta=e ad?anta+e of the
fa<t that bi<(<les share <hara<teristi<s5 buildin+ man( bi<(<les
from the same blueprint, It :ould be ?er( ineffi<ient to produ<e
a ne: blueprint for e?er( indi?idual bi<(<le manufa<tured,
In ob8e<t*oriented soft:are5 it&s also possible to ha?e man(
ob8e<ts of the same =ind that share <hara<teristi<s) re<tan+les5
emplo(ee re<ords5 ?ideo <lips5 and so on, Li=e the bi<(<le
manufa<turers5 (ou <an ta=e ad?anta+e of the fa<t that ob8e<ts of
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 63/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 64/109
ob8e<ts the( des<ribe) A blueprint of a bi<(<le is not a bi<(<le,
!o:e?er5 it&s a little more diffi<ult to differentiate <lasses and
ob8e<ts in soft:are, This is partiall( be<ause soft:are ob8e<ts are
merel( ele<troni< models of real*:orld ob8e<ts or abstra<t
<on<epts in the first pla<e, 9ut it&s also be<ause the term Qob8e<tQ
is sometimes used to refer to both <lasses and instan<es,
In the fi+ures5 the <lass is not shaded5 be<ause it
represents a blueprint of an ob8e<t rather than an ob8e<t
itself, In <omparison5 an ob8e<t is shaded5 indi<atin+ that
the ob8e<t e>ists and that (ou <an use it,
17< Me''a*e
A sin+le ob8e<t alone is +enerall( not ?er( useful, Instead5
an ob8e<t usuall( appears as a <omponent of a lar+er pro+ram
or appli<ation that <ontains man( other ob8e<ts, Throu+h the
intera<tion of these ob8e<ts5 pro+rammers a<hie?e hi+her*order
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 65/109
fun<tionalit( and more <omple> beha?iour, #our bi<(<le
han+in+ from a hoo= in the +ara+e is 8ust a bun<h of
titanium allo( and rubber b( itself5 the bi<(<le is in<apable
of an( a<ti?it(, The bi<(<le is useful onl( :hen another
ob8e<t $(ou% intera<ts :ith it $pedal%,
Soft:are ob8e<ts intera<t and <ommuni<ate :ith ea<h
other b( sendin+ messages to ea<h other, 6hen ob8e<t A
:ants ob8e<t 9 to perform one of 9&s methods5 ob8e<t A
sends a messa+e to ob8e<t 9
F%* ( Send%n* ! &e''a*e :e"ween : e."'
Sometimes5 the re<ei?in+ ob8e<t needs more information so that
it =no:s e>a<tl( :hat to do for e>ample5 :hen (ou :ant to
<han+e +ears on (our bi<(<le5 (ou ha?e to indi<ate :hi<h +ear
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 66/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 67/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 68/109
STEPS IN NOTEPAD
N "e)ad( T,e Te2" Ed%" r
This te>t editor is di?ided into ?arious modules, 'arious
modules are)
1· Firstl( I made the Te>tArea and enu9ars
usin+ 9orderLa(out in a @Frame,
2· Then after the abo?e module I +i?e the
enuItems to the enu9ar li=e Ne:5 Cut5 Cop(5
7aste5 7rint5 Sele<t All5 Font5 Line 6rap et<, All
this I made usin+ (fr <lass$user*defined%,
3· I also +i?e blue fore+round <olour to the @ enu,
4· After all this another module :hi<h uses
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 69/109
A<tionListener interfa<e is made, This module
:as the most important and time*ta=in+
module, In this module I define all the e?ents
:hi<h :ill ta=e pla<e on a<tion7erformed,
1· At the end I :or=ed on module named as
Settin+s and Format, In these module I ha?e
+i?en the Font settin+s and Line :rap fun<tion,
2· All the notepad :or=s on t:o frames5 one is main
frame ha?in+ Te>tArea5 se<ond one is ha?in+
font settin+s,
Apart from frame I ha?e used man( Dialo+s li=e
FileDialo+ for open and sa?e the files5 @Option7ane
for e>it messa+e :hile <losin+ the main frame,
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 70/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 71/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 72/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 73/109
Strin+ strP+etTitle$%
m(fr$Strin+ title%
M
super$title%
t/Pne: @Te>tArea$%
+etContent7ane$%,setLa(out$ne: 9orderLa(out$%%
@S<roll7ane 8s/ P ne: @S<roll7ane$%
8s/,set'ie:port'ie:$t/%
+etContent7ane$%,add$8s/5
8a?a,a:t,9orderLa(out,CENTER%
@ enu9ar mbrPne: @ enu9ar$%
set@ enu9ar$mbr%
@ enu filePne: @ enu$QFileQ% file,setFore+round$ne:
8a?a,a:t,Color$/.15 /.15 133%%
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 74/109
@ enuItem item0Pne:
@ enuItem$QNe:Q% file,add$item0%
@ enuItem item/Pne: @ enuItem$QOpenQ%
@ enuItem item1Pne: @ enuItem$QSa?eQ%
@ enuItem item/0Pne: @ enuItem$QE>itQ%
file,add$item/%
file,add$item1%
file,add$item/0%
@ enu editPne: @ enu$QEditQ%
edit,setFore+round$ne: 8a?a,a:t,Color$/.15 /.15
133%% @ enuItem item2Pne: @ enuItem$QCutQ%
edit,add$item2%
@ enuItem item3Pne: @ enuItem$Q7asteQ%
@ enuItem item;Pne: @ enuItem$QCop(Q%
@ enuItem itemBPne: @ enuItem$QSele<t AllQ%
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 75/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 76/109
mbr,add$file%
mbr,add$edit%
mbr,add$settin+s%
mbr,add$format%
item/,setA<<elerator$8a?a>,s:in+,Ge(Stro=e,+etGe(Stro=
e$8a?a,a:t,e?ent,Ge(E?ent,'G O58a?a,a:t,e?ent,InputE?
ent,CTRL ASG%%
item1,setA<<elerator$8a?a>,s:in+,Ge(Stro=e,+etGe(Stro=
e$8a?a,a:t,e?ent,Ge(E?ent,'G S58a?a,a:t,e?ent,InputE?e
nt,CTRL ASG%%
item0,setA<<elerator$8a?a>,s:in+,Ge(Stro=e,+etGe(Stro=
e$8a?a,a:t,e?ent,Ge(E?ent,'G N58a?a,a:t,e?ent,InputE?
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 77/109
ent,CTRL ASG%%
item2,setA<<elerator$8a?a>,s:in+,Ge(Stro=e,+etGe(Stro=
e$8a?a,a:t,e?ent,Ge(E?ent,'G 5
8a?a,a:t,e?ent,InputE?ent,CTRL ASG%%
item3,setA<<elerator$8a?a>,s:in+,Ge(Stro=e,+etGe(Stro=
e$8a?a,a:t,e?ent,Ge(E?ent,'G '58a?a,a:t,e?ent,InputE?
ent,CTRL ASG%%
item;,setA<<elerator$8a?a>,s:in+,Ge(Stro=e,+etGe(Stro=
e$8a?a,a:t,e?ent,Ge(E?ent,'G C58a?a,a:t,e?ent,InputE?
ent,CTRL ASG%%
itemB,setA<<elerator$8a?a>,s:in+,Ge(Stro=e,+etGe(Stro=
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 78/109
e$8a?a,a:t,e?ent,Ge(E?ent,'G A58a?a,a:t,e?ent,InputE?
ent,CTRL ASG%%
item ,setA<<elerator$8a?a>,s:in+,Ge(Stro=e,+etGe(Stro=
e$8a?a,a:t,e?ent,Ge(E?ent,'G 758a?a,a:t,e?ent,InputE?e
nt,CTRL ASG%%
item-,setA<<elerator$8a?a>,s:in+,Ge(Stro=e,+etGe(Stro=
e$8a?a,a:t,e?ent,Ge(E?ent,'G F58a?a,a:t,e?ent,InputE?e
nt,CTRL ASG%%
file,set nemoni<$&F&%
edit,set nemoni<$&E&%
settin+s,set nemoni<$&S&%
format,set nemoni<$&O&%
item/,addA<tionListener$this%
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 79/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 80/109
@Option7ane,sho: essa+eDialo+$null5Q#ou
are E>itin+Q%
S(stem,e>it$.%
4K int i
Strin+ s/ P QDo (ou 6ant to E>itQ
iP @Option7ane,sho:ConfirmDialo+$null5s/5QE>it
essa+eQ5 @Option7ane,#ES NO O7TION% if$i P/%
M
essa+e7ane,set essa+e7ane7ro?ider$Q6ant to Sa?eQ%
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 81/109
essa+e7ane pane P
essa+e7ane,+etDo<umentInstan<e$m(fr%
Result result P pane,sho:$m( essa+e%
if $result,userChose$Option,SA'E%%
M
44 sa?e our do<ument,,,
else if $result,userChose$Option,CANCEL%%
M
44 <an<el,,,
K4
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 82/109
%
publi< ?oid =e(7ressed$Ge(E?ent =e%
M
publi< ?oid =e(Released$Ge(E?ent =e%
M
publi< ?oid =e(T(ped$Ge(E?ent =e%
M
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 83/109
publi< ?oid a<tion7erformed$A<tionE?ent ae%
M
Strin+ ar+sPae,+etA<tionCommand$%
if$ar+s,equals$QFontQ%%
M
font f1Pne: font$QFontQ5t/%
f1,setSi e$;..5B.%
f1,set'isible$true%
f1,setLo<ation$0..5/..%
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 84/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 85/109
M
this,setTitle$QTe>tEditor 7lusQ%
t/,setTe>t$QQ%
t/,setFont$f%
if$ar+s,equals$QOpenQ%%
M
Frame f/Pne: Frame$%
FileDialo+ fdPne: FileDialo+$f/5QOpen #our
FileQ% fd,setSi e$1..51..%
fd,set'isible$true%
S(stem,out,println$fd,+etDire<tor($%%
S(stem,out,println$fd,+etFile$%%
tr(
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 86/109
M
t/,setTe>t$QQ%
FileReader frPne:
FileReader$fd,+etDire<tor($% fd,+etFile$%%
int i
Strin+ s/PQQ
:hile$$iPfr,read$%% P*/%
M
s/ P$$<har%i%
t/,append$s/%
fr,<lose$%
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 87/109
<at<h$E><eption e%
M
if$ar+s,equals$QSa?eQ%%
M
1/ Strin+ str/5str1
2/ if$str,equals$QTe>tEditor 7lusQ%%44 WW fla+PP.%
1/ M
Frame f/Pne: Frame$%
FileDialo+ fdPne: FileDialo+$f/5QSa?e #our
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 88/109
FileQ5FileDialo+,SA'E%
fd,setSi e$2..51..%
fd,set'isible$true%1/ str/Pfd,+etDire<tor($%
1/ str1Pfd,+etFile$%
44S(stem,out,println$fd,+etDire<tor($%%
44S(stem,out,println$fd,+etFile$%%
this,setTitle$fd,+etFile$% Q*Te>tEditor 7lusQ%
1/ fla+P/
tr(
M
File6riter f:Pne: File6riter$fd,+etDire<tor($%
fd,+etFile$%%
f:,:rite$t/,+etTe>t$%%
f:,<lose$%
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 89/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 90/109
44M
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 91/109
44
44
if$ar+s,equals$QSele<t AllQ%%
M
t/,sele<tAll$%
if$ar+s,equals$Q7rintQ%%
M
ss s/ P ne: ss$%
s/,printRe<ord$t/,+etTe>t$%%
if$item/1,isSele<ted$%%
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 92/109
M
t/,setLine6rap$true%
else
M
t/,setLine6rap$false%
if$ar+s,equals$QE>itQ%%
M
S(stem,e>it$.%
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 93/109
<lass m(notepad
M
publi< stati< ?oid main$Strin+ s %
M
m(fr fPne: m(fr$QTe>tEditor
7lusQ% f,setSi e$2..52..%
f,set'isible$true%
f,setLo<ation$.5.%
<lass font e>tends Frame implements A<tionListener
M
Choi<e </5<15<0
9utton b/5b1
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 94/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 95/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 96/109
<1,add$Q/.Q%
<1,add$Q/1Q%
<1,add$Q/2Q%
<1,add$Q/;Q%
<1,add$Q/ Q%
<1,add$Q1.Q%
<1,add$Q11Q%
<1,add$Q12Q%
<1,add$Q1 Q%
<1,add$Q01Q%
<1,add$Q0;Q%
<1,add$Q2.Q%
<1,add$Q22Q%
<1,add$Q2 Q%
<1,add$Q;.Q%
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 97/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 98/109
add6indo:Listener$ne: 6indo:Adapter$%
Mpubli< ?oid :indo:Closin+$6indo:E?ent :e%
M
set'isible$false%
%
publi< ?oid a<tion7erformed$A<tionE?ent ae%
M
Font fPnull
if$<0,+etSele<tedItem$%PPQ9oldQ%
M
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 99/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 100/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 101/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 102/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 103/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 104/109
<ur!ei+ht P font!ei+ht
if $p+ P null%
M
p+,setFont $t(pefa<e%
p+,dra:Strin+ $ne>tLine5 mar+in5
<ur!ei+ht * fontDes<ent%
:hile $ne>tLine P null%
<at<h $EOFE><eption eof%
M
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 105/109
<at<h $Thro:able t%
M
t,printSta<=Tra<e$%
p+,dispose$%
if $p8ob P null%
p8ob,end$%
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 106/109
CONCLUSION
I ha?e su<<essfull( made the te>t editor similar to
that of i<rosoft&s notepad, This notepad <an ma=e
html files also for ma=in+ :eb pa+es, I +ained a lot
of =no:led+e and ha?e learnt so man( thin+s :hile
:or=in+ on this pro8e<t,
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 107/109
FUTURE WORK AND SCOPE
9elo: are the points :hi<h I :ould li=e to au+ment in m(
<urrent te>t editor )
1· I :ould li=e to ma=e this editor more user
friendl( b( +i?in+ more features,
2· I :ould li=e to insert ne: features in this editor
li=e Status bar5 mor dialo+ bo>es et<,
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 108/109
8/15/2019 new report.rtf
http://slidepdf.com/reader/full/new-reportrtf 109/109