home *** CD-ROM | disk | FTP | other *** search
/ Sams Teach Yourself C in 21 Days (6th Edition) / STYC216E.ISO / mac / Examples / Day27 / drawing.java < prev    next >
MacBinary  |  2002-05-26  |  1.9 KB  |  [TEXT/LMAN]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Sun May 26 12:33:32 2002, modified Sun May 26 12:33:32 2002, creator 'LMAN', type ASCII, 1314 bytes "drawing.java" , at 0x5a2 286 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[LMAN]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0c 64 72 61 77 69 6e | 67 2e 6a 61 76 61 00 00 |..drawin|g.java..|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4c 4d 41 | 4e 00 00 ff ff ff ff 00 |.TEXTLMA|N.......|
|00000050| 00 00 00 00 00 05 22 00 | 00 01 1e b9 16 be dc b9 |......".|........|
|00000060| 16 be dc 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 55 16 00 00 |........|....U...|
|00000080| 69 6d 70 6f 72 74 20 6a | 61 76 61 2e 61 77 74 2e |import j|ava.awt.|
|00000090| 2a 3b 0d 0a 69 6d 70 6f | 72 74 20 6a 61 76 61 2e |*;..impo|rt java.|
|000000a0| 61 77 74 2e 67 65 6f 6d | 2e 2a 3b 0d 0a 0d 0a 70 |awt.geom|.*;....p|
|000000b0| 75 62 6c 69 63 20 63 6c | 61 73 73 20 44 72 61 77 |ublic cl|ass Draw|
|000000c0| 69 6e 67 54 65 73 74 20 | 65 78 74 65 6e 64 73 20 |ingTest |extends |
|000000d0| 46 72 61 6d 65 20 7b 0d | 0a 20 20 20 20 53 68 61 |Frame {.|. Sha|
|000000e0| 70 65 20 73 68 61 70 65 | 73 5b 5d 20 3d 20 6e 65 |pe shape|s[] = ne|
|000000f0| 77 20 53 68 61 70 65 5b | 34 5d 3b 0d 0a 20 20 20 |w Shape[|4];.. |
|00000100| 20 70 75 62 6c 69 63 20 | 44 72 61 77 69 6e 67 54 | public |DrawingT|
|00000110| 65 73 74 20 28 53 74 72 | 69 6e 67 20 74 69 74 6c |est (Str|ing titl|
|00000120| 65 29 20 7b 0d 0a 20 20 | 20 20 20 20 73 75 70 65 |e) {.. | supe|
|00000130| 72 28 74 69 74 6c 65 29 | 3b 0d 0a 20 20 20 20 20 |r(title)|;.. |
|00000140| 20 73 65 74 53 69 7a 65 | 28 35 30 30 2c 20 34 30 | setSize|(500, 40|
|00000150| 30 29 3b 0d 0a 20 20 20 | 20 20 20 64 72 61 77 53 |0);.. | drawS|
|00000160| 68 61 70 65 73 28 29 3b | 0d 0a 20 20 20 20 20 20 |hapes();|.. |
|00000170| 61 64 64 28 22 43 65 6e | 74 65 72 22 2c 20 6e 65 |add("Cen|ter", ne|
|00000180| 77 20 4d 79 43 61 6e 76 | 61 73 28 29 29 3b 0d 0a |w MyCanv|as());..|
|00000190| 20 20 20 20 7d 0d 0a 20 | 20 20 20 70 75 62 6c 69 | }.. | publi|
|000001a0| 63 20 73 74 61 74 69 63 | 20 76 6f 69 64 20 6d 61 |c static| void ma|
|000001b0| 69 6e 28 53 74 72 69 6e | 67 20 61 72 67 73 5b 5d |in(Strin|g args[]|
|000001c0| 29 20 7b 0d 0a 20 20 20 | 20 20 20 44 72 61 77 69 |) {.. | Drawi|
|000001d0| 6e 67 54 65 73 74 20 61 | 70 70 20 3d 20 6e 65 77 |ngTest a|pp = new|
|000001e0| 20 44 72 61 77 69 6e 67 | 54 65 73 74 28 22 44 72 | Drawing|Test("Dr|
|000001f0| 61 77 69 6e 67 20 74 65 | 73 74 22 29 3b 0d 0a 20 |awing te|st");.. |
|00000200| 20 20 20 20 20 61 70 70 | 2e 73 68 6f 77 28 29 3b | app|.show();|
|00000210| 0d 0a 20 20 20 20 7d 0d | 0a 20 20 20 20 76 6f 69 |.. }.|. voi|
|00000220| 64 20 64 72 61 77 53 68 | 61 70 65 73 20 28 29 20 |d drawSh|apes () |
|00000230| 7b 0d 0a 20 20 20 20 20 | 20 73 68 61 70 65 73 5b |{.. | shapes[|
|00000240| 30 5d 20 3d 20 6e 65 77 | 20 52 65 63 74 61 6e 67 |0] = new| Rectang|
|00000250| 6c 65 32 44 2e 44 6f 75 | 62 6c 65 28 31 32 2e 30 |le2D.Dou|ble(12.0|
|00000260| 2c 31 32 2e 30 2c 20 39 | 38 2e 30 2c 20 31 32 30 |,12.0, 9|8.0, 120|
|00000270| 2e 30 29 3b 0d 0a 20 20 | 20 20 20 20 73 68 61 70 |.0);.. | shap|
|00000280| 65 73 5b 31 5d 20 3d 20 | 6e 65 77 20 45 6c 6c 69 |es[1] = |new Elli|
|00000290| 70 73 65 32 44 2e 44 6f | 75 62 6c 65 28 31 35 30 |pse2D.Do|uble(150|
|000002a0| 2e 30 2c 20 31 35 30 2e | 30 2c 39 30 2e 30 2c 33 |.0, 150.|0,90.0,3|
|000002b0| 30 2e 30 29 3b 0d 0a 20 | 20 20 20 20 20 73 68 61 |0.0);.. | sha|
|000002c0| 70 65 73 5b 32 5d 20 3d | 20 6e 65 77 20 52 6f 75 |pes[2] =| new Rou|
|000002d0| 6e 64 52 65 63 74 61 6e | 67 6c 65 32 44 2e 44 6f |ndRectan|gle2D.Do|
|000002e0| 75 62 6c 65 28 32 30 30 | 2e 30 2c 20 32 35 2c 20 |uble(200|.0, 25, |
|000002f0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|00000300| 20 20 20 20 32 33 35 2e | 30 2c 20 32 35 30 2e 30 | 235.|0, 250.0|
|00000310| 2c 20 35 30 2e 30 2c 20 | 31 30 30 2e 30 29 3b 0d |, 50.0, |100.0);.|
|00000320| 0a 20 20 20 20 20 20 47 | 65 6e 65 72 61 6c 50 61 |. G|eneralPa|
|00000330| 74 68 20 70 61 74 68 20 | 3d 20 6e 65 77 20 47 65 |th path |= new Ge|
|00000340| 6e 65 72 61 6c 50 61 74 | 68 28 6e 65 77 20 4c 69 |neralPat|h(new Li|
|00000350| 6e 65 32 44 2e 44 6f 75 | 62 6c 65 28 31 30 30 2e |ne2D.Dou|ble(100.|
|00000360| 30 2c 20 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |0, .. | |
|00000370| 20 20 20 20 20 20 20 33 | 35 30 2e 30 2c 20 31 35 | 3|50.0, 15|
|00000380| 30 2e 30 2c 20 33 30 30 | 2e 30 29 29 3b 0d 0a 20 |0.0, 300|.0));.. |
|00000390| 20 20 20 20 20 70 61 74 | 68 2e 61 70 70 65 6e 64 | pat|h.append|
|000003a0| 28 6e 65 77 20 4c 69 6e | 65 32 44 2e 44 6f 75 62 |(new Lin|e2D.Doub|
|000003b0| 6c 65 28 31 35 30 2e 30 | 2c 20 33 30 30 2e 30 2c |le(150.0|, 300.0,|
|000003c0| 20 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | .. | |
|000003d0| 20 20 20 20 20 32 30 30 | 2e 30 2c 20 33 35 30 2e | 200|.0, 350.|
|000003e0| 30 29 2c 20 74 72 75 65 | 29 3b 0d 0a 20 20 20 20 |0), true|);.. |
|000003f0| 20 20 70 61 74 68 2e 61 | 70 70 65 6e 64 28 6e 65 | path.a|ppend(ne|
|00000400| 77 20 4c 69 6e 65 32 44 | 2e 44 6f 75 62 6c 65 28 |w Line2D|.Double(|
|00000410| 32 30 30 2e 30 2c 20 33 | 35 30 2e 30 2c 20 0d 0a |200.0, 3|50.0, ..|
|00000420| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000430| 20 20 32 35 30 2e 30 2c | 20 33 30 30 2e 30 29 2c | 250.0,| 300.0),|
|00000440| 20 74 72 75 65 29 3b 0d | 0a 20 20 20 20 20 20 70 | true);.|. p|
|00000450| 61 74 68 2e 61 70 70 65 | 6e 64 28 6e 65 77 20 4c |ath.appe|nd(new L|
|00000460| 69 6e 65 32 44 2e 44 6f | 75 62 6c 65 28 32 35 30 |ine2D.Do|uble(250|
|00000470| 2e 30 2c 20 33 30 30 2e | 30 2c 20 0d 0a 20 20 20 |.0, 300.|0, .. |
|00000480| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 33 | | 3|
|00000490| 30 30 2e 30 2c 20 33 35 | 30 2e 30 29 2c 20 74 72 |00.0, 35|0.0), tr|
|000004a0| 75 65 29 3b 0d 0a 20 20 | 20 20 20 20 73 68 61 70 |ue);.. | shap|
|000004b0| 65 73 5b 33 5d 20 3d 20 | 70 61 74 68 3b 0d 0a 20 |es[3] = |path;.. |
|000004c0| 20 20 20 7d 0d 0a 0d 0a | 20 20 20 20 63 6c 61 73 | }....| clas|
|000004d0| 73 20 4d 79 43 61 6e 76 | 61 73 20 65 78 74 65 6e |s MyCanv|as exten|
|000004e0| 64 73 20 43 61 6e 76 61 | 73 20 7b 0d 0a 20 20 20 |ds Canva|s {.. |
|000004f0| 20 20 20 70 75 62 6c 69 | 63 20 76 6f 69 64 20 70 | publi|c void p|
|00000500| 61 69 6e 74 28 47 72 61 | 70 68 69 63 73 20 67 72 |aint(Gra|phics gr|
|00000510| 61 70 68 69 63 73 29 20 | 7b 0d 0a 20 20 20 20 20 |aphics) |{.. |
|00000520| 20 20 20 20 47 72 61 70 | 68 69 63 73 32 44 20 67 | Grap|hics2D g|
|00000530| 72 20 3d 20 28 47 72 61 | 70 68 69 63 73 32 44 29 |r = (Gra|phics2D)|
|00000540| 20 67 72 61 70 68 69 63 | 73 3b 0d 0a 20 20 20 20 | graphic|s;.. |
|00000550| 20 20 20 20 20 66 6f 72 | 20 28 69 6e 74 20 69 3d | for| (int i=|
|00000560| 30 3b 20 69 3c 34 3b 20 | 69 2b 2b 29 0d 0a 20 20 |0; i<4; |i++).. |
|00000570| 20 20 20 20 20 20 20 20 | 20 20 67 72 2e 64 72 61 | | gr.dra|
|00000580| 77 28 73 68 61 70 65 73 | 5b 69 5d 29 3b 0d 0a 20 |w(shapes|[i]);.. |
|00000590| 20 20 20 20 20 7d 0d 0a | 20 20 20 20 7d 0d 0a 7d | }..| }..}|
|000005a0| 0d 0a 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000600| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000610| 54 68 69 73 20 72 65 73 | 6f 75 72 63 65 20 66 6f |This res|ource fo|
|00000620| 72 6b 20 69 6e 74 65 6e | 74 69 6f 6e 61 6c 6c 79 |rk inten|tionally|
|00000630| 20 6c 65 66 74 20 62 6c | 61 6e 6b 20 20 20 00 00 | left bl|ank ..|
|00000640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000660| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000670| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000680| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000690| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000700| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00000710| 00 00 00 00 00 00 00 00 | 00 1c 00 1e ff ff 00 00 |........|........|
|00000720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+