home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Java 1.2 How-To
/
JavaHowTo.iso
/
3rdParty
/
Bluette
/
Plastic
/
manual
/
manual.doc
(
.txt
)
< prev
Wrap
Word Document
|
1997-07-24
|
14MB
|
1,264 lines
1. Plastic샇 볒낳
1.1 Plastic 샌뛵?
Plastic삺 내쎼쇶쟢 룰떨뢵 엸럎뷡 내쎼쇶쟢 볒쟁욮뿾뻮 낳맟삻 삧쟘벭 쟊뿤쟑
샽싷샎 룰떨뢵샇 샛뻷삻 삧쟑 떵놸 맗 좯냦삻 솦냸쟏룧, 뿏벺뗈 룰떨삺
Java뻰뻮샇 prototype삸럎 샚떿믽벺쟘 쇖듂 뇢듉삻 낡쇶냭 샖듙.
Plastic삺 뗎낡쇶 쏸룩뾡벭 낭송삻 낡쇶냭 샖듂떥, 쎹슰럎 내쎼쇶쟢 룰떨뢵샇
쏸룩뾡벭듂 믵럎뿮 뇢듉샎 Design Patterns샇 쇶뿸삻 뗩 볶 샖듙. 샌냍삺
볒쟁욮뿾뻮 룰떨뢵뾡벭 샚쇖 맟냟뗇듂 릮솦뗩삻 뇢볺쟏냭, 뛇쟑 뇗랯쟑 릮솦샇
쟘냡 맦맽뾡 듫쟑 쟙뷉삻 뇢볺쟏뾩 돵삺 냍삸럎뷡, 릮솦 쟘냡뾡 듫쟑 떿샏쟑
돫럂샇 망몹뻸샌 릮솦 쟘냡샇 좿냺뢦 뻲삻 볶 샖듂 냍샌듙. 쇯, 룰떨뢵 샛뻷뾡
샖뻮벭 룅뿬 얫 떵뿲샌 뗇뻮벭, 볒쟁욮뿾뻮 샧믧뿫벺 맗 뫼뢥 뻖쟃뢮쓉샌볇
낳맟샌 뿫샌쟏듙.
뗑슰럎듂 Java뻰뻮뿍샇 엫쟕뗈 좯냦샌듙. 뻰뻮뾡 떶뢳샻샎 볒쟁욮뿾뻮 룰떨뢵샇
샽싷낡 뎡뎪룩 욯솤 뻰뻮뢦 샌뿫쟑 놸쟶삻 쟘뻟쟑듙. 쟏쇶뢸 냡놹 룰떨뢵 좯냦삻
뚰뎪벭 샛뻷삻 쟘뻟 쟏맇럎 룅뿬 뫒웭쟑 샛뻷삻 쟏냔뗈듙. 샌냍뗩삺 엫쟕뷃쓑
쇘듙룩 룰떨뢵, 놸쟶, 볶솤 맗 몸뿏 샛뻷삻 떿샏쟑 좯냦뾡벭 쟒 볶 샖냔 뗇맇럎
웭뢮쟏냭떵 뫼뢣냔 샛뻷삻 쟒 볶 샖듙. Plastic뾡벭듂 Java Editor 맗 Java
source code generation 뇢듉삻 낮쏟냭 샖뻮벭 룰떨뢵 샛뻷 샌죄뾡
놸쟶샛뻷뾡벭떵 뢹삺 뫎뫐삻 샚떿좭쟏뾴냭, 뛇쟑 웭쇽 좯냦삻 엫쟕쟏뾩 샌랯쟑
샕송삻 뻲삻 볶 샖냔 뗇뻮샖듙.
1.2 Plastic샇 뇢듉
Plastic삺 OMT(Object Modeling Technique)샇 OMN(Object Model Notation)삻
Java뻰뻮뾡 룂냔 좮샥쟏뾴냭, 뛇쟑 닀 쟊뿤쟑 뫎뫐뢸삻 웷벷쟏뾩 Design
Patterns삻 장쟶쟒 볶 샖듂 드본쟑 쇽쟕삸럎 놸벺쟏뾴듙. (샌쟏 Modifed OMN샌뛳
쒪쟔) 뗻뛳벭 장뇢맽샇 놳산 맗 샌쟘낡 붱냔 뗇뻺듙. 뇗뢮냭 내쎼쇶쟢
볒쟁욮뿾뻮 룰떨뢵뾡 샖뻮벭 샚쇖 맟냟뗇듂 원엏뗩 쇯, Design Patterns삻
샛벺쟏냭, 믰샔쟒 볶 샖듂 뇢듉삻 낡쇼삸럎 믽믪벺 쟢믳, 샧믧뿫벺, 뫼뢥
뻖쟃뢮쓉샌볇샇 낳맟뾡 얫 떵뿲삻 쇙 볶낡 샖듙. 뛇쟑 쏖뇙 낡샥 냻놤맞냭 샖듂
내쎼쇶쟢 뻰뻮샎 Java뾡 듫쟑 prototype삻 샚떿삸럎 믽벺쟘쇖룩벭떵 쓄웄샏 맗
웭쇽뇢듉삻 솦냸쟏듂 엫쟕뗈 좯냦삻 솦냸쟏뾩 듵뿭 웭뢮쟏냔 볒쟁욮뿾뻮 낳맟삻
쟒 볶낡 샖듙.
Modified OMN
Java뻰뻮뾡벭 솦냸쟏듂 낳돤뗩 class, interface, single class inheritance,
multiple interface inheritance 뗮삻 graphical쟏냔 장쟶쟒 볶 샖떵럏 OMN삻
좮샥쟏냭, Gamma, Helm, Johnson, Vlissides샇 Design Patterns삻 장쟶쟒 볶
샖떵럏 쟏룩벭떵 쏖볒쟑샇 쇽쟕삸럎 놸벺쟏뾴듙.
뇗뢮냭 Modeling샛뻷샇 릮벭좭뢦 삧쟘벭 Diagram삻 뇺닽쟏냔 쟁뢰욮럎
쏢럂쟘쇘듙. 샌랯쟑 릮벭좭뗈 듙샌뻮뇗랥샇 냸삯뢦 쟏냔뗇룩 쟁럎솧욮
움뿸뗩낣샇 볒쟁욮뿾뻮 룰떨샇 샌쟘떵뢦 쇵쇸뷃얳 볶 샖듙.
Design Patterns
pattern샌뛵 볒쟁욮뿾뻮샇 룰떨뢵뾡벭 샚쇖 맟냟뗇듂 릮솦뗩삻 뇢볺쟏냭, 뛇쟑
뇗랯쟑 릮솦샇 solution뾡 듫쟑 쟙뷉삻 뇢볺쟘 돵삺 냍삸럎뷡, 릮솦 쟘냡뾡 듫쟑
떿샏쟑 돫럂샇 망몹뻸샌 릮솦 쟘냡샇 좿냺뢦 뻲삻 볶 샖듂 룅뿬 낭럂쟑 샥송삻
낡쇸 냍샌듙.
Plastic뾡벭듂 샌랯쟑 pattern뗩삻 믧뿫샚낡 쇷솢 뇢볺쟏뾩 샺샥쟒 볶 샖삸룧,
뛇쟑 붱냔 샚뷅샇 룰떨럎 믰샔쟒 볶낡 샖듙. 뇗뢮냭 Gamma, Helm, Johnson,
Vlissides낡 솦뻈쟑 뾩랯낡쇶샇 patterns삻 웷쟔쟏냭 샖뻮벭 벳냨샛뻷뾡 룅뿬
떵뿲삻 쇙 볶낡 샖듙. 믰샔뗈 pattern떵 Java source뢦 믽벺쟏듂떥 뾵쟢삻 쇖뇢
뚧릮뾡, pattern삻 냟냭쟏냔 뢸뗩뻮 뗎룩 샧믧뿫샌뛵 쏸룩뾡벭떵 쇁삺 냡냺뢦
뻲삻 볶 샖듙.
Supporting Java
Java샇 룰뗧 뇢듉뗩, 뾹뢦 뗩룩 final, static, abstract class, interface,
synchronized 뗮, 삻 룰뗎 장쟶쟏냭 웭쇽쟒 볶 샖삸룧 method, constructor뾡
듫쟑 쇷솢샻샎 놸쟶떵 믰샔쟒 볶낡 샖듙. 뛇쟑 package뢦 뷇쇺샻샎 룰떨뢵샇
드삧럎 낡솤쟏뇢 뚧릮뾡, 냼뢮샇 쏸룩뾡벭떵 듵 웭뢮쟏듙. (샌랯쟑 드삧낡
쇖뻮쇶쇶 뻊듂듙룩 믧뿫샚낡 싷죄뾡 쟁럎뇗랥 놸벺뾡 볕삻 뫁뻟 쟏듂 샏샌
믽뇢냔 뗈듙.) 샌랯쟑 룰떨뢵 드삧뾡 언샌욲, 샛벺샚 맗 쇖벮삻 뫙샏 볶낡 샖냭,
package뾡 쟊뿤쟑 솤몸뗩떵 웭쇽쟒 볶낡 샖듙. 뗻뛳벭 뿏샼쟑 Java
programming삻 쟏뇢삧쟑 떵놸낡 룰뗎 솦냸뗇룧 Java Editor낡 웷쟔뗇뻮 샖냭
compile and error reporting삻 쟑맸뾡 쟒 볶 샖듂 웭뢮쟔삻 낮쏟냭 샖듙.
뇗 맛샇 뇢듉
Java Editor듂 Modeling샇 냡냺럎 뫎엍 믽벺뗈 냡냺뢦 냰맙럎 맞뻆벭 웭쇽쟒 볶
샖떵럏 쟘쇖룧, 듙쇟 릮벭 웭쇽냺 JDK뿍 뾬냨쟏뾩 compile 맗 error report뢦 쟑
맸뾡 쟒 볶 샖듂 뇢듉삻 낮쏟냭 샖듙. Browser듂 웭쇽쇟샎 룰떨샇 classes,
interfaces, methods, attributes 뗮삻 Icon삸럎 샏룱뿤뾬쟏냔 몸뾩쇖룧, 쟘듧
뻆샌엛뾡 듫쟑 Java뻰뻮샇 장쟶삻 쇯뷃 몸뾩쇖듂 뇢듉삻 낡쇶냭 샖듙.
2. Object Modeling Notation
2.1 Class Notation
[pic]
class뾡 듫쟑 장뇢맽삺 쇷믧낢쟼샇 룰뻧뾡 뿀뢥싊 쟏드삸럎 뇗뢲샚뢦 뗥뢮뿮
냍샌듙. 뇗뢲샚뢦 돖삺 샌삯듂 맙럎 interface뿍샇 놸뫐 뚧릮샎떥, class낡
interface몸듙 듵 concrete쟏듙듂 냍삺 뎪언뎽 냍샌듙. 쇷믧낢쟼삺 3뫎뫐삸럎
뎪뒵뻮 샖듂떥, 낡샥 삭싊 쒭뾡듂 class샇 샌뢧삻 뇢샔쟏냭, 낡뿮떥 뫎뫐뾡듂
data field뢦 낡샥 뻆랧뫎뫐뾡듂 method뢦 뾭냅쟑듙.
data fields(C++:data members, Eiffel:attirbutes, Smalltalk: instance
variables)뫎뫐뾡듂 data type, data field name, initial value 본삸럎
장쟶쟑듙. initial value듂 냦뿬뾡 뗻뛳벭듂 믽랫뗉 볶 샖듙. 뾹뢦 쟏뎪 뗩룩,
int Color = WHITE; 샌랱뷄삸럎 장쟶쟒 볶 샖듙.
method듂 return type, method name, argument list 본삸럎 장쟶쟏듂떥, return
type샌 뻷듂 냦뿬뾡듂 믽랫쟑듙. 뢶싹낡쇶럎 argument낡 뻸삸룩 ()뢸 솸샧쟏냔
뗈듙. 욯샌쟑 냦뿬럎듂 constructor뾡 듫쟑 냍샌 샖듂떥, 샌냍삺 얬랡붺샇
샌뢧냺 떿샏쟏룧 return type샌 뻸듙.
2.2 Interface Notation
[pic]
interface듂 드본죷 뇗뢲샚 뻸듂 쇷믧낢쟼삸럎 뎪언뎻룧, class뿍 뢶싹낡쇶럎
3뫎뫐삸럎 뎪뒵듂떥 name section, constants section, operation section샌뛳
뫎뢥듙. name section뾡듂 interface샇 샌뢧삻, constants section뾡듂 뇗뢲뾡벭
몸듂 맙뿍 낰샌 얬랡붺샇 data field뿍 삯믧쟑 쟼뷄삸럎 믳볶뢦 솤샇쟑듙. 드,
믳볶듂 initial value낡 믽랫뗉 볶 뻸듙. operations section뾡벭떵 method샇
냦뿬뿍 낰삺 맦맽삸럎 장쟶쟑듙.
2.3 Inheritance Notation
[pic]
믳볓삺 샛삺 믯낢쟼샇 룰뻧삻 superclass뿍 subclasses믧샌뾡 뗎냭 믇쇓쟑
뫎뫐샌 superclass럎, 뇗랸쇶뻊삺 뫎뫐샌 subclasses럎 낡떵럏 뾬냡쟏룩 뗈듙.
뾩뇢벭 쇖룱쟒 송삺 쟏뎪샇 superclass뾡 뾩랯낳샇 subclass낡 믯낢쟼 뷉몼삻
쟏뎪 뗎냭 벭럎 낰샌 뾬냡쟒 볶 샖듙듂 냍샌듙. 샌랸냔 쟏룩 뎭샢쟔삻 쟇쟒 볶
샖냭, 몸뇢떵 붱듙.
샌랯쟑 믳볓냼냨샇 장쟶삺 interfaces믧샌뾡떵 뇗듫럎 샻뿫뗈듙. 드 classes뿍
interfaces낡 벭럎 뾬냡뗉 뚧뾡듂 class듂 interface샇 super낡 뗉 볶 뻸쇶뢸,
interface듂 class샇 super낡 뗉 볶 샖듙듂 송뾡 쇖샇쟏뇢 맙뛵듙.
2.4 Association Notation
[pic]
Association삺 뷇벱삸럎 벭럎 뾬냼쟏듂 얬랡붺뗩삻 뾬냡쟏룩 뗈듙. 드 좭믬장
쎳랳뗇뻮 샖듂 냍삺 드쇶 쟏뎪샇 내쎼뿍 뾬냼쟏듂 뛦샌냭, 쎤뿶쇸 뿸삺 뾩랯낳샇
내쎼뿍 뾬냼쟒 볶 샖듙듂 냍삻 뛦쟑듙. 뷇벱샇 낢 뎡뫎뫐뾡듂 role name삻
뇢럏쟏듂떥, 샌냍삺 뇗 내쎼낡 믳듫 내쎼뾡 듫쟘벭 뻮뚲 뾪쟒삻 쟏냔 뗇듂낡뢦
장쟶쟏냔 뗈듙.
뾹뢦 쟏뎪 뗩룩, Person삺 Company뿍 뾬냼 냼냨뢦 낡쇶듂떥, 쟏뎪샇
Company내쎼듂 쟏뎪 샌믳샇 Person 내쎼뿍 뾬냼쟒 볶 샖듙. 뇗뢮냭 Company듂
Person뾡 듫쟘벭듂 employer샌냭, Person삺 Company뾡 듫쟘벭 employee샌듙.
샌냍삻 삧 뇗뢲샇 뻆랡싊뾡 샖듂 장쟶뾡 샻뿫뷃쓑몸룩 class-1:Person, class-
2:Company, role-1:employee, role-2:employerδéí δùêδôÖ.
2.5 Aggregation Notation
[pic]
Aggregation삺 Association샇 장뇢맽냺 룅뿬 삯믧쟑떥, 드쇶 듙샌뻆룳뗥 쟼엂샇
뷉몼샌 뗩뻮낣듙듂 냍샌듙. 뇗뢲뾡벭 몸듂 냍냺 낰샌 Part뫎뫐삺 Association냺
낰샌 좭믬장샎 냦뿬 쟏뎪샇 내쎼, 쎤뿶쇸 뿸샎냦뿬, 뾩랯낳샇 내쎼뢦 샇만쟏룧,
Assemply뫎뫐뾡듂 듙샌뻆룳뗥 뷉몼삻 돖뻮쇖뻮뻟 쟑듙. 낣드쟑 뾹럎, 뾩랯낳샇
Sentence듂 쟏뎪샇 Paragraph뾡 듫쟘벭 Part샌냭 뾩랯낳샇 Paragraph듂 쟏뎪샇
Document뾡 듫쟘벭 Part낡 뗈듙.
2.6 Instantiation Notation
[pic]
송벱삸럎 뗈 좭믬장 쟼엂샇 장뇢맽삺 instance샇 믽벺삻 샇만쟑듙. 쇯, create-
class듂 instantiate-class샇 instance뢦 믽벺쟒 볶낡 샖듙듂 뛦샌듙.
DollFactory듂 Doll샇 instance뢦 믽벺쟒 볶 샖듙.
2.7 Comments
[pic]
뻮뚲 얬랡붺뾡 쇖벮삻 듞냭샚 쟒 뚧뾡듂 뿀뢥싊 쟏드뫎낡 뻠낣 솢쟴 뿃뛳낣
믧낢쟼샇 솾샌쎳랳 장쟶삻 쟏냭 뇗 뎻뫎뾡 뿸쟏듂떥럎 쇖벮삻 듞룩 뗈듙. 뇗뢮냭
뇗냍삺 쟘듧 얬랡붺뿍 송벱삸럎 뾬냡삻 쟑듙. 샌냍삺 뻮뚲 샇만뢦 낡쇶듂 냍샌
뻆듏뛳 드쇶 샌쟘뾡 떵뿲삻 쇖냅뎪 룮룮 쇟뿤쟑 믧쟗뗩삻 뇢럏쟏듂 뿫떵럎
믧뿫쟑듙.
2.8 Modeling Example
[pic]
삧 Desktop Publishing System뾡 듫쟑 Object Diagram샌듙. 샌 뾹솦듂 Object-
Oriented Modeling and Design(Prentice Hall, ISBN:0-13-629841-9)쎥샇 Page
393뾡 샖듂 뾹솦뢦 샎뿫쟑 냍샌룧 Plastic삻 샌뿫쟏뾩 웭쇽쟑 냍샌듙.
3. Plastic샇 룞뒺벳룭
3.1 Plastic샇 샼쎼좭룩 벳룭
[pic]
Plastic삩떵뿬샇 쏖믳드뾡듂 Main Menu낡 샖냭, 뇗 맙럎 뻆랡샇 뿞싊뾡 샖듂
Speed Buttons뫎뫐삺 룞샎룞뒺뾡벭 샚쇖 뺲샌듂 냍뗩삺 늨뎻뻮 뇗러좭 쟘돵삺
냍샌듙. 쎹맸슰 뇗러삺 Files뾡 냼쟑 냍, 뗎맸슰 뇗러삺 Edit뾡 냼쟑냍, 벼맸샧
뇗러삺 뇗 뿜샇 냍뗩샌듙. 뇗뢮냭 Select 맶우삺 Modeling Area뾡 샌만 웭쇽뗇뻮
샖듂 냍뗩삺 벱엃쟏냅뎪 샌떿쟏뇢 삧쟘벭듂 샌냍샌 벱엃뗇뻮 샖뻮뻟 쟑듙.
뇗뢮냭 샌 뿀뢥싊뾡 샖듂 뇗러삺 Symbol Buttons럎뷡 Main Menu샇 Symbols룞뒺뾡
룰뗎 샖듂 냍뗩샌듙. 뿞싊뾡벭 싷럊듫럎 Class, Interface, Comment,
Inheritance, Association, Aggregation, Comment Link, Instantiate, Text
뷉몼샌뛳냭 뫎뢥듙. Modeling Area듂 뢻 뇗듫럎 웭쇽뾵뾪샌냭, Status Bar뾡듂
뗎낡쇶 솤몸낡 몸샌듂떥, 쟶샧 웭쇽쇟샎 웄샏샇 샌뢧냺 룰떨샇 Title샌
뎪언뎭듙.
3.2 File Menu
웄샏뾡 냼럃뗈 룞뒺낡 룰뾩샖듂떥, New듂 쟶솦 웭쇽쇟샎 웄샏삻 득냭, 룰뗧 냍삻
쇶뿬냭 쏊뇢좭 쟑듙. Open... [Ctrl+O] 삺 샌만 솸샧쟏듂 벳냨뗈 룰떨삻
뫒랯뿂듙. 뫒랯뿃 볶 샖듂 웄샏샇 쟼뷄삺 .pla샎떥, Plastic뾡벭 샛뻷쟑
룰떨샓삻 뎪언뎽듙. Save [Ctrl+S] 듂 쟶솦 샛뻷쇟샎 룰떨삻 샺샥쟑듙. 샌냍삺
쟶솦 룰떨뾡 웄샏룭샌 뫎뾩뗇뻮 샖삻 뚧뾡뢸 샺샥삻 쟏냭, 뇗랸쒡 뻊듂 냦뿬뾡듂
Save As...룞뒺삻 뷇쟠쟑듙. Save As...듂 웄샏 샌뢧샌 뫎뾩뗇뻮 샖쇶 뻊냅뎪,
좤삺 믵럎뿮 웄샏샌뢧삸럎 샺샥쟏냭 뷍삻뚧뾡 믧뿫쟑듙. Print...듂 쇶뇝
샛뻷쇟샎 룰떨삻 쟁뢰엍럎 쏢럂뷃쓑쇘듙. Print Setup...삺 쟁뢰엍뾡 냼쟑
벳솤삻 쟏냭 뷍삻뚧 벱엃쟏룩 뗈듙. Exit 듂 Plastic삻 솾럡뷃얲듙.
3.3 Edit Menu
Cut [Ctrl+X]듂 쟶솦 룰떨 쇟뾡 벱엃뗈(벱엃뗈 뷉몼뗩삺 뫓삺믶삸럎 뎪언뎭듙.)
뷉몼뗩삻 샟뛳뎻뻮 얬뢳몸뗥럎 몹믧쟑듙. Copy [Ctrl+C]듂 벱엃뗈 뷉몼뗩삻
뇗듫럎 뗐쎼럎 얬뢳몸뗥뾡 몹믧쟑듙. Paste [Ctrl+V]듂 얬뢳몸뗥뾡 몹믧뗇뻮
샖듂 뷉몼뗩삻 쟶솦 룰떨뾡 믰샔뷃쓑 쇘듙. Delete [Del]듂 벱엃뗈 뷉몼뗩삻
믨솦쟑듙. 샌 뚧 얬뢳몸뗥뾡 몹믧쟏쇶듂 뻊듂듙. Select All듂 쟶솦 룰떨뾡
웷쟔뗇뻮 샖듂 룰뗧 뷉몼뗩삻 벱엃쟑듙. Refresh [F8]듂 쟶솦 룰떨샇 룰뗧
뷉몼뗩삻 룰뗎 쇶뿬냭 믵럎 뇗뢰듙. 샌냍삺 뻆쇖 낡닻뺿 샜믳샌 믽뇢듂 냦뿬뾡
뷇쟠쟏룩 뗈듙.
3.4 Symbols Menu
Select듂 쟶솦 룰떨뾡벭 뷉몼뗩삻 벱엃쟒 볶 샖듂 룰뗥럎 샼좯쟑듙. 뷉몼 삧뾡벭
얬뢯삻 쟏룩 룰뗧 벱엃샌 쏫볒뗈 죄뾡 얬뢯뗈 뷉몼샌 벱엃뗈듙. 샌 뚧 벱엃뗈
뷉몼삺 뫓삺 믶삸럎 뎪언뎭듙. 뇗뢮냭 욯솤 뾵뾪뻈샇 룰뗧 뷉몼삻 벱엃쟏냭샚
쟑듙룩 뗥랡뇗 뻘 뗥럓삸럎 뾵뾪삻 쇶솤쟏뾩 쇖룩 뗈듙. 뇗뢮냭 [Shift]얰뢦
뒩뢣룩벭 벱엃쟏룩, 샌샼뾡 벱엃뗇뻮 샖듂 냍뗩삻 삯쇶쟏룩벭 벱엃삻 쏟낡쟒
볶낡 샖듙.
Class듂 얬랡붺 뷉몼삻 믽벺쟏듂 룰뗥럎, Interface듂 샎엍원샌붺 뷉몼삻
믽벺쟏듂 룰뗥럎 샼좯쟏룧, Modeling Area뾡벭 뿸쟏듂 삧쒡뾡 얬뢯삻 쟏룩
믵럎뿮 뷉몼샌 믽뇢냭, Select룰뗥럎 듙뷃 샼좯샌 뗈듙. Extends . Implements
듂 믳볓냼냨뢦 뎪언뎾 볶 샖듂 룰뗥럎 맙닮듂떥, 망뗥뷃
벭뫪얬랡붺(샎엍원샌붺)뾡벭 볶웛얬랡붺(샎엍원샌붺)럎 뗥랡뇗 뻘 뗥럓삻 쟏뾩뻟
쟑듙. Association, Aggregation삺 Association Symbol, Aggregation Symbol삻
믽벺쟏듂 룰뗥럎 샼좯쟏룧, Instantiation삺 믽벺냼냨뢦 뎪언뎾 볶 샖듂 룰뗥럎
샼좯쟑듙. Comment듂 쇖벮뷉몼삻 믽벺쟒 볶 샖삸룧, Comment Link듂 쇖벮뷉몼삻
얬랡붺 뛇듂 샎엍원샌붺럎 뾬냡쟒 볶 샖듂 룰뗥럎 맙닯듙. Text듂 쟑쇙슥뢮
벳룭삻 듞 볶 샖떵럏 쟘 쇘듙.
3.5 Patterns Menu
Save As Design Pattern...
쇶뇝 웭쇽쟏냭 샖듂 룰떨샌 Pattern샌뛳룩, 샌 룞뒺뢦 벱엃쟏뾩 뇗냍삻 샧믧뿫샌
낡듉쟑 쟼엂럎 샺샥쟏뾩 쇙 볶 샖듙. 좮샥룭삺 .pat삸럎 샺샥샌 뗇듂떥, 샺샥샌
뗉 뚧뾡듂 Package뾡 냼럃뗈 솤몸뎪, Design Informations듂 룰뗎 샺샥뾡벭
솦뿜뗇냭 본볶쟏냔 룰떨뢸샌 샺샥뗈듙.
Insert Design Pattern...
Plastic뾡벭 솦냸쟏듂 Design Patterns뎪 믧뿫샚낡 샌만 솤샇쟏뾩 샺샥쟘 뗐
Patterns뢦 쟶솦 웭쇽쇟샎 룰떨뾡 믰샔쟒 볶낡 샖듙. 믰샔삻 쟏룩 듙뢥 솤몸뾡듂
샼쟴 뾵쟢삻 만쒡쇶 뻊삸룧, 드쇶 Pattern뾡 솸샧쟏듂 뷉몼뗩뢸샌 믵럓냔 쏟낡뗉
믓샌듙.
3.6 View Menu
Browser... [F5]
[pic]
Browser듂 쟶솦 룰떨뾡 샖듂 얬랡붺뿍 샎엍원샌붺뾡 냼쟑 뢮붺욮뿍 뇗냍뗩샌
낡쇶냭 샖듂 쟊뗥 맗 룞볒뗥, 믽벺샚뗩삻 욮뢮쟼엂럎 몸뾩쇖냭 샖듙. 뛇쟑 몸뇢
붱냔 뻆샌쓜 쟼엂럎 뎪언뎻냭 샖삸룧, 뻆랡뾡듂 벱엃뗈 얬랡붺, 샎엍원샌붺,
쟊뗥, 룞볒뗥 맗 믽벺샚뾡 Java뻰뻮샇 장쟶삻 뻆쇖 뫼뢣냔 몸뾩쇖냭 샖듙.
뇗뢮냭 쎢샇 얩뇢 맗 냦냨뢦 샚삯럓냔 솶샽쟒 볶 샖뻮벭 믧뿫샚낡 믧뿫쟏뇢뾡
웭쟏떵럏 쟏냭 샖듙. 쏖믳드뾡 샖듂 3낳샇 맶우삺 싷럊듫럎 Refresh, Collapse,
Expand샎떥, Refresh듂 뫪뛳뿬샺낡 뾭뢰 샌죄뾡 웭쇽뗈 뷉몼뗩삻 룰뗎 듙뷃
망뾵쟏냭 뷍삻뚧 믧뿫쟏룧, Collapse듂 쟊뗥, 룞볒뗥, 믽벺샚뾡 듫쟑 냍삻 룰뗎
볻냜벭 얬랡붺뿍 샎엍원샌붺뢸삻 몸뾩쇖룧, Expand듂 망듫럎 룰뗎듙 몸뾩쇘듙.
Package... [F6]듂 원얰쇶뾡 듫쟑 솤몸뢦 벳솤쟒 볶 샖떵럏 Package Window뢦
뾬듙. Design Information... [F7]듂 벳냨뾡 냼쟑 솤몸뢦 뇢샔쟒 볶 샖떵럏
Design Information Window뢦 뾭뻮쇘듙.
3.7 Tools Menu
Options...
뿉볇삺 Plastic뾡 듫쟑 좯냦(Environment Page)뾡 듫쟑 벳솤, 룰떨
듙샌뻮뇗랥(Diagram Page)냼쟑 벳솤 맗 JavaEditor(Editor Page)뾡 냼쟑
벳솤삸럎 쏑 3웤샌쇶럎 뎪뒵뻮 샖듙. 뾩뇢벭 벳솤뗈 낪삻 듙삽뾡 Plastic삻
뷇쟠쟒 뚧뾡 룰뗎낡 뇗듫럎 삯쇶뗈듙.
[pic]
Environment Page뢦 몸룩 Java Compiler, Java Code Generate, Browser샇
3낡쇶샇 뇗러삸럎 놸뫐샌듙. Java Compiler뾡듂 Java Compiler낡 샖듂 냦럎룭삻
벳솤쟘쇖뻮뻟 쟏듂떥, 샌냍삺 Java Editor뾡벭 Compile룞뒺삻 벱엃쟏뾴삻뚧,
믧뿫뗉 냍샌듙. 뾩뇢뾡벭듂 JDK1.1.1 샌믳 맶솯샇 javac.exe뢦 믧뿫쟒 냍삻
뇇샥쟑듙. 뇗뢮냭 Java Code Generator뇗러뾡벭 Include Implementation 쎼얩
맚붺듂 믽벺쟒 샚맙뻰뻮샇 쓚뗥뾡 놸쟶뫎뫐삻 웷쟔쟒 냍샎쇶뾡 듫쟑 뾩뫎뢦,
Include Comment듂 Comment 뷉몼뾡 샇쟑 쇖벮릮삻 웷쟔쟒 냍샎낡뾡 듫쟑 뾩뫎뢦
장뷃쟑듙. 뇗뢮냭 Indentation삻 믽벺쟒 샚맙뻰뻮 쓚뗥샇 뗩뾩뺲뇢샇 냸맩샇
낹볶뢦 벳솤쟑듙. Browser뇗러뾡듂 Browser뾡벭 샚맙뻰뻮샇 장쟶삻 몸뾩쇖듂
뫎뫐샇 웹욮 맗 믶믳삻 냡솤쟒 볶 샖떵럏 쟏뾴듙.
[pic]
Diagram Page 뾡듂 좭룩뾡 장뷃뗇듂 낢솾 뷉몼샇 웹욮 룰뻧뾡 듫쟑 냍삻 벳솤쟒
볶 샖떵럏 쟏듂 Font뇗러냺 Modeling Area샇 뾵뾪샇 얩뇢뢦 벳솤쟒 볶 샖떵럏
뗇뻮 샖듂 Size뇗러샌 샖듙. Modeling Area샇 얩뇢뢦 몯냦쟒 뚧뾡듂 쇖샇뢦
뿤쟏듂떥, 얩뇢뢦 얩냔 쟒 뚧뾡듂 몰릮솦낡 뻸삸뎪, 샛냔 쟒 뚧뾡듂 뾵뾪삻
맾뻮뎪 솢뇙쟒 볶 뻸듂 뷉몼샌 믽뇦 볶 샖삸맇럎 쇖샇쟏뇢 맙뛵듙. 뇗뢮냭
웹욮샇 룰뻧삺 쟁뢰웃쟒 뚧뾡떵 뾵쟢삻 만쒡맇럎 뾰뗎뾡 뗎냭 샖삸룩 쇁삻
냍샌듙. Editor Page뾡듂 Java Editor뾡벭 웭쇽쟏듂 뫎뫐샇 웹욮샇 룰뻧 맗
믶믳삻 솤샇쟒 볶 샖듙.
[pic]
Java Editor... [F3]듂 Java뻰뻮샇 볒붺맗 html, text 웄샏삻 웭쇽쟒 볶 샖떵럏
Java Editor뢦 뾭뻮쇘듙.
Java Code Generator... [F4]
[pic]
Java Code Generator듂 쟶솦 룰떨뾡벭 Package Member샎 얬랡붺 맗 샎엍원샌붺뾡
듫쟑 Java뻰뻮샇 볒붺쓚뗥뢦 샚떿삻 믽벺뷃쓑쇘듙. 뢸뻠 쟏뎪샇 얬랡붺 뛇듂
샎엍원샌붺샇 볒붺쓚뗥 믽벺샌 쟊뿤쟏듙룩 쟘듧 뻆샌엛삻 벱엃쟑 죄, Generate
One맶우삻 뒩뢣룩 얬랡붺 뛇듂 샎엍원샌붺샇 샌뢧냺 떿샏쟑 샚맙뻰뻮샇 볒붺낡
Generate Destination Direcroty뾡벭 벳솤뗈 뗰랺엤뢮뾡 믽벺샌뗈듙. Generate
All맶우삻 뒩뢣룩 룰뗧 얬랡붺뿍 샎엍원샌붺뾡 듫쟏뾩 쓚뗥뢦 믽벺쟏냭 Package
Name냺 떿샏쟑 샌뢧샇 샚맙뻰뻮 볒붺낡 믽벺샌 뗈듙. Generate Destination
Directory듂 쏊뇢낪삸럎 Package Path럎 벳솤샌 뗇쇶뢸 듙뢥 뗰랺엤뢮뾡 믽벺삻
뿸쟑듙룩 맙닙뻮떵 릫맦쟏듙.
3.8 Help Menu
Contents... 듂 떵뿲샌 쟊뿤쟒 뚧 벱엃쟑듙. 뇗랯룩 떵뿲뢻샇 뎻뿫샌 뎪언뎭듙.
About...듂 Plastic뾡 냼쟑 샏망샻샎 솤몸낡 뎪언뎭듙.
4. Plastic삻 샌뿫쟑 볒쟁욮뿾뻮 룰떨뢵
4.1 Class, Interface샇 장쟶
Class Inspector
Java뻰뻮뾡듂 얬랡붺뢦 뇢볺쟏듂떥 룮낡쇶 싷샌송삻 장쟶쟏뇢 삧쟘 abstract,
public낰삺 냍뗩샌 뫙삻 볶 샖듙. abstract얰 뿶뗥낡 뫙삸룩 쏟믳얬랡붺뢦
뎪언뎻룧, public샌 뫙삸룩 package 뿜뫎뾡벭떵 얬랡붺뢦 솢뇙쟒 볶 샖냔 뗈듙.
public샌 뫙쇶뻊삸룩 package낡 뗈듙. 샌냍삺 쇷솢 package뛳듂 뾹뻠뻮뢦 뫙샌쇶
뻊듂떥, 얬랡붺낡 package뎻뫎뾡벭뢸 솢뇙샌 낡듉쟏듙듂 냍삻 뛦쟑듙.
Java뾡벭듂 얬랡붺낡 쟏뎪 샌믳샇 쏟믳룞볒뗥(Abstract Method)뢦 낡쇸듙룩 뇗
얬랡붺듂 망뗥뷃 쏟믳얬랡붺낡 뗇뻮뻟 쟑듙. 샌송삻 삯샇쟏뾩뻟 쟏룧 샌냍삻
쇶얰쇶 뻊삸룩 쓄웄샏언샓뾡 뾡랯뢦 뎾 냍샌듙. 듙삽뾡 룮낡쇶 얬랡붺뾡 듫쟑
장쟶샌 샖듙.
class MyClass { ... }
abstract MyClass { ... } // 쏟믳얬랡붺
public MyClass { ... } // package뿜뫎뾡벭 솢뇙 낡듉.
public abstract MyClass { ... }
[pic]
Class Inspector듂 얬랡붺 뷉몼삻 듵뫭얬뢯쟏룩 뎪언뎭듙. 냅뇢뾡듂 뾩랯낡쇶
솤몸뢦 몸뾩쇖냭, 뛇 웭쇽쟒 볶 샖떵럏 쟘쇘듙. 뿬벱 쏖믳드뾡 얬랡붺샇 샌뢧삻
뇢샔쟏냭, 솢뇙솦쟑삺 public뛇듂 package럎 뗎듂떥, public삸럎 뗎냔뗇룩
믽벺뗈 Java볒붺뾡벭 얬랡붺낡 public샌뛳듂 뾹뻠뻮뢦 뫙샌냔 뗈듙. 뇗랸쒡
뻊삸룩 뻆릫냍떵 뫙쇶 뻊듂듙. Abstract Class뛳듂 쎼얩맚붺뾡 장뷃뢦 쟏룩
abstract뛳듂 뾹뻠뻮낡 뫙냔뗈듙. 쟑낡쇶 쇖룱쟒 냍샌 샖듂떥 뇗냍삺 Package
Member뾡 쎼얩장뷃뢦 뻸뾡 맶뢮룩 Java쓚뗥낡 믽벺뗇쇶 뻊냭, 뛇 뷉몼샌
송벱삸럎 장뷃뗇냔 뗈듙듂 송샌듙. 샌냍삺 룰떨뢵뾡 쇷솢샻삸럎 믳냼샌 뻸삸뎪,
믳볓냼냨 뛇듂 뾬냼냼냨뢦 장뷃쟏뇢 삧쟘벭뢸 쟊뿤쟑 냦뿬뾡 믧뿫쟏냔 뗈듙.
뎪룓쇶 Show Public Only뾡 쎼얩뢦 쟏룩, Fields, Methods 쇟 public샎냍뢸
좭룩뾡 장뷃쟏뾩 쇘듙.
Attributes(or Fields)뫎뫐뾡벭듂 볓벺뗩샌 뢮붺욮맚붺뾡 뎪뾭샌 뗇룧,
듵뫭얬뢯삻 쟏냔 뗇룩 Attribute Inspector삩떵뿬낡 뾭뢰듙. 뇗뢮냭 뿀뢥싊뾡
뗎낳샇 맶우샌 샖듂떥, New듂 믵럎뿮 볓벺삻 믽벺쟏냭샚 쟒 뚧, Delete듂
뢮붺욮맚붺뾡벭 벱엃뗈 볓벺삻 믨솦쟏냭샚 쟒 뚧 믧뿫쟏듂 냍샌듙.
Methods뫎뫐뾡벭떵 룞볒뗥뗩샌 뢮붺욮맚붺뾡 뎪뾭샌 뗈듙. 뿀뢥싊뾡 샖듂 4낳샇
맶우삻 벳룭쟏룩, 뿬벱 Method New듂 믵럎뿮 룞볒뗥뢦 믽벺쟒 뚧 뒩뢣룩 Method
Inspector낡 뾭뢮룩벭 믵럎뿮 Method뢦 샛벺쟒 볶낡 샖냔 뗇냭, Constructor
New듂 믵럎뿮 믽벺샚뢦 쏟낡쟏냭샚 쟒 뚧 믧뿫쟑듙. From Ancestor듂 샌
얬랡붺샇 볶웛얬랡붺 뛇듂 볶웛샎엍웤샌붺낡 샖삻냦뿬 뇗냍뗩샇 룞볒뗥쇟 쟏뎪뢦
뇗듫럎 몹믧쟘 뿃 볶 샖듂 뇢듉샌듙. 룞볒뗥뢦 override쟏듂 냦뿬 룞볒뗥샇
쟁럎엤언샔샌 샏쒡쟘뻟 쟏맇럎 샌 뇢듉삺 룅뿬 웭뢮쟏듙. Delete듂 샌만
솸샧쟏듂 룞볒뗥샇 믨솦샌듙.
Constructor샇 냦뿬, 믽벺샚샇 샌뢧삺 얬랡붺샇 샌뢧냺 떿샏쟑떥, 샌냍삺
Inspector뾡벭듂 망뾵샌 뗇쇶 뻊냭, OK맶우삻 뒩뢥 죄뫎엍 망뾵샌 뗇맇럎
쇖샇쟘뻟 쟑듙. Cancel삻 벱엃쟒 냦뿬 Attributes뿍 Methods뾡 듫쟑 쎳뢮뿜뾡듂
룰뗎 릫뷃뗈듙.
From Ancestor Dialog
[pic]
supertypes 뢮붺욮 맚붺뾡벭듂 얬랡붺낡 믳볓맞삺 룰뗧 얬랡붺 뛇듂
샎엍원샌붺낡 뎪언뎭듙. 린럐 뫎룰(Parent) 믓뢸뻆듏뛳 벱솶(Ancestor)뇮쇶
룰뗎낡 듙 뎪뿀듂떥, 뻆샌엛삻 벱엃쟏냔 뗇룩 뿀뢥싊샇 Methods뫎뫐뾡 쟘듧
뻆샌엛샇 룞볒뗥낡 룰뗎 뎪언뎻냔 뗇듂떥 샌쇟뾡 쟊뿤쟑 냍삻 벱엃쟏뾩 OK맶우삻
뒩뢣룩 뗈듙. Methods뫎뫐뾡듂 뎪언뎪듂 냍뗩삺 Constructor뢦 솦뿜쟑
Operations뿍 Methods샌듙.
Interface Inspector
샎엍원샌붺듂 뇗 뻮뚰쟑 놸쟶떵 낡쇶쇶 뻊듂듙. 샎엍원샌붺샇 Fields듂 룰뗎
static샌냭 final샌듙. 쟏쇶뢸 뇗랯쟑 뾹뻠뻮듂 뫙샌쇶 뻊듂듙. 뗻뛳벭 샌냍뗩삺
믳볶(Constant)낡 뗈듙. 뇗뢮냭 룰뗧 Method듂 쏟믳룞볒뗥샌룧, 뾪뷃
abstract뛳듂 뾹뻠뻮듂 뫙샌쇶 뻊듂듙. 샌냍삺 샼쟴 놸쟶삻 낡쇶쇶 뻊뻆뻟 쟑듙.
뾩뇢벭듂 샌냍삻 뿬뢮듂 Operation샌뛳 뫎뢣냚듙. 얬랡붺뿍 뢶싹낡쇶럎 public샌
뗇룩 원얰쇶 뿜뫎뾡벭샇 샎엍원샌붺샇 솢뇙삻 쟣뿫쟑듙. 듙삽뾡 룮낡쇶
샎엍원샌붺샇 장쟶샌샖듙.
interface MyInterface { ... }
public interface MyInterface { ... } // 원얰쇶 뿜뫎뾡벭 솢뇙낡듉.
[pic]
샎엍원샌붺 샎붺웑엍뾡벭 쏖믳드뾡듂 샎엍원샌붺샇 샌뢧삻, Access
Modifier뾡벭듂 솢뇙쟣뿫뾡 냼쟑 냍삻 벳솤쟏룧, Package Member뾡벭듂 룰떨뢵뾡
냼뷉샌 뻸듂 냍샌룩 쎼얩뢦 뻸뻖냭, 얬랡붺샇 냦뿬뿍 뢶싹낡쇶럎 쓚뗥믽벺뾡벭
솦뿜뗇룩벭, 샎엍원샌붺 뷉몼샌 송벱삸럎 장뷃뗇냔 뗈듙.
Constant 뫎뫐샇 뢮붺욮맚붺듂 믳볶뾡 듫쟑 냍삻 뾭냅쟏룧, 듵뫭얬뢯샎 냦뿬뾡
Constant Inspector뢦 뾭냭, New뿍 Delete듂 믳볶뾡 듫쟑 쏟낡뿍 믨솦쟒 뚧뾡
믧뿫쟑듙. 샌냍삺 Operation뫎뫐뾡 듫쟘벭떵 뇗듫럎 샻뿫뗈듙.
4.2 Field, Method샇 장쟶
Attribute Inspector
[pic]
Attribute Inspector낡 뾭뢮룩 믵럎뿮 볓벺삻 샛벺쟏냅뎪 샌만 샛벺뗈 볓벺삻
몯냦쟒 볶낡 샖듙. Attribute Name, Attribute Type, Initial Value듂 낢낢
볓벺샇 샌뢧, 떥샌엍 언샔, 쏊뇢낪삻 벳솤쟒 볶낡 샖듙. 뢸뻠 낢낢샇 낪삻 OS,
String, ႓Windows95႔뛳냭 쟟듙룩 믳샀쟏듂 샚맙샇 장쟶삺 String OS =
႓Windows95႔ 낡 뗉 냍샌듙. 뾩뇢뾡 static냺 final삻 벳솤쟒 볶낡 샖듂떥,
static삺 class variable삻 final삺 낪샌 듵 샌믳 맙닰 볶 뻸삸맇럎 믳볶뢦
샇만쟑듙. Attribute Type 뫎뫐샇 낡샥 뎡뾡 뫙뻮샖듂 ... 맶우삻 뒩뢣룩 언샔삻
Types Dialog뾡벭 벱엃쟒 볶 샖떵럏 쟘 쇘듙.
Access Modifier
볓벺, 룞볒뗥 뗮샇 솢뇙 몯냦샚뾡듂 package, private, protected, pulbic샇
4낡쇶낡 샖듙. package듂 뻆릫랱 뾹뻠뻮뢦 뫙샌쇶 뻊뻒삻 뚧 쟘듧 볓벺샌뎪
룞볒뗥낡 원얰쇶샇 뎻뫎뾡벭뢸 솢뇙샌 낡듉쟏듙듂 냍삻 샇만쟑듙. 뇗뢮냭
private듂 얬랡붺 뎻뫎뾡벭뢸 솢뇙샌 낡듉쟏룧, protected듂 얬랡붺샌 뎻뫎 맗
샚볕 얬랡붺뾡 샇쟘벭떵 솢뇙샌 낡듉쟏듙. public삺 얬랡붺샇 뿜뫎뾡벭떵 솢뇙샌
낡듉쟏듙듂 냍삻 샇만쟑듙.
Constant Inspector
[pic]
믳볶듂 뻏뷃샻삸럎 static샌냭 final샌듙. 뗻뛳벭 낪삻 뫼닜 볶 뻸삸룧 Initial
Value뛵뾡 낪삻 닀 돖뻮뗎뻮뻟 쟑듙. 뾹뢦 뗩룩 float Pi = 3.141592 뿍 낰샌
샛벺쟒 볶 샖듙. 믳볶샇 언샔떵 Types Dialog뾡벭 벱엃쟒 볶 샖듙. 쟑낡쇶
쇖샇쟒 송삺 낪샌 int, float 낰삺 냦뿬듂 255, 3.141592쎳랳 낪삻 뇗듫럎
돖삸룩 뗇쇶뢸 String쟼샎 냦뿬뾡듂 망뗥뷃 ႓Lee႔, ႓Kim႔ 쎳랳 샌쇟 뗻뿈장뢦
뫙뾩뻟 쟑듙.
Method Inspector
[pic]
룞볒뗥듂 듙뢥 낳돤뾡 뫱쟘 뻠낣 솻 몹샢쟏듙. Method Name, Return Type뾡듂
낢낢 룞볒뗥샇 샌뢧냺 뢮엏 낪샌 샖듂 냦뿬 뢮엏 낪샇 언샔삻 뇢샔쟑듙. 뢸뻠
낪샌 뻸듙룩 void샌듙. 뇗뢮냭 throws듂 Exception Handling뾡벭 뎪뿀듂
낳돤샎떥, 샌 룞볒뗥낡 맟믽뷃얳 볶 샖듂 Exception샇 언샔삻 뎪뾭쟑듙. 뢸뻠
쟏뎪 샌믳샇 뾹뿜언샔샌 맟믽쟒 볶 샖듙룩 ,(comma)럎 벭럎샇 언샔삻 놸뫐쟘
쇘듙.
Static Method듂 얬랡붺샇 룢맶샓삻 샇만쟑듙. 몸엫샇 냦뿬 얬랡붺샇 샎붺엏붺샇
룢룓샌쇶뢸 static샇 냦뿬뾡듂 얬랡붺샇 룢맶샌듙. Abstract Method듂
쏟믳룞볒뗥럎뷡 놸쟶삻 낡쇶쇶 뻊듂 룞볒뗥샓삻 샇만쟏룧 샌 룞볒뗥뢦 믳볓맞삺
얬랡붺 쇟 망뗥뷃 쟏뎪듂 놸쟶샌 뗇뻮뻟 쟑듙. 뇗랸쒡 뻊삸룩 쓄웄샏 언샓뾡
뾡랯뢦 맟믽뷃얳 냍샌듙. final삺 샌 룞볒뗥듂 듵 샌믳 override샌 뗉 볶 뻸삽삻
뎪언뎻룧, synchronized듂 multi thread뢦 샌뿫쟏냭샚 쟒 뚧, 룞볒뗥낡 떿뷃벺삻
낡쇸듙듂 냍삻 뎪언뎽듙.
룞볒뗥낡 쟏뎪 샌믳샇 샎샚(argument)뢦 낡쇺 냦뿬 Argument 뫎뫐샇 New맶우삻
뒩뢧삸럎뷡 믵럎뿮 샎샚뢦 쏟낡쟒 볶 샖냭, Delete맶우삸럎 샌만 솸샧쟏듂
샎샚뢦 믨솦쟒 볶 샖듙. 뇗뢮냭 Implementation뫎뫐뾡듂 룞볒뗥샇 놸쟶삻 믰샔쟒
볶낡 샖듙. 샌 뫎뫐삺 샚맙 쓚뗥 믽벺뾡벭 뇗듫럎 몹믧뗇뻮 뗩뻮낡맇럎 쇖샇쟏뾩
쓚뗹쟘뻟 쟑듙. 듙삽뾡듂 Java뻰뻮뢦 믽벺쟑 뾹샇 냱냝삻 몸뾩 쇖냭 샖듙.
protected final void method_name(int value)
throws exception1, exception2
{
implementation
...
}
Operation Inspector
[pic]
샎엍원샌붺샇 룞볒뗥듂 놸쟶삻 낡쇶쇶 뻊듂듙. 뗻뛳벭 쏟믳룞볒뗥뛳냭 몼 볶낡
샖듙. 뇗랡벭 Method Inspector뿍듂 듞뢮 놸쟶뫎뢦 낡쇶쇶 뻊듂듙. 드쇶
Operation Name, Return Type 뇗뢮냭 Arguments 뫎뫐뢸삻 낡쇸듙. 뢮엏 언샔뾡
듫쟘벭듂 Types Dialog뢦 샌뿫쟒 볶낡 샖듙. 뿀웛랹샌볇뾡 듫쟑 룮낡쇶샇 뾹낡
뻆랡뾡 샖듙.
String AsString();
void Store(Writer writer);
void Clone();
Constructor Inspector
[pic]
믽벺샚듂 샌뢧떵 뢮엏언샔떵 뻮뚲쟑 Access Modifier떵 뻸듙. 뿖도쟏룩 뇗랱
냍뗩삺 샇만낡 뻸뇢 뚧릮샌듙. 샌뢧삺 얬랡붺샇 샌뢧냺 떿샏쟘뻟 쟏냭, 뢮엏
언샔삺 뻸삸룧 Access Modifier듂 망뗥뷃 public샌뇢 뚧릮뾡 놻샌 뇢샔쟒 쟊뿤낡
샼쟴뻸듙. 쟏쇶뢸 Implementation삺 낡쇺 볶낡 샖듙.
믽벺샚듂 뾩랯낳샇 샎샚뗩삻 낡쇺 볶낡 샖듂떥, 샎샚뗩샇 언샔샌뎪, 낹볶뾡
뗻뛳벭 벭럎 듙삺 믽벺샚낡 뗈듙. 쇯, 쟏뎪샇 얬랡붺듂 뾩랯낳샇 믽벺샚뢦 낡쇺
볶 샖듙. 뇗뢮냭 믽벺샚뗩삺 믳볓뗇쇶 뻊듂듙. 믽벺샚낡 뻸듂 냦뿬 샚맙뾡벭듂
샎샚낡 뻸듂 뗰웺욮 믽벺샚뢦 샚떿삸럎 쏟낡뷃쓑쇘듙. 쟏쇶뢸 믽벺샚낡 샖듂
냦뿬뾡듂 뇗랯쟑 샏삻 쟏쇶 뻊듂듙. 뻆랡뾡 믽벺샚뾡 듫쟑 뾹낡 샖듙.
class MyClass {
int MyValue;
MyClass() {
MyValue = 500;
...
}
...
}
...
MyClass myObject = new MyClass();
Argument Inspector
[pic]
샎샚(Argument)듂 샎샚샇 샌뢧 맗 샎샚샇 언샔뢸 뇢볺쟒 볶 샖삸룩 뗈듙. 언샔삻
뇢볺쟏뇢 삧쟘 Types Dialog뢦 샌뿫쟒 볶낡 샖듙. 샚맙뾡벭듂 룞볒뗥뾡 듫쟑
룰뗧 샎샚뗩삺 Call By Value샇 뿸쒢뾡 뗻뢥듙.
Types Dialog
[pic]
Types Dialog듂 언샔샌뢧삻 뎪뾭쟏냭 샖뻮벭 샚쇖 맟믽쟏듂 샛뻷샎 언샔샇
샌뢧삻 뇢볺쟏듂떥 뢹삺 웭뢮쟔삻 솦냸쟘 쇘듙. 샌냍삺 샚맙뾡벭 솦냸쟏듂 Built-
in Type믓뢸 뻆듏뛳 뇗뗩뾡 듫쟑 Wrapper Class 맗 쟶샧샇 룰떨뾡 솸샧쟏듂
Class뎪 Interface뾡 듫쟑 샌뢧뇮쇶 웷쟔쟏냭 샖뻮벭 낣드쟏냔 언샔샇 샌뢧삻
뇢볺쟒 볶 샖떵럏 떵뿍쇘듙.
4.3 Inheritance샇 장쟶
Class Extends
[pic]
얬랡붺뢦 좮샥(extend)쟏듂 냍삺 낣드쟏듙. extends뛳듂 뾹뻠뻮 뗚뾡
볶웛얬랡붺샇 샌뢧삻 샻뻮쇖룩 뇗냍삸럎 뎡샌듙. 샌랸냔 쟏룩 볶웛얬랡붺샇 샏뫎
볓벺 맗 룞볒뗥뗩(protected, public샎 냍뗩)삻 뻆릫랱 돫럂뻸샌 믳볓맞삻 볶
샖듙. 샚맙뾡벭 얬랡붺뾡 듫쟘벭듂 볶웛얬랡붺뢦 드쇶 쟏뎪뢸 쟣뿫쟑듙. 삧샇
뇗뢲뾡 뎪언뎭 쟼엂뢦 Java뻰뻮럎 맙닙룩 뻆랡뿍 낰듙.
class subclass extends superclass { ... }
Plastic뾡벭듂 Inheritance 뷉몼삻 벱엃쟑 죄뾡 벭뫪얬랡붺뾡벭 뫎엍
볶웛얬랡붺럎 뗥랡뇗 뻘 뗥럓(Drag & Drop)삻 쟏룩 믵럎뿮 믯낢쟼 뷉몼샌
믽뇢룩벭 뾬냡샌 뗈듙. 뢸뻠 쟏뎪샇 볶웛얬랡붺뾡 뾩랯낳샇 벭뫪얬랡붺뢦
뾬냡쟏냭샚 쟑듙룩, 쏖쏊샇 벭뫪얬랡붺듂 삧뿍 낰삺 맦맽삸럎 쟏냭 뎪룓쇶
벭뫪얬랡붺뢦 뾬냡쟒 뚧뾡듂 뗥랡뇗 뻘 뗥럓뾡벭 뗥럓(Drop)쟠삧뢦 믯낢쟼 뷉몼
삧뾡듙낡 쟏룩(뢶뿬붺 맶우삻 믯낢쟼 뷉몼뾡벭 돵삸룩) 몸뇢 쇁냔 믯낢쟼 뷉몼삻
냸삯쟏룩벭 벭럎 뾬냡삻 쟒 볶낡 샖듙.
Interface Extends
[pic]
샎엍원샌붺샇 믳볓샇 장뇢맽삺 얬랡붺뿍 떿샏쟏쇶뢸 얬랡붺샇 냍냺듂 뻠낣
듙뢣듙. 샎엍원샌붺듂 볶웛샎엍원샌붺뢦 쟏뎪 샌믳삻 쟣뿫쟑듙. 샌랸냔 쟘벭
뢸뗩뻮쇸 벭뫪샎엍원샌붺듂 룰뗧 볶웛샎엍원샌붺샇 욯슡삻 린럁맞삸룧,
볶웛샎엍원샌붺뢦 뿤놸쟏듂 릮룆뾡 벭뫪샎엍원샌붺낡 듫뷅 뺲샏볶 샖듙.
(Substitutability)
interface subinterface extends superinterface1, superinterface2 {
// new properties...
}
Implements
[pic]
얬랡붺듂 쟏뎪 샌믳샇 샎엍원샌붺럎뫎엍 믳볓삻 맞삻 볶낡 샖듙. (뾪삺 뫒낡듉!)
드쇶, 볶웛샎엍원샌붺샇 뿀웛랹샌볇삻 룰뗎 놸쟶쟘뻟뢸 쟑듙. 룮낡쇶 놸쟶뗇쇶
뻊삺 냍샌 샖듙룩 뇗 얬랡붺듂 쏟믳얬랡붺(abstract class)샌뻮뻟 쟏냭 뇗
샚볕얬랡붺뾡듂 뿏샼죷 놸쟶뗇뻮뻟뢸 쟑듙. 벭뫪얬랡붺샇 샎붺엏붺(instance)듂
볶웛샎엍원샌붺 샎엍원샌붺뢦 뿤놸쟏듂 샚뢮뾡 듫뷅 믧뿫뗉 볶 샖듙.
class subclass implements superinterface1, superinterface2 {
...
// implements operations of superinterfaces.
}
4.4 Association, aggregation샇 장쟶
Association Inspector
[pic]
내쎼낣샇 뾬냼삻 장뷃쟏뇢 삧쟘벭듂 Association 뛇듂 Aggregation 뷉몼삻
벱엃쟑 죄뾡 From Class뾡벭 To Class럎 뗥랡뇗 뻘 뗥럓삻 쟏룩 믽벺뗈듙. From
Class뿍 To Class뾡 냸엫샻삸럎 뗩뻮낡 샖듂 냍삺 Role Name냺 Access
Modifier샎떥, 내쎼낡 뾬냼 쟏듂 듙뢥 내쎼뾡 듫쟘벭 뻮뚰쟑 뾪쟒삻 쟏듂쇶뾡
듫쟑 샌뢧삻 뷡 돖삺 냷샌냭, Access Modifier듂 내쎼낣샇 뾬냼샌 맛삸럎
뗥랯뎪듂 솤떵뢦 장쟶쟒 볶 샖듙.
From Class뾡벭듂 One 뛇듂 Many쇟뾡 벱엃쟒 볶낡 샖듂떥, From Class샇 내쎼낡
드쇶 쟏뎪뢸 뾬냼뾡 냼뾩쟏듂쇶 뻆듏룩 뾩랯낳낡 냼뾩쟏듂쇶뢦 뎪언뎾 볶 샖듙.
To Class뾡벭듂 뇗 뾬냼샇 쟼엂낡 Association샎쇶 뻆듏룩 Aggregation샎쇶뢦
벱엃쟏떵럏 뗇뻮샖듙. Plastic뾡벭듂 뇙못샻삸럎 Association Symbol냺
Aggregation Symbol낣샇 싷샌낡 뻸삸뎪, 믽벺쟑 쇷죄뾡 냡솤뗇듂 뾬냼샇 쟼엂낡
δôÖδóúδôÖ.
Person냺 Company뾡 듫쟑 뾬냼삻 뎪언뎻룩 From Class낡 Person샌뗇냭 To
Class낡 Company낡 뗇듂떥, Person삺 Company뾡 듫쟘벭 쟇냭뿫샎(employee)
샌맇럎 Role Name삺 employee, Company듂 Person뾡 듫쟘벭
냭뿫샎(employer)샌맇럎 Role Name삺 employer낡 뗈듙. 뛇쟑 Person삺 Company샇
Part낡 뻆듏맇럎 뾬냼샇 쟼엂듂 Association샌듙.
class Person {
Company employer;
}
class Company {
Person[] employee = new Person[]; // reference
}
4.5 Comment 뫙샌뇢
Comment Inspector
[pic]
뻮뚲 얬랡붺뎪 샎엍원샌붺뾡 쇖벮삻 뫙샌냭샚 쟑듙룩 뿬벱 Comment 뷉몼삻
벱엃쟏뾩 Comment뢦 쟏뎪 믽벺쟏냭, 뇗냍삻 엍뫭얬뢯쟏뾩 Comment Inspector뢦
뾬 듙삽뾡 벳룭삻 뷡 돖듂듙. 뇗뢮냭 Comment Link 뷉몼삻 벱엃쟏뾩
Comment럎뫎엍 쇖벮삻 뫙샏 얬랡붺뎪 샎엍원샌붺럎 뗥랡뇗 뻘 뗥럓삻 쟑듙. 뢸뻠
쇖벮삻 ႓this is a class႔뛳듂 벳룭삻 뫙뾴듙룩 뻆랡뿍 낰샌 샚맙뻰뻮낡 믽벺뗉
냍샌듙.
// this is a class
class Something { ... }
Text Inspector
[pic]
Text듂 뻮뚰쟑 샇만떵 낡쇶쇶 뻊쇶뢸 낡샥 쟊볶샻샎 냍샌뛳 쟏냚듙. 샌냍삺
벳냨뗈 놸벮놸벮뾡 벳룭삻 듞볶낡 샖듙. 샌냍삺 드쇶 쟑 쇙뢸 낡듉쟏듙.
뗇떵럏샌룩 샌냍삻 뢹샌 믧뿫쟒 냍삻 뇇샥쟑듙. 뿖도쟏룩 벳룭삻 뢹샌 듞볶럏
샌쟘쟏듂떥 떵뿲샌 뗇뇢 뚧릮샌듙. Java뻰뻮샇 믽벺뾡듂 샼쟴 뾵쟢삻 만쒡쇶
뻊듂듙.
4.6 Package 벳솤쟏뇢
Package Window
[pic]
Plastic뾡벭듂 쟏뎪샇 룰떨삺 냰 쟏뎪샇 원얰쇶뢦 샇만쟑듙. 뗻뛳벭 뾬냼벺샌
샖듂 내쎼뗩낣샇 룰샓뾡 냼뷉삻 뗐듙. 삧샇 뇗뢲뾡벭 몸뗭샌 Package
삩떵뿬뾡벭듂 원얰쇶뾡 냼쟑 솤몸뢦 뇢볺쟒 볶 샖삸룩 뇗 원얰쇶뢦 놸쟶쟏뇢
삧쟘벭 듙뢥 원얰쇶샇 볶샔(Import)삻 냼뢮쟒 볶 샖듙. 뢸뻠 쇶뇝 벳냨쟏냭 샖듂
냍샌 뇢쟏쟐뾡 냼쟑 냍샌뛳룩 뇗 원얰쇶샇 샌뢧삻 Geomatric샌뛳냭 뗑 볶낡
샖냚냭, 뛇 믽벺뗈 샚맙뻰뻮뿍 쓄웄샏뗈 얬랡붺 웄샏샌 샺샥뗉 냦럎룭삻 뇢샔쟒
볶낡 샖듙. 삧샇 뇗뢲냺 낰샌 벳솤샌 뗇뻺듙룩 믽벺뗇듂 샚맙뻰뻮샇 볒붺뾡
듙삽냺 낰샌 웷쟔뗉 냍샌듙.
package Geomatric;
import java.math.*;
import java.graphics.*
Import Window
[pic]
Import쟒 원얰쇶낡 샖듙룩 Import 삩떵뿬뢦 믧뿫쟒 볶낡 샖듙. 샌냍삺 샚맙뾡벭
뇢못샻삸럎 솦냸쟏듂 듫뫎뫐샇 원얰쇶뾡 듫쟑 뇢볺삻 웷쟔쟏냭 샖뻮, 뢹삺
냦뿬뾡 샖뻮벭 맙럎 벱엃쟏뾩 믰샔쟒 볶 샖듙. 뢸뻠 뻸듂 냦뿬뾡듂 Edit맚붺뾡
쇷솢 뇢샔쟒 볶 샖듙.
4.7 벳냨솤몸 벳솤쟏뇢
Design Information Window
[pic]
벳냨뾡 냼쟑 솤몸뗩떵 벳솤쟒 볶낡 샖듂떥, Title, Author, Comments낡
뇗냍뗩샌듙. Title뾡듂 룰떨샇 샌뢧삻, Author뾡듂 샺샚(낳맟샚)샇 샌뢧, 뇗뢮냭
Comments뛵뾡듂 듫쏦샇 벳룭샌뎪, 뇗 뿜샇 뻮뚲 냍떵 뿃 볶낡 샖듙. 샌냍삺
샚맙뻰뻮샇 믽벺뾡벭 쇖벮릮삸럎 뗩뻮낡냔 뗇듂떥, Comments뫎뫐삺 욯몰쟑
쇖벮샇 쟼엂샎 /** ... */ 삸럎 뗩뻮낡냔 뗈듙. 샌 쟼엂듂 욯솤 삯욿뢮욼뾡
샇쟘벭 샚떿삸럎 릮벭좭낡 뗉 볶 샖듂 샥송샌 샖듙. 뇗뢮냭 뢶쇶뢷뾡 몸샌듂
장쟼엂듂 룮낡쇶샇 솤몸뢦 몸뾩쇖듂떥, 얬랡붺샇 낳볶, 샎엍원샌붺샇 낳볶,
뾬냼샇 낳볶 뗮 뾩랯낡쇶샇 솤몸뢦 뎪언뎻뻮 쇘듙. 뢸뻠 삧뿍 낰샌 웭쇽뗇뻺듙룩
뻆랡뿍 낰삺 쇖벮릮샌 믰샔뗉 냍샌듙.
/*
* This program was generated by PLASTIC
*
* Author : Hong Gil-Dong
* Title : Geomatric Library Project
* Generated Date : 97-07-18
*/
...
/**
* Copyright(c) 1996. 4 ~ 1997. 7 All Rights Reserved.
* Dong-A University.
*/
5. Design Patterns
5.1 Design Patterns샇 볒낳
What Is a Design Patterns.
Design Pattern샌뛵 볒쟁욮뿾뻮샇 룰떨뢵뾡벭 샚쇖 맟냟뗇듂 릮솦뗩삻 뇢볺쟏냭,
뛇쟑 뇗랯쟑 릮솦샇 쟘냡뾡 듫쟑 쟙뷉삻 뇢볺쟘 돵삺 냍삸럎뷡, 릮솦 쟘냡뾡
듫쟑 떿샏쟑 돫럂샇 망몹뻸샌 릮솦 쟘냡샇 좿냺뢦 뻲삻 볶 샖듂 룅뿬 낭럂쟑
샥송삻 낡쇸 냍샌듙.
Design Patterns샇 솾럹듂 뢹샌 샖듂떥 얩냔 Creational Patterns, Structural
Patterns, Behavioral Patterns럎 뎪뒩냭 낢낢뾡 듫쟘벭 뾩랯낳샇 원엏샌
솸샧쟑듙. 뿬벱 Creational Patterns뾡듂 Abstract Factory, Builder, Factory
Method, Prototype, Singleton샌 샖냭, Structural Patterns뾡듂 Adapter,
Bridge, Composite, Decorator, Facade, Flyweight, Proxy낡 샖삸룧, Behavioral
Patterns뾡듂 Chain of Responsibility, Command, Interpreter, Iterator,
Mediator, Memento, Observer, State, Strategy, Template Method, Visitorδéí
샖듙.
ꇘ 뾩뇢뾡 뎪뿀듂 Design Patterns뾡 냼쟑 듫뫎뫐샇 뎻뿫삺 Design Patterns:
Elements of Reusable Object-Oriented Software (샺샚: Erich Gamma, Richard
Helm, Ralph Johnson, John Vlissides. 쏢웇믧:Addison-Wesley) 쎥삻 샎뿫쟏냅뎪
싼냭쟟삽삻 맠죹듙.
Plastic뾡벭 Design Pattern삻 샛벺쟏냭, 믰샔쟏뇢
Plastic뾡벭듂 믧뿫샚 솤샇 Pattern삻 샺샥쟏냅뎪, 샌만 솸샧쟏듂 Pattern삻
쟶샧 룰떨럎 믰샔쟒 볶 샖듂 뇢듉샌 샖듙. 믧뿫샚 솤샇 Pattern삻 믽벺쟏럁룩
듙뢥 냍삻 솦뿜쟑 본볶쟏냔 원엏뾡 듫쟑 냍뢸삻 웭쇽쟑 죄 Patterns룞뒺뾡벭
Save As Design Pattern삻 벱엃쟏뾩 샺샥쟏룩 좮샥샚낡 .pat샎 웄샏샌 믽벺뗇냔
뗈듙. 뇗뢮냭 Pattern삻 믰샔쟏냭샚 쟑듙룩 Patterns룞뒺뾡벭 Insert Design
Pattern삻 벱엃쟏뾩 웄샏룭삻 쇶솤쟘쇖룩 쟶샧 룰떨뾡 믰샔샌 뗈듙.
5.2 룮낡쇶 Design Patterns.
5.2.1 Factory Method (Class Creational)
[pic]
Factory Method 원엏삺 Virtual Constructor뛳냭떵 뻋럁솮 샖듂떥, 내쎼뢦
믽벺쟏뇢 삧쟑 샎엍원샌붺뢦 솦냸쟑듙. 쟏쇶뢸 뻮뚲 얬랡붺샇 샎붺엏붺뢦 믽벺쟒
냍샎쇶듂 샌냍샇 벭뫪얬랡붺낡 냡솤쟑듙. Factory Method듂 얬랡붺낡 샎붺엏붺샇
믽벺삻 벭뫪얬랡붺럎 만럧떵럏 쟑듙.
삧 뇗뢲뾡벭 Creator샇 FactoryMethod()듂 쏟믳룞볒뗥럎뷡 뇗냍삺 뻮뚲 냍떵
믽벺쟏쇶 뻊냭 듙뢸 뇗냍샇 벭뫪얬랡붺샎 ConcreteCreator샇 FactoryMethod()뢦
샧솤샇 쟔삸럎뷡 뻮뚲 얬랡붺샇 샎붺엏붺뢦 믽벺쟒 냍샎쇶뢦 냡솤쟑듙. 뇗냍삺
맙럎 ConcreteProduct 샇 샎붺엏붺 샌듙. 뻆랡뾡 낣드쟑 샚맙 뻰뻮럎 듫쏦샇
냱냝삻 뎪언뎻뻺냭 낣드쟑 뾹낡 샖듙.
abstract class Creator {
public abstract void FactoryMethod();
public void AnOperation() {
...
}
}
class ConcreteCreator extends Creator {
/* It Creates Instance of ConcreteProduct Class */
public void FactoryMethod() {
return new ConcreteProduct();
}
}
[pic]
5.2.2 Composite (Object Structural)
[pic]
내쎼뗩삻 뫎뫐-맗-샼쎼샇 냔쏾놸솶뢦 뎪언뎻뇢 삧쟏뾩 욮뢮놸솶럎뷡 놸벺쟑듙.
Composite듂 얬뛳샌뻰욮낡 낳낳샇 내쎼뿍 뇗 내쎼샇 솶쟕(composition)삻
뇕샏쟏냔 듙럪 볶 샖떵럏 쟘 쇘듙.
삧 뇗뢲뾡벭 Client듂 Component뢦 솢뇙쟏냭 Composite듂 Component샇
벭뫪얬랡붺샌듙. Operation삻 좣쏢쟟 뚧, 뢸뻠 뇗 내쎼낡 Left샇 샎붺엏붺뛳룩
낳몰샻샎 뻮뚲 샛뻷삻 볶쟠쟏냭, Composite샇 샎붺엏붺뛳룩 뇗냍샌 웷쟔쟏냭
샖듂 Component 내쎼뗩뾡 듫쟑 룰뗧 샛뻷삻 뇕샏쟏냔 볶쟠쟏냔 뗉 냍샌듙.
듙삽뾡 샚맙뻰뻮샇 냱냝냺 뾹솦낡 샖듙.
class Component {
public void Operation() {
...
}
}
class Leaf extends Component {
public void Operation() {
...
}
}
class Composite extends Component {
List children = new List();
public void Operation() {
// for g all in children g.Operation();
...
}
public void Add(Component AComponent) {
List.Add(AComponent);
}
public void Remove(Component AComponent) {
List.Remove(AComponent);
}
public int GetChild() {
return List.Count;
}
}
[pic]
6. Java Editor
6.1 Java Editor샇 볒낳
[pic]
Java Editor듂 Plastic뾡 웷쟔뗇뻮 샖듂 샚맙뻰뻮뢦 삧쟑 뾡뗰엍샌듙. 샌냍삺
엘붺욮 릮벭뢦 웭쇽쟒 볶 샖떵럏 냭뻈뗇뻮 샖듂떥, 좮샥샚 .java, .htm, .html,
.txt 뗮삻 뫒랯뿃 볶 샖듙. 뾩랯낳샇 릮벭뢦 쟑늨맸뾡 웭쇽쟒 볶 샖듂떥, 샌냍삺
MDI(Multiple Document Interface)뾡 뇢망쟑 맦맽샌 뻆듑 Page Tab삻 샌뿫쟑
냍샌뛳 MDI뾡 뫱쟘 릮벭샛뻷샇 샼좯샌 뫼뢣룧 뿀죷럁 듵 웭뢮쟏듙.
[pic]
뇗뢮냭 샚맙 쓄웄샏랯샇 뿉볇삻 벳솤쟏룩 맶우 쟏뎪럎 쓄웄샏삻 쟒 볶 샖삸룧,
Compile Error듂 Message Window낡 뎪언뎻뻮 쇖듂떥 뾡뗰욮 삩떵뿬 맙럎 뻆랡뾡
믽냜벭 뗰맶뇫떵 웭뢮쟏냔 쟒 볶 샖떵럏 떵뿍쇘듙.
샚맙 뾡뗰엍듂 뇢솸샇 뾡뗰엍뿍 뫱뷁쟑 룞뒺뢦 낡쇶듂떥, File, Edit, Search,
Compile, Help 솤떵샇 룞뒺뢦 낡쇶냭 샖냭, 뫼뢥 샛뻷삻 삧쟘 Speed Buttons삻
샚쇖 뺲듂 룞뒺뾡 쟒듧쟘 돵뻒듙. 붺쟇욮 맶우삺 뿞싊뾡벭 싷럊듫럎, New, Open,
Save, Print, Cut, Copy, Paste, Find, Find Next, Replace, Compile샌듙.
뇗뢮냭 웭쇽 삩떵뿬샇 엇뾡듂 웄샏샇 샌뢧샌 뎪언뎭듙. 뻆랡샇 믳엂맙뾡듂 쟶샧
웭쇽쇟샎 냷샇 Column냺 Row뢦 뎪언뎪룧, 뇗 뿀뢥싊뾡듂 몯냦샇 뾩뫎뢦
Modified뛳듂 릮샚뢦 엫쟘벭 뎪언뎻룧, 뇗 뾷뾡듂 웭쇽쇟샎 웄샏샇 뿏샼쟑
냦럎낡 뎪언뎭듙.
6.2 Java Editor 샌뿫쟏뇢
믵 릮벭뢦 믽벺쟒 뚧뾡듂 File | New 룞뒺뢦 벱엃쟏냅뎪, 붺쟇욮 맶우 쇟뾡
New뛳듂 죹욮(Hint)낡 뎪언뎪듂 맶우삻 뒩뢣룩 뗈듙. 샌 뚧 좮샥샚듂 뇢못샻삸럎
.java샌듙. 뇗뢮냭 쟏뎪 샌믳샇 릮벭낡 샌만 뾭럁샖듙룩, 뢶뿬붺샇 뿀뢥싊
맶우삻 뒭랯벭 뎪언뎭 웋뻷 룞뒺뾡 New Edit Page뢦 벱엃쟘떵 뗈듙. 릮벭뢦
뾭냭샚 쟒 뚧뾡듂 File | Open삻 벱엃쟏냅뎪 쟘듧 붺쟇욮 맶우삻 벱엃쟑듙.
뇗뢮냭 릮벭 득뇢뢦 뿸쟒뚧뾡떵 File | Close뢦 벱엃쟏냅뎪 뿀뢥싊 맶우삻 뒭랯
웋뻷룞뒺낡 뎪언뎪냔 쟑 듙삽 Close Page뢦 벱엃쟘떵 뗈듙.
웭쇽 쇟샎 샚맙 뻰뻮뢦 쓄웄샏 쟏냭샚 쟑듙룩 드쇶 [F8]삻 뒩뢣냅뎪 Compile삻
벱엃쟏룩 뗈듙. 뇗랱떥 샌랸냔 쟏뇢 샌샼뾡 Plastic샇 Option룞뒺샇 Environment
Page뾡벭 샚맙쓄웄샏랯샇 냦럎뢦 망뗥뷃 벳솤쟘쇖뻮뻟 쟑듙. 쓄웄샏샌 뎡뎵삻 뚧
뢸뻠 뾡랯낡 샖듙룩 뻆랡싊뾡 믵럎뿮 뢮붺욮맚붺낡 뎪언뎪룩벭 뫓삺 믶삸럎
뾡랯뢦 뻋럁쇙냍샌듙. 뇗랸쒡 뻊듙룩 Compile Completely뛳듂 룞뷃쇶낡 뎪뿀룩벭
쓄웄샏뾡 벺냸쟟듙듂 룞뷃쇶뢦 몸뾩쇙 냍샌듙.
뇛닃 맗 믶믳맙닙뇢삻 맙닙냭 뷍듙룩 Plastic샇 Option샇 Editor Page뾡벭
뇗냍삻 벳솤쟒 볶낡 샖듙. 뇗뢮냭 쟁뢰욮럎 쏢럂삻 뿸쟑듙룩 File | Print...뢦
벱엃쟏룩 뗈듙. 샚맙 뾡뗰엍듂 떶뢳샻샎 뻖쟃뢮쓉샌볇샌 뻆듏뇢 뚧릮뾡 뇗냍샇
얩뇢뿍 삧쒡 뇗뢮냭 뇛닃 맗 믶믳샌 룰뗎 듙삽맸 뷇쟠뚧뾡떵 삯쇶낡 뗇맇럎,
샚뷅뾡냔 웭뢮쟑 삧쒡뿍 얩뇢뢦 벳솤쟘 뗎룩 쇁듙.
7. Examples
7.1 Java Applet
[pic]
Plastic삺 샚맙샇 Applet낳맟뾡 떵뿲샌 뗉 볶 샖듂 뻖쟃뢴
엛쟃뢴(AppletTemplate.pla)뢦 솦냸쟏냭 샖듙. 샌냍삺 뻖쟃뢴뾡 냼럃뗈 얬랡붺
맗 샎엍원샌붺뿍 뇗냍샌 낡쇶냭 샖듂 룞볒뗥뗩삻 몸뾩쇖냭 샖뻮벭 뻖쟃뢴낳맟뾡
뢹삺 떵뿲삻 쇘듙. Applet, AppletContext, AppletStub, AudioClip삺
java.applet 원얰쇶뾡 웷쟔뗇뻮 샖듂 냍뗩샌듙. 뇗랡벭 Package Window뢦 뾬 죄,
Import뫎뫐삻 몸룩 java.applet.*낡 믰샔뗇뻮 샖듂 냍삻 몼 볶 샖삻 냍샌듙.
샚맙샇 뻖쟃뢴삺 Applet얬랡붺럎뫎엍 믳볓삻 맞뻆뻟 쟑듙. MyApplet뫎뫐뾡
샚뷅샌 뿸쟏듂 뻖쟃뢴삸럎 쏟낡, 좮샥쟏뇢뢸 쟏룩 뗈듙.
[pic]
뻖쟃뢴 엛쟃뢴삻 샌뿫쟏뾩 낣드쟑 뻖쟃뢴 뾹솦(AppletDemo.pla)뢦 몼 볶 샖듙.
샌냍삻 뾭룩 삧샇 뇗뢲냺 낰샌 뎪뿀듂떥, MyApplet샌 GraphicsApplet삸럎
좮샥뗇뻮 샖듂 냍삻 뻋 볶 샖듙. 샌냍삻 Java Code Generator뢦 샌뿫쟏뾩 Java
Source럎 뢸뗩냭, 쓄웄샏쟏룩 GraphicsApplet.class낡 뎪뿀듂떥 샌냍샌 맙럎
뿏벺뗈 뻖쟃뢴샌 뗈듙.
/*
* This program was generated by PLASTIC
*
* Author : Min-Kyu Lee
* Title : GraphicsApplet
* Generated Date : 97-07-22
*/
package GraphicsApplet;
import java.awt.*;
import java.applet.*;
/**
* This example is from :
*
* HOOKED ON JAVA
* Arthur van Hoff, Sami Shaio, Orca Starbuck.
* Addison-Wesley Publishing Company.
*
* An applet that draws different shapes depending
* on the configuration of the HTML tag. It
* accepts the following attributes in addition
* to the standard attributes:
*
* SHAPE - on of "Line", "Rectangle", "String" or "Image"
* COLOR - which foreground color to use.
* TEXT - If SHAPE is "String" this is the text to draw.
* IMAGE - If SHAPE is "Image" this is the image to draw.
*/
public class GraphicsApplet extends Applet {
Font appFont;
Color appColor;
String appShape;
String appText;
Image image;
public void init() {
appFont = new Font("Helvetica", Font.BOLD, 14);
String arg = getParameter("COLOR");
if (arg != null) {
appColor = colorFromString(arg, Color.red);
}
appShape = getParameter("SHAPE");
if (appShape == null) {
appShape = "Line";
}
appText = getParameter("TEXT");
if (appText == null) {
appText = "Graphics";
}
arg = getParameter("IMAGE");
if (arg != null) {
image = getImage(getDocumentBase(), arg);
}
}
public Color colorFromString(String s, Color defaultColor) {
Integer i;
try {
i = Integer.valueOf(s, 16);
return new Color(i.intValue());
} catch (NumberFormatException e) {
return defaultColor;
}
}
public void drawCenteredString(String s, Graphics g, Dimension r) {
FontMetrics fm = g.getFontMetrics(appFont);
g. drawString(s,
(r.width - fm.stringWidth(s)) / 2,
(r.height - fm.getHeight()) / 2);
}
public void paint(Graphics g) {
Dimension r = size();
g.setColor(appColor);
if (appShape.equalsIgnoreCase("line")) {
g.drawLine(0, 0, r.width, r.height);
} else if (appShape.equalsIgnoreCase("rectangle")) {
g.drawRect(0, 0, r.width - 1, r.height - 1);
} else if (appShape.equalsIgnoreCase("image")) {
g.drawImage(image, 0, 0, r.width, r.height, this);
} else if (appShape.equalsIgnoreCase("string")) {
g.setFont(appFont);
drawCenteredString(appText, g, r);
}
}
}
뿏벺뗈 뻖쟃뢴삻 몸뇢삧쟘벭듂 JDK샇 appletviewer뎪 Netscape Navigator,
Internet Explorer 낰삺 삥뫪뛳뿬샺뢦 샌뿫쟒 볶낡 샖냚듂떥, 삥뫪뛳뿬샺뾡벭 몼
볶 샖떵럏 GraphicsApplet.html샌 솦냸뗇냭 샖듙. 듙삽뾡 HTML볒붺뿍
Netscape뾡벭샇 뷇쟠냡냺 좭룩삻 몼 볶 샖듙.
<HTML>
<HEAD>
<TITLE>GraphicsApplet Demo</TITLE>
</HEAD>
<BODY>
<H1>GraphicsApplet</H1>
This Applet was generated by Plastic 1.0 for Java.<br>
Author : Min-Kyu Lee<br>
Title : GraphicsApplet<br>
Generated Date : 97-07-21<br>
<HR>
<APPLET code="GraphicsApplet.class" width=350 height=50>
<PARAM NAME="SHAPE" VALUE="Rectangle">
<PARAM NAME="COLOR" VALUE="ffffff">
</APPLET>
<BR>
<APPLET code="GraphicsApplet.class" width=350 height=50>
<PARAM NAME="SHAPE" VALUE="String">
<PARAM NAME="COLOR" VALUE="ff0000">
<PARAM NAME="TEXT" VALUE="Object-Oriented Modeling Tool - Plastic 1.0">
</APPLET>
<BR>
<APPLET code="GraphicsApplet.class" width=350 height=50>
<PARAM NAME="SHAPE" VALUE="String">
<PARAM NAME="COLOR" VALUE="0000ff">
<PARAM NAME="TEXT" VALUE="Java AppletDemo (using AppletTemplate.pla)">
</APPLET>
</BODY>
</HTML>
[pic]
7.2 Java Application
샚맙뾡벭 뻖쟃뢮쓉샌볇삻 삧쟑 뾹솦떵 솦냸뗈듙. ApplicationDemo.pla듂 Red,
Green, Blue샇 솶샽삻 엫쟏뾩 뇗냍뗩샇 솶쟕샌 뢸뗩뻮뎻듂 믶믳삻 몸뾩쇖듂
쟁럎뇗랥샌듙. 샌냍삻 뻖쟃뢴샌 뻆듏맇럎 삥뫪뛳뿬샺뎪, appletviewer뾡벭듂
뷇쟠쟘 몼 볶 뻸냭, JDK샇 java 뗮샇 쟁럎뇗랥삻 샌뿫쟘뻟 쟑듙.
[pic]
샌 뻖쟃뢮쓉샌볇삺 삩떵뿬뢦 뾭뻮뻟 쟏맇럎 Frame삸럎뫎엍 믳볓삻 맞뻒듙.
뇗뢮냭 main샌 뷇쟠뗇냔 뗈듙. handleEvent듂 믧뿫샚낡 쟒 볶 샖듂 쟠떿뾡 듫쟑
샌몥욮 쎳뢮뢦 쟏냭 샖냭, paint듂 좭룩뾡 뇗럁쇺 뚧 뫒뢮듂 룞볒뗥샌듙.
뾩뇢벭듂 룮낡쇶 쓁욮럑(Control)뗩삻 샌뿫쟏냭 샖듂떥, Panel, Label,
Scrollbar 뗮샌 뇗냍뗩샌듙. 샌냍삻 Java Code Generator뢦 샌뿫쟏뾩 샚맙
뻰뻮볒붺뢦 믽벺쟏룩 듙삽냺 낰듙.
/*
* This program was generated by PLASTIC
*
* Author : Min-Kyu Lee
* Title : RGB Color Test
* Generated Date : 97-07-22
*/
import java.awt.*;
/**
* This examples is "BLUETTE 0.62" Exmaple.
* By Hyoung-Gook Kim.
*/
public class ColorTest extends Frame {
boolean fForm_Create;
Panel Panel1;
Label Label1;
Label Label2;
Label Label3;
Label RedLabel;
Label GreenLabel;
Label BlueLabel;
Scrollbar ScrollBar1;
Scrollbar ScrollBar2;
Scrollbar ScrollBar3;
ColorTest() {
// Frame Initialization
setForeground(Color.black);
setBackground(Color.lightGray);
setFont(new Font("Dialog",Font.BOLD,12));
setTitle("ColorTest");
setLayout(null);
// Component Initialization
Panel1 = new Panel();
Panel1.setLayout(null);
Panel1.setForeground(Color.black);
Panel1.setBackground(Color.black);
Panel1.setFont(new Font("Dialog",Font.BOLD,12));
Label1 = new Label("Red :",Label.LEFT);
Label1.setFont(new Font("Dialog",Font.BOLD,12));
Label2 = new Label("Green :",Label.LEFT);
Label2.setFont(new Font("Dialog",Font.BOLD,12));
Label3 = new Label("Blue :",Label.LEFT);
Label3.setFont(new Font("Dialog",Font.BOLD,12));
RedLabel = new Label("0",Label.LEFT);
RedLabel.setFont(new Font("Dialog",Font.BOLD,12));
GreenLabel = new Label("0",Label.LEFT);
GreenLabel.setFont(new Font("Dialog",Font.BOLD,12));
BlueLabel = new Label("0",Label.LEFT);
BlueLabel.setFont(new Font("Dialog",Font.BOLD,12));
ScrollBar1 = new Scrollbar(Scrollbar.HORIZONTAL);
ScrollBar1.setValues(0,22,0,255);
ScrollBar1.setBackground(Color.lightGray);
ScrollBar2 = new Scrollbar(Scrollbar.HORIZONTAL);
ScrollBar2.setValues(0,22,0,255);
ScrollBar2.setBackground(Color.lightGray);
ScrollBar3 = new Scrollbar(Scrollbar.HORIZONTAL);
ScrollBar3.setValues(0,22,0,255);
ScrollBar3.setBackground(Color.lightGray);
// Add()s
add(ScrollBar3);
add(ScrollBar2);
add(ScrollBar1);
add(BlueLabel);
add(GreenLabel);
add(RedLabel);
add(Label3);
add(Label2);
add(Label1);
add(Panel1);
fForm_Create = true;
}
void InitialPositionSet() {
reshape(191,107,283,229);
Panel1.reshape(11,29,262,95);
Label1.reshape(26,143,48,16);
Label2.reshape(13,167,64,16);
Label3.reshape(22,192,54,16);
RedLabel.reshape(76,143,55,16);
GreenLabel.reshape(77,168,50,16);
BlueLabel.reshape(77,194,54,16);
ScrollBar1.reshape(142,141,121,16);
ScrollBar2.reshape(142,168,121,16);
ScrollBar3.reshape(142,195,121,16);
fForm_Create = false;
}
public boolean handleEvent(Event evt) {
// handleEvent()
if (evt.id == Event.WINDOW_DESTROY && evt.target == this)
ColorTest_WindowDestroy(evt.target);
else if (evt.id == Event.SCROLL_ABSOLUTE && evt.target ==
ScrollBar1)
ScrollBar1_ScrollAbsolute(evt.target,
((Scrollbar)(evt.target)).getValue());
else if (evt.id == Event.SCROLL_LINE_DOWN && evt.target ==
ScrollBar1)
ScrollBar1_ScrollAbsolute(evt.target,
((Scrollbar)(evt.target)).getValue());
else if (evt.id == Event.SCROLL_LINE_UP && evt.target ==
ScrollBar1)
ScrollBar1_ScrollAbsolute(evt.target,
((Scrollbar)(evt.target)).getValue());
else if (evt.id == Event.SCROLL_PAGE_DOWN && evt.target ==
ScrollBar1)
ScrollBar1_ScrollAbsolute(evt.target,
((Scrollbar)(evt.target)).getValue());
else if (evt.id == Event.SCROLL_PAGE_UP && evt.target ==
ScrollBar1)
ScrollBar1_ScrollAbsolute(evt.target,
((Scrollbar)(evt.target)).getValue());
else if (evt.id == Event.SCROLL_ABSOLUTE && evt.target ==
ScrollBar2)
ScrollBar2_ScrollAbsolute(evt.target,
((Scrollbar)(evt.target)).getValue());
else if (evt.id == Event.SCROLL_LINE_DOWN && evt.target ==
ScrollBar2)
ScrollBar2_ScrollAbsolute(evt.target,
((Scrollbar)(evt.target)).getValue());
else if (evt.id == Event.SCROLL_LINE_UP && evt.target ==
ScrollBar2)
ScrollBar2_ScrollAbsolute(evt.target,
((Scrollbar)(evt.target)).getValue());
else if (evt.id == Event.SCROLL_PAGE_DOWN && evt.target ==
ScrollBar2)
ScrollBar2_ScrollAbsolute(evt.target,
((Scrollbar)(evt.target)).getValue());
else if (evt.id == Event.SCROLL_PAGE_UP && evt.target ==
ScrollBar2)
ScrollBar2_ScrollAbsolute(evt.target,
((Scrollbar)(evt.target)).getValue());
else if (evt.id == Event.SCROLL_ABSOLUTE && evt.target ==
ScrollBar3)
ScrollBar3_ScrollAbsolute(evt.target,
((Scrollbar)(evt.target)).getValue());
else if (evt.id == Event.SCROLL_LINE_DOWN && evt.target ==
ScrollBar3)
ScrollBar3_ScrollAbsolute(evt.target,
((Scrollbar)(evt.target)).getValue());
else if (evt.id == Event.SCROLL_LINE_UP && evt.target ==
ScrollBar3)
ScrollBar3_ScrollAbsolute(evt.target,
((Scrollbar)(evt.target)).getValue());
else if (evt.id == Event.SCROLL_PAGE_DOWN && evt.target ==
ScrollBar3)
ScrollBar3_ScrollAbsolute(evt.target,
((Scrollbar)(evt.target)).getValue());
else if (evt.id == Event.SCROLL_PAGE_UP && evt.target ==
ScrollBar3)
ScrollBar3_ScrollAbsolute(evt.target,
((Scrollbar)(evt.target)).getValue());
return super.handleEvent(evt);
}
public void paint(Graphics g) {
if (fForm_Create) InitialPositionSet();
}
public static void main(String args[]) {
ColorTest ColorTest = new ColorTest();
ColorTest.show();
}
void ColorTest_WindowDestroy(Object target) {
System.exit(0);
}
void ScrollBar1_ScrollAbsolute(Object target, int value) {
RedLabel.setText(""+ScrollBar1.getValue());
Panel1.setBackground(new
Color(ScrollBar1.getValue(),
ScrollBar2.getValue(),
ScrollBar3.getValue()));
Panel1.repaint();
}
void ScrollBar2_ScrollAbsolute(Object target, int value) {
GreenLabel.setText(""+ScrollBar2.getValue());
Panel1.setBackground(new
Color(ScrollBar1.getValue(),
ScrollBar2.getValue(),
ScrollBar3.getValue()));
Panel1.repaint();
}
void ScrollBar3_ScrollAbsolute(Object target, int value) {
BlueLabel.setText(""+ScrollBar3.getValue());
Panel1.setBackground(new
Color(ScrollBar1.getValue(),
ScrollBar2.getValue(),
ScrollBar3.getValue()));
Panel1.repaint();
}
}
샌믳삸럎 믽벺뗈 쓚뗥뢦 Java Editor샇 Compile 뇢듉삸럎 쓄웄샏쟏룩
ColorTest.class낡 믽벺샌 뗇듂떥, 샌냍삻 JDK샇 java럎 뷇쟠쟘 몼 볶 샖듙.
(뾹, c:\jdk1.1.1\bin\java ColorTest) 뇗냍삻 뷇쟠쟏룩 듙삽 뇗뢲냺 낰샌
믵럎뿮 삩떵뿬낡 뾭뢮룩벭 뻖쟃뢮쓉샌볇샌 뷇쟠뗈듙.
[pic]
Appendix
n Plastic샌 솦냸쟏듂 쟁뢰욮뗈 Examples.
n Plastic샌 솦냸쟏듂 쟁뢰욮뗈 Design Patterns.