/Users/lyon/j4p/src/graphics/dclap/QD.java
|
1 // graphics.dclap/quickdraw.java
2 // Macintosh QuickDraw info for PICT data
3 // d.gilbert, dec. 1996
4
5 package graphics.dclap;
6
7 // pack edu.indiana.bio.graphics.dclap;
8
9
10 public class QD {
11 // QuickDraw constants
12
13 // font styles
14 public final static int bold = 1;
15 public final static int italic = 2;
16 public final static int underline = 4;
17 public final static int outline = 8;
18 public final static int shadow = 16;
19 public final static int condense = 32;
20 public final static int extend = 64;
21
22 // pen draw modes
23 public final static int patCopy = 8;
24 public final static int patOr = 9;
25 public final static int patXor = 10;
26 public final static int patBic = 11;
27 public final static int hilite = 50;
28 // also notPatXXX
29
30 // MacDraw picComments
31 public final static int picDwgBeg = 130;
32 public final static int picDwgEnd = 131;
33 public final static int picGrpBeg = 140;
34 public final static int picGrpEnd = 141;
35 public final static int textBegin = 150;
36 public final static int textEnd = 151;
37 public final static int textCenter = 154;
38 // picComments for laserwriter
39 public final static int dashedLine = 180;
40 public final static int dashedStop = 181;
41 public final static int setLineWidth = 182;
42
43
44 public final static int version2 = 0x2ff;
45 // enum PICTops // djang java for no enums !
46 public final static int oNOP = 0;
47 public final static int oClip = 1;
48 public final static int oBkPat = 2;
49 public final static int oTxFont = 3;
50 public final static int oTxFace = 4;
51 public final static int oTxMode = 5;
52 public final static int oSpExtra = 6;
53 public final static int oPnSize = 7;
54 public final static int oPnMode = 8;
55 public final static int oPnPat = 9;
56 public final static int oFillPat = 10;
57 public final static int oOvSize = 11;
58 public final static int oOrigin = 12;
59 public final static int oTxSize = 13;
60 public final static int oFgColor = 14;
61 public final static int oBkColor = 15;
62 public final static int oTxRatio = 0x10;
63 public final static int oVersion = 0x11;
64 public final static int oBkPixPat = 0x12;
65 public final static int oPnPixPat = 0x13;
66 public final static int oFillPixPat = 0x14;
67 public final static int oPnLocHFrac = 0x15;
68 public final static int oChExtra = 0x16;
69 //r17,r18,r19,
70 public final static int oRGBFgCol = 0x1a;
71 public final static int oRGBBkCol = 0x1b;
72 public final static int oHiliteMode = 0x1c;
73 public final static int oHiliteColor = 0x1d;
74 public final static int oDefHilite = 0x1e;
75 public final static int oOpColor = 0x1f;
76 public final static int oLine = 0x20;
77 public final static int oLineFrom = 0x21;
78 public final static int oShortLine = 0x22;
79 public final static int oShortLineFrom = 0x23;
80 //r24,r25,r26,r27,
81 public final static int oLongText = 0x28;
82 public final static int oDHText = 0x29;
83 public final static int oDVText = 0x2a;
84 public final static int oDHDVText = 0x2b;
85 public final static int oFontName = 0x2c;
86 //r2d,
87 //public final static int or2e_mov,
88 //r2f,
89 public final static int oframeRect = 0x30;
90 public final static int opaintRect = 0x31;
91 public final static int oeraseRect = 0x32;
92 public final static int oinvertRect = 0x33;
93 public final static int ofillRect = 0x34;
94 //r35,r36,r37,
95 public final static int oframeSameRect = 0x38;
96 public final static int opaintSameRect = 0x39;
97 public final static int oeraseSameRect = 0x3a;
98 public final static int oinvertSameRect = 0x3b;
99 public final static int ofillSameRect = 0x3c;
100 //r3d,r3e,r3f,
101 public final static int oframeRRect = 0x40;
102 public final static int opaintRRect = 0x41;
103 public final static int oeraseRRect = 0x42;
104 public final static int oinvertRRect = 0x43;
105 public final static int ofillRRect = 0x44;
106 //r45,r46,r47,
107 public final static int oframeSameRRect = 0x48;
108 public final static int opaintSameRRect = 0x49;
109 public final static int oeraseSameRRect = 0x4a;
110 public final static int oinvertSameRRect = 0x4b;
111 public final static int ofillSameRRect = 0x4c;
112 //r4d,r4e,r4f,
113 public final static int oframeOval = 0x50;
114 public final static int opaintOval = 0x51;
115 public final static int oeraseOval = 0x52;
116 public final static int oinvertOval = 0x53;
117 public final static int ofillOval = 0x54;
118 //r55,r56,r57,
119 public final static int oframeSameOval = 0x58;
120 public final static int opaintSameOval = 0x59;
121 public final static int oeraseSameOval = 0x5a;
122 public final static int oinvertSameOval = 0x5b;
123 public final static int ofillSameOval = 0x5c;
124 //r5d,r5e,r5f,
125 public final static int oframeArc = 0x60;
126 public final static int opaintArc = 0x61;
127 public final static int oeraseArc = 0x62;
128 public final static int oinvertArc = 0x63;
129 public final static int ofillArc = 0x64;
130 //r65,r66,r67,
131 public final static int oframeSameArc = 0x68;
132 public final static int opaintSameArc = 0x69;
133 public final static int oeraseSameArc = 0x6a;
134 public final static int oinvertSameArc = 0x6b;
135 public final static int ofillSameArc = 0x6c;
136 //r6d,r6e,r6f,
137 public final static int oframePoly = 0x70;
138 public final static int opaintPoly = 0x71;
139 public final static int oerasePoly = 0x72;
140 public final static int oinvertPoly = 0x73;
141 public final static int ofillPoly = 0x74;
142 //r75,r76,r77,
143 public final static int oframeSamePoly = 0x78;
144 public final static int opaintSamePoly = 0x79;
145 public final static int oeraseSamePoly = 0x7a;
146 public final static int oinvertSamePoly = 0x7b;
147 public final static int ofillSamePoly = 0x7c;
148 //r7d,r7e,r7f,
149 public final static int oframeRgn = 0x80;
150 public final static int opaintRgn = 0x81;
151 public final static int oeraseRgn = 0x82;
152 public final static int oinvertRgn = 0x83;
153 public final static int ofillRgn = 0x84;
154 //r85,r86,r87,
155 public final static int oframeSameRgn = 0x88;
156 public final static int opaintSameRgn = 0x89;
157 public final static int oeraseSameRgn = 0x8a;
158 public final static int oinvertSameRgn = 0x8b;
159 public final static int ofillSameRgn = 0x8c;
160 //r8d,r8e,r8f,
161 public final static int oBitsRect = 0x90;
162 public final static int oBitsRgn = 0x91;
163 //r92,r93,r94,r95,r96,r97,
164 public final static int oPackBitsRect = 0x98;
165 public final static int oPackBitsRgn = 0x99;
166 public final static int oOpcode9A = 0x9a;
167 //r9b,r9c,r9d,r9e,r9f,
168 public final static int oShortComment = 0xa0;
169 public final static int oLongComment = 0xa1;
170 // a2..af,b0..fe unused
171 public final static int oopEndPic = 0x00ff;
172 // 0100..ffff unused
173 public final static int oHeaderOp = 0x0c00;
174
175 public static int fontnum = 101; // value past QuickDrawFont values?
176
177 protected static QuickDrawFont[] QDFonts;
178
179 static {
180 int i = 0;
181 QDFonts = new QuickDrawFont[17]; //! can't let compiler count?!
182 QDFonts[i++] = new QuickDrawFont(0, "Chicago"); // system
183 QDFonts[i++] = new QuickDrawFont(1, "Geneva"); // applic
184 QDFonts[i++] = new QuickDrawFont(2, "New York");
185 QDFonts[i++] = new QuickDrawFont(3, "Geneva");
186 QDFonts[i++] = new QuickDrawFont(4, "Monaco");
187 QDFonts[i++] = new QuickDrawFont(13, "Zapf Dingbats");
188 QDFonts[i++] = new QuickDrawFont(14, "Bookman");
189 QDFonts[i++] = new QuickDrawFont(16, "Palatino");
190 QDFonts[i++] = new QuickDrawFont(18, "Zapf Chancery");
191 QDFonts[i++] = new QuickDrawFont(19, "Souvenir");
192 QDFonts[i++] = new QuickDrawFont(20, "Times");
193 QDFonts[i++] = new QuickDrawFont(21, "Helvetica");
194 QDFonts[i++] = new QuickDrawFont(22, "Courier");
195 QDFonts[i++] = new QuickDrawFont(23, "Symbol");
196 QDFonts[i++] = new QuickDrawFont(26, "Lubalin Graph");
197 QDFonts[i++] = new QuickDrawFont(33, "Avant Garde");
198 QDFonts[i++] = new QuickDrawFont(34, "New Century Schlbk");
199 }
200
201 public static int getQuickDrawFontNum(String name) {
202 for (int i = 0; i < QDFonts.length; i++) {
203 int num = QDFonts[i].fontval(name);
204 if (num >= 0) return num;
205 }
206 return -1;
207 }
208
209 }
210