/Users/lyon/j4p/src/ip/gui/frames/SnellWlx.java
|
1 package ip.gui.frames;
2
3 import java.applet.Applet;
4 import java.awt.*;
5 import java.awt.event.ActionEvent;
6 import java.awt.event.ActionListener;
7
8 public class SnellWlx extends Applet {
9 Frame myFrame = new Frame("Bars");
10 TestPatternFrame testPatterns;
11 private Panel p,p1;
12
13 private int option;
14 int enhance;
15 int step,i,j;
16 float x,y;
17 float xs, ys;
18 int ax,ay,ax1,ay1;
19 private int cnt;
20 int r[] = new int[4];
21 int b1, g1,b2,g2,b3,g3;
22 int xk[] = new int[3];
23 int sw[] = new int[3];
24
25 int cols[][] = new int[1200][3];
26 int col1[][] = new int[64][3];
27 int col2[][] = new int[64][3];
28 int col3[][] = new int[64][3];
29 int col4[][] = new int[64][3];
30
31 //private Scrollbar s1,s2,s3;
32 //Button bb1,bb2;
33 //Label sl1,sl2,sl3;
34 // TextField st1,st2,st3;
35 Component c;
36
37 Menu patternsMenu = new Menu("Patterns");
38
39 public void init() {
40
41 r[3] = b3 = g3 = 255;
42 r[2] = b2 = g2 = 255;
43 r[1] = b1 = g1 = 255;
44
45 initCols();
46 initCols2();
47
48 c = this;
49 p = new Panel();
50 testPatterns = new TestPatternFrame(this);
51
52 testPatterns.setLayout(new BorderLayout());
53
54 p.setLayout(new GridLayout(3, 4, 10, 3));
55
56 testPatterns.add("South", p);
57 testPatterns.add("Center", c);
58 testPatterns.show();
59 testPatterns.setSize(256, 256);
60 option = 8;
61 enhance = 0;
62 step = 80;
63 }
64
65 private void initCols2() {
66 for (i = 0; i < 3; i++) {
67 xk[i] = 40 + i * 40;
68 sw[i] = 1 + i;
69 }
70 for (i = 0; i < 32; i++) {
71 col1[i][0] = i * 8;
72 col1[i][1] = 0;
73 col1[i][2] = 0;
74 col1[32 + i][0] = 255 - i * 8;
75 col1[32 + i][1] = 0;
76 col1[32 + i][2] = 0;
77
78 col2[i][0] = 0;
79 col2[i][1] = i * 8;
80 col2[i][2] = 0;
81 col2[32 + i][0] = 0;
82 col2[32 + i][1] = 255 - i * 8;
83 col2[32 + i][2] = 0;
84
85 col3[i][0] = 0;
86 col3[i][1] = 0;
87 col3[i][2] = i * 8;
88 col3[32 + i][0] = 0;
89 col3[32 + i][1] = 0;
90 col3[32 + i][2] = 255 - i * 8;
91 }
92 }
93
94 private void initCols() {
95 for (i = 0; i < 300; i++) {
96 cols[i][0] = 0;
97 cols[i][1] = 0;
98 cols[i][2] = 0;
99 }
100 }
101
102
103 public void print() {
104 Toolkit tk = Toolkit.getDefaultToolkit();
105 PrintJob printJob =
106 tk.getPrintJob(
107 new Frame(),
108 "print me!",
109 null);
110 Graphics g = printJob.getGraphics();
111 paint(g);
112 printJob.end();
113 }
114
115 public void paint(Graphics g) {
116
117 for (cnt = 1; cnt < (2 + enhance); cnt++) {
118 xs = (float) c.getSize().width;
119 ys = (float) c.getSize().height;
120
121
122 if (option == 10)
123 doOption10(g);
124
125 if (enhance == 1) {
126 doEnhance1(g);
127 } else {
128 x = xs;
129 y = ys;
130 ax = 0;
131 ay = 0;
132 }
133 if (cnt == 1) {
134 r[1] = r[3];
135 g1 = g3;
136 b1 = b3;
137 } else {
138 r[1] = r[2];
139 g1 = g2;
140 b1 = b2;
141
142 }
143
144
145 if (option == 1)
146 drawOption1(g);
147 if (option == 2)
148 drawOption2(g);
149
150 if (option == 3)
151 drawOption3(g);
152 if (option == 4)
153 drawOption4(g);
154 if (option == 5)
155 drawOption5(g);
156
157 if (option == 6)
158 drawOption6(g);
159
160 if (option == 7)
161 drawOption7(g);
162
163 if (option == 8)
164 drawOption8(g);
165
166 }
167 }
168
169 private void doEnhance1(Graphics g) {
170 x = xs * 22 / 50;
171 y = ys * 4 / 7;
172 ax = (int) (xs * 2 / 50) + (int) (xs * 2 / 50 + x) * (cnt - 1);
173 ay = (int) (ys * 4 / 50);
174 ax1 = (int) (xs * 2 / 50);
175 ay1 = (int) (ys * 4 / 50);
176 g.setColor(new Color(0, 0, 0));
177 Font fix = new Font("TimesRoman", Font.PLAIN, (int) (y / 20));
178 g.setFont(fix);
179 if (cnt == 2)
180 g.drawString("after", ax + 5 + (int) (4.9 * x / 12) + (int) (x / 12), ay - 5);
181 g.drawString("before", ax1 + 5 + (int) (4.9 * x / 12) + (int) (x / 12), ay1 - 5);
182 }
183
184 private void doOption10(Graphics g) {
185 g.setColor(new Color(0, 0, 0));
186 g.fillRect(0, 0, (int) xs, (int) ys);
187
188 while (option == 10) {
189 for (j = 0; j < 3; j++) {
190 if (((xk[j]) > (int) (ys * 7 / 8)) || (xk[j] < (int) (xs / 8))) sw[j] = -sw[j];
191 xk[j] = xk[j] + sw[j];
192 }
193 for (j = 0; j < (int) ys; j++) cols[j][0] = cols[j][1] = cols[j][2] = 0;
194
195 for (j = 0; j < 64; j++) {
196 cols[xk[0] - 32 + j][0] = col1[j][0];
197 cols[xk[1] - 32 + j][1] = col2[j][1];
198 cols[xk[2] - 32 + j][2] = col3[j][2];
199 }
200 for (j = 1; j < (int) ys; j++)
201 if ((cols[j][0] + cols[j][1] + cols[j][2]) != 0) {
202 g.setColor(new Color(cols[j][0], cols[j][1], cols[j][2]));
203 g.drawLine(0, j, (int) xs, j);
204 }
205 }
206 }
207
208 private void drawOption3(Graphics g) {
209 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
210 g.fillRect(ax + 0, ay + 0, (int) (x), (int) (y));
211 }
212
213 private void drawOption5(Graphics g) {
214 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
215 g.fillRect(ax + 0, ay + 0, (int) (x), (int) (y));
216 int i1,j1;
217
218 g.setColor(new Color((int) (255 * r[1] / 255), (int) (255 * g1 / 255), (int) (255 * b1 / 255)));
219 for (i1 = 1; i1 < (int) (512 / step) + 1; i1++)
220 g.drawLine(ax + (int) (i1 * x * step / 512), ay + 0, ax + (int) (i1 * x * step / 512), ay + (int) y);
221 for (j1 = 1; j1 < (int) (512 / step) + 1; j1++)
222 g.drawLine(ax + 0, ay + (int) (j1 * y * step / 512),
223 ax + (int) x, ay + (int) (j1 * y * step / 512));
224 }
225
226 private void drawOption6(Graphics g) {
227 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
228 g.fillRect(ax + 1, ay + 0, (int) (x), (int) (y));
229 g.setColor(new Color((int) (255 * r[1] / 255), (int) (255 * g1 / 255), (int) (255 * b1 / 255)));
230 g.fillRect((int) (ax + x * 140 / 512), ay + (int) (y * 142 / 512), (int) (x * 134 / 512), (int) (y * 260 / 512));
231 g.fillRect((int) (ax + x * 275 / 512), ay + (int) (y * 142 / 512), (int) (x * 134 / 512), (int) (y * 260 / 512));
232 g.setColor(new Color((int) (69 * r[1] / 255), (int) (69 * g1 / 255), (int) (69 * b1 / 255)));
233 g.drawLine((int) (ax + x * 87 / 512), ay + (int) (0), ax + (int) (x * 87 / 512), ay + (int) (y));
234 g.setColor(new Color((int) (194 * r[1] / 255), (int) (194 * g1 / 255), (int) (194 * b1 / 255)));
235 g.drawLine((int) (ax + x * 88 / 512), ay + (int) (0), ax + (int) (x * 88 / 512), ay + (int) (y));
236 g.setColor(new Color((int) (255 * r[1] / 255), (int) (255 * g1 / 255), (int) (255 * b1 / 255)));
237 g.drawLine((int) (ax + x * 89 / 512), ay + (int) (0), ax + (int) (x * 89 / 512), ay + (int) (y));
238 g.setColor(new Color((int) (194 * r[1] / 255), (int) (194 * g1 / 255), (int) (194 * b1 / 255)));
239 g.drawLine((int) (ax + x * 90 / 512), ay + (int) (0), ax + (int) (x * 90 / 512), ay + (int) (y));
240 g.setColor(new Color((int) (69 * r[1] / 255), (int) (69 * g1 / 255), (int) (69 * b1 / 255)));
241 g.drawLine((int) (ax + x * 91 / 512), ay + (int) (0), ax + (int) (x * 91 / 512), ay + (int) (y));
242
243
244 g.setColor(new Color((int) (41 * r[1] / 255), (int) (41 * g1 / 255), (int) (41 * b1 / 255)));
245 g.drawLine((int) (ax + x * 9 / 512), ay + (int) (0), ax + (int) (x * 9 / 512), ay + (int) (y));
246 g.setColor(new Color((int) (37 * r[1] / 255), (int) (37 * g1 / 255), (int) (37 * b1 / 255)));
247 g.drawLine((int) (ax + x * 10 / 512), ay + (int) (0), ax + (int) (x * 10 / 512), ay + (int) (y));
248 g.setColor(new Color((int) (8 * r[1] / 255), (int) (8 * g1 / 255), (int) (8 * b1 / 255)));
249 g.drawLine((int) (ax + x * 11 / 512), ay + (int) (0), ax + (int) (x * 11 / 512), ay + (int) (y));
250 g.setColor(new Color((int) (62 * r[1] / 255), (int) (62 * g1 / 255), (int) (62 * b1 / 255)));
251 g.drawLine((int) (ax + x * 12 / 512), ay + (int) (0), ax + (int) (x * 12 / 512), ay + (int) (y));
252 g.setColor(new Color((int) (111 * r[1] / 255), (int) (111 * g1 / 255), (int) (111 * b1 / 255)));
253 g.drawLine((int) (ax + x * 13 / 512), ay + (int) (0), ax + (int) (x * 13 / 512), ay + (int) (y));
254 g.setColor(new Color((int) (20 * r[1] / 255), (int) (20 * g1 / 255), (int) (20 * b1 / 255)));
255 g.drawLine((int) (ax + x * 14 / 512), ay + (int) (0), ax + (int) (x * 14 / 512), ay + (int) (y));
256 g.setColor(new Color((int) (40 * r[1] / 255), (int) (40 * g1 / 255), (int) (40 * b1 / 255)));
257 g.drawLine((int) (ax + x * 15 / 512), ay + (int) (0), ax + (int) (x * 15 / 512), ay + (int) (y));
258 g.setColor(new Color((int) (177 * r[1] / 255), (int) (177 * g1 / 255), (int) (177 * b1 / 255)));
259 g.drawLine((int) (ax + x * 16 / 512), ay + (int) (0), ax + (int) (x * 16 / 512), ay + (int) (y));
260 g.setColor(new Color((int) (98 * r[1] / 255), (int) (98 * g1 / 255), (int) (98 * b1 / 255)));
261 g.drawLine((int) (ax + x * 17 / 512), ay + (int) (0), ax + (int) (x * 17 / 512), ay + (int) (y));
262 g.setColor(new Color((int) (3 * r[1] / 255), (int) (3 * g1 / 255), (int) (3 * b1 / 255)));
263 g.drawLine((int) (ax + x * 18 / 512), ay + (int) (0), ax + (int) (x * 18 / 512), ay + (int) (y));
264 g.setColor(new Color((int) (172 * r[1] / 255), (int) (172 * g1 / 255), (int) (172 * b1 / 255)));
265 g.drawLine((int) (ax + x * 19 / 512), ay + (int) (0), ax + (int) (x * 19 / 512), ay + (int) (y));
266 g.setColor(new Color((int) (205 * r[1] / 255), (int) (205 * g1 / 255), (int) (205 * b1 / 255)));
267 g.drawLine((int) (ax + x * 20 / 512), ay + (int) (0), ax + (int) (x * 20 / 512), ay + (int) (y));
268 g.setColor(new Color((int) (16 * r[1] / 255), (int) (16 * g1 / 255), (int) (16 * b1 / 255)));
269 g.drawLine((int) (ax + x * 21 / 512), ay + (int) (0), ax + (int) (x * 21 / 512), ay + (int) (y));
270 g.setColor(new Color((int) (94 * r[1] / 255), (int) (94 * g1 / 255), (int) (94 * b1 / 255)));
271 g.drawLine((int) (ax + x * 22 / 512), ay + (int) (0), ax + (int) (x * 22 / 512), ay + (int) (y));
272 g.setColor(new Color((int) (16 * r[1] / 255), (int) (16 * g1 / 255), (int) (16 * b1 / 255)));
273 g.drawLine((int) (ax + x * 23 / 512), ay + (int) (0), ax + (int) (x * 23 / 512), ay + (int) (y));
274 g.setColor(new Color((int) (205 * r[1] / 255), (int) (205 * g1 / 255), (int) (205 * b1 / 255)));
275 g.drawLine((int) (ax + x * 24 / 512), ay + (int) (0), ax + (int) (x * 24 / 512), ay + (int) (y));
276 g.setColor(new Color((int) (172 * r[1] / 255), (int) (172 * g1 / 255), (int) (172 * b1 / 255)));
277 g.drawLine((int) (ax + x * 25 / 512), ay + (int) (0), ax + (int) (x * 25 / 512), ay + (int) (y));
278 g.setColor(new Color((int) (3 * r[1] / 255), (int) (3 * g1 / 255), (int) (3 * b1 / 255)));
279 g.drawLine((int) (ax + x * 26 / 512), ay + (int) (0), ax + (int) (x * 26 / 512), ay + (int) (y));
280 g.setColor(new Color((int) (98 * r[1] / 255), (int) (98 * g1 / 255), (int) (98 * b1 / 255)));
281 g.drawLine((int) (ax + x * 27 / 512), ay + (int) (0), ax + (int) (x * 27 / 512), ay + (int) (y));
282 g.setColor(new Color((int) (177 * r[1] / 255), (int) (177 * g1 / 255), (int) (177 * b1 / 255)));
283 g.drawLine((int) (ax + x * 28 / 512), ay + (int) (0), ax + (int) (x * 28 / 512), ay + (int) (y));
284 g.setColor(new Color((int) (40 * r[1] / 255), (int) (40 * g1 / 255), (int) (40 * b1 / 255)));
285 g.drawLine((int) (ax + x * 29 / 512), ay + (int) (0), ax + (int) (x * 29 / 512), ay + (int) (y));
286 g.setColor(new Color((int) (20 * r[1] / 255), (int) (20 * g1 / 255), (int) (20 * b1 / 255)));
287 g.drawLine((int) (ax + x * 30 / 512), ay + (int) (0), ax + (int) (x * 30 / 512), ay + (int) (y));
288 g.setColor(new Color((int) (11 * r[1] / 255), (int) (11 * g1 / 255), (int) (11 * b1 / 255)));
289 g.drawLine((int) (ax + x * 31 / 512), ay + (int) (0), ax + (int) (x * 31 / 512), ay + (int) (y));
290 g.setColor(new Color((int) (82 * r[1] / 255), (int) (82 * g1 / 255), (int) (82 * b1 / 255)));
291 g.drawLine((int) (ax + x * 32 / 512), ay + (int) (0), ax + (int) (x * 32 / 512), ay + (int) (y));
292 g.setColor(new Color((int) (8 * r[1] / 255), (int) (8 * g1 / 255), (int) (8 * b1 / 255)));
293 g.drawLine((int) (ax + x * 33 / 512), ay + (int) (0), ax + (int) (x * 33 / 512), ay + (int) (y));
294 g.setColor(new Color((int) (37 * r[1] / 255), (int) (37 * g1 / 255), (int) (37 * b1 / 255)));
295 g.drawLine((int) (ax + x * 34 / 512), ay + (int) (0), ax + (int) (x * 34 / 512), ay + (int) (y));
296 g.setColor(new Color((int) (41 * r[1] / 255), (int) (41 * g1 / 255), (int) (41 * b1 / 255)));
297 g.drawLine((int) (ax + x * 35 / 512), ay + (int) (0), ax + (int) (x * 35 / 512), ay + (int) (y));
298 }
299
300 private void drawOption7(Graphics g) {
301 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
302 g.fillRect(ax + 1, ay + 0, (int) (x), (int) (y));
303 g.setColor(new Color((int) (192 * r[1] / 255), (int) (192 * g1 / 255), (int) (192 * b1 / 255)));
304 g.fillRect(ax + 1, ay + 0, ax + (int) (x * 72 / 512), (int) (y * 369 / 512));
305 g.setColor(new Color((int) (192 * r[1] / 255), (int) (192 * g1 / 255), (int) (0 * b1 / 255)));
306 g.fillRect((int) (ax + x * 73 / 512), ay + 0, (int) (x * 75 / 512), (int) (y * 369 / 512));
307 g.setColor(new Color((int) (0 * r[1] / 255), (int) (192 * g1 / 255), (int) (192 * b1 / 255)));
308 g.fillRect((int) (ax + x * 146 / 512), ay + 0, (int) (x * 75 / 512), (int) (y * 369 / 512));
309 g.setColor(new Color((int) (0 * r[1] / 255), (int) (192 * g1 / 255), (int) (0 * b1 / 255)));
310 g.fillRect((int) (ax + x * 219 / 512), ay + 0, (int) (x * 75 / 512), (int) (y * 369 / 512));
311 g.setColor(new Color((int) (192 * r[1] / 255), (int) (0 * g1 / 255), (int) (192 * b1 / 255)));
312 g.fillRect((int) (ax + x * 292 / 512), ay + 0, (int) (x * 75 / 512), (int) (y * 369 / 512));
313 g.setColor(new Color((int) (192 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
314 g.fillRect((int) (ax + x * 365 / 512), ay + 0, (int) (x * 75 / 512), (int) (y * 369 / 512));
315 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (192 * b1 / 255)));
316 g.fillRect((int) (ax + x * 438 / 512), ay + 0, (int) (x * 75 / 512), (int) (y * 369 / 512));
317
318 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (192 * b1 / 255)));
319 g.fillRect(ax + 1, ay + (int) (y * 370 / 512), (int) (x * 75 / 512), (int) (y * 40 / 512));
320
321 g.setColor(new Color((int) (192 * r[1] / 255), (int) (0 * g1 / 255), (int) (192 * b1 / 255)));
322 g.fillRect(ax + (int) (x * 146 / 512), ay + (int) (y * 370 / 512), (int) (x * 75 / 512), (int) (y * 40 / 512));
323
324 g.setColor(new Color((int) (0 * r[1] / 255), (int) (192 * g1 / 255), (int) (192 * b1 / 255)));
325 g.fillRect(ax + (int) (x * 292 / 512), ay + (int) (y * 370 / 512), (int) (x * 75 / 512), (int) (y * 40 / 512));
326
327
328 g.setColor(new Color((int) (192 * r[1] / 255), (int) (192 * g1 / 255), (int) (192 * b1 / 255)));
329 g.fillRect(ax + (int) (x * 438 / 512), ay + (int) (y * 370 / 512), (int) (x * 75 / 512), (int) (y * 40 / 512));
330
331
332 g.setColor(new Color((int) (8 * r[1] / 255), (int) (62 * g1 / 255), (int) (89 * b1 / 255)));
333 g.fillRect(ax + 1, ay + (int) (y * 410 / 512), (int) (x * 95 / 512), (int) (y * 102 / 512));
334
335 g.setColor(new Color((int) (58 * r[1] / 255), (int) (0 * g1 / 255), (int) (126 * b1 / 255)));
336 g.fillRect(ax + (int) (x * 146 / 512), ay + (int) (y * 410 / 512), (int) (x * 130 / 512), (int) (y * 102 / 512));
337
338 g.setColor(new Color((int) (19 * r[1] / 255), (int) (19 * g1 / 255), (int) (19 * b1 / 255)));
339 g.fillRect(ax + (int) (x * 339 / 512), ay + (int) (y * 410 / 512), (int) (x * 123 / 512), (int) (y * 102 / 512));
340
341 g.setColor(new Color((int) (38 * r[1] / 255), (int) (38 * g1 / 255), (int) (38 * b1 / 255)));
342 g.fillRect(ax + (int) (x * 409 / 512), ay + (int) (y * 410 / 512), (int) (x * 29 / 512), (int) (y * 102 / 512));
343
344
345 g.setColor(new Color((int) (255 * r[1] / 255), (int) (255 * g1 / 255), (int) (255 * b1 / 255)));
346 g.fillRect(ax + (int) (x * 93 / 512), ay + (int) (y * 410 / 512), (int) (x * 93 / 512), (int) (y * 102 / 512));
347 }
348
349 private void drawOption8(Graphics g) {
350 y = y - 25;
351 x = x - 10;
352 g.setColor(new Color((int) (127 * r[1] / 255), (int) (127 * g1 / 255), (int) (127 * b1 / 255)));
353 g.fillRect(ax + 5, ay + 0, (int) (x), (int) (y));
354
355 int i1,j1,k1,l1;
356 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
357 k1 = (int) (3 * x / 24);
358 for (i1 = 1; i1 < 12; i1++)
359 g.drawLine(ax + 5 + (int) (i1 * x / 12), ay + 0, ax + 5 + (int) (i1 * x / 12), ay + 0 + (int) y);
360 for (j1 = 1; j1 < 9; j1++)
361 g.drawLine(ax + 5, ay + 0 + (int) (j1 * y / 9), ax + 5 + (int) x, ay + 0 + (int) (j1 * y / 9));
362 g.drawArc(ax + 5 + k1, ay + 0, (int) (x - 2 * k1), (int) (y), 0, 360);
363 g.setColor(new Color((int) (127 * r[1] / 255), (int) (127 * g1 / 255), (int) (127 * b1 / 255)));
364 g.fillRect(ax + 5 + (int) (3 * x / 12), ay + 0 + (int) (2 * y / 9), (int) (6 * x / 12), (int) (5 * y / 9));
365 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
366 g.drawRect(ax + 5 + (int) (3 * x / 12), ay + 0 + (int) (2 * y / 9), (int) (6 * x / 12), (int) (5 * y / 9));
367 for (i1 = 0; i1 < 60; i1++) {
368 l1 = (int) (128 + (127 * (1 - Math.sin((double) (i1) / 120 * 3.14159237))) * Math.cos((double) (i1) / 3 * 3.14159237));
369 g.setColor(new Color((int) (l1 * r[1] / 255), (int) (l1 * g1 / 255), (int) (l1 * b1 / 255)));
370 g.drawArc(ax + 5 + k1 + (int) ((x - 2 * k1) * (120 - i1) / 240), ay + 0 + (int) (y * (120 - i1) / 240), (int) ((i1 * (x - 2 * k1) / 120)), (int) (i1 * y / 120), 0, 360);
371 }
372
373 //upper left
374 drawUpperLeft(g);
375
376 //upper right
377 drawUpperRight(g);
378
379
380 //lower left
381 drawLowerLeft(g);
382
383
384 //texts
385 drawText(g);
386
387
388 //lower mid colors
389 //a
390 drawLowerMidColors(g);
391
392 //c
393 g.setColor(new Color((int) (128 * r[1] / 255), (int) (60 * g1 / 255), (int) (60 * b1 / 255)));
394 g.fillRect(ax + 5 + (int) (7 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.07 * x / 12), (int) (y / 18));
395 g.setColor(new Color((int) (60 * r[1] / 255), (int) (168 * g1 / 255), (int) (168 * b1 / 255)));
396 g.fillRect(ax + 5 + (int) (7.07 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.07 * x / 12), (int) (y / 18));
397
398 g.setColor(new Color((int) (128 * r[1] / 255), (int) (60 * g1 / 255), (int) (60 * b1 / 255)));
399 g.fillRect(ax + 5 + (int) (7.14 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.08 * x / 12), (int) (y / 18));
400 g.setColor(new Color((int) (60 * r[1] / 255), (int) (168 * g1 / 255), (int) (168 * b1 / 255)));
401 g.fillRect(ax + 5 + (int) (7.22 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.08 * x / 12), (int) (y / 18));
402
403 g.setColor(new Color((int) (128 * r[1] / 255), (int) (60 * g1 / 255), (int) (60 * b1 / 255)));
404 g.fillRect(ax + 5 + (int) (7.30 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.07 * x / 12), (int) (y / 18));
405 g.setColor(new Color((int) (60 * r[1] / 255), (int) (168 * g1 / 255), (int) (168 * b1 / 255)));
406 g.fillRect(ax + 5 + (int) (7.37 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.08 * x / 12), (int) (y / 18));
407
408 g.setColor(new Color((int) (128 * r[1] / 255), (int) (60 * g1 / 255), (int) (60 * b1 / 255)));
409 g.fillRect(ax + 5 + (int) (7.45 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.07 * x / 12), (int) (y / 18));
410 g.setColor(new Color((int) (60 * r[1] / 255), (int) (168 * g1 / 255), (int) (168 * b1 / 255)));
411 g.fillRect(ax + 5 + (int) (7.52 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.08 * x / 12), (int) (y / 18));
412
413 g.setColor(new Color((int) (128 * r[1] / 255), (int) (60 * g1 / 255), (int) (60 * b1 / 255)));
414 g.fillRect(ax + 5 + (int) (7.60 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.07 * x / 12), (int) (y / 18));
415 g.setColor(new Color((int) (60 * r[1] / 255), (int) (168 * g1 / 255), (int) (168 * b1 / 255)));
416 g.fillRect(ax + 5 + (int) (7.67 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.08 * x / 12), (int) (y / 18));
417
418 g.setColor(new Color((int) (128 * r[1] / 255), (int) (60 * g1 / 255), (int) (60 * b1 / 255)));
419 g.fillRect(ax + 5 + (int) (7.75 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.09 * x / 12), (int) (y / 18));
420 g.setColor(new Color((int) (60 * r[1] / 255), (int) (168 * g1 / 255), (int) (168 * b1 / 255)));
421 g.fillRect(ax + 5 + (int) (7.84 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.08 * x / 12), (int) (y / 18));
422
423 g.setColor(new Color((int) (128 * r[1] / 255), (int) (60 * g1 / 255), (int) (60 * b1 / 255)));
424 g.fillRect(ax + 5 + (int) (7.92 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.08 * x / 12), (int) (y / 18));
425
426 int i;
427 for (i = 1; i < 12; i++) {
428 g.setColor(new Color((int) ((int) ((i + 1) % 2) * 255 * r[1] / 255), (int) (((i + 1) % 2) * 255 * g1 / 255), (int) (((i + 1) % 2) * 255 * b1 / 255)));
429 g.drawLine(ax + 5 + (int) ((938 + 2 * i) * x / 1200), ay + 0 + (int) (6.5 * y / 9), ax + 5 + (int) ((915 + 6 * i) * x / 1200), ay + 0 + (int) (2.5 * y / 9));
430 g.drawLine(ax + 5 + (int) ((938 + 2 * i) * x / 1200), ay + 0 + (int) (6.5 * y / 9), ax + 5 + (int) ((915 + 6 * i + 1) * x / 1200), ay + 0 + (int) (2.5 * y / 9));
431 g.drawLine(ax + 5 + (int) ((938 + 2 * i) * x / 1200), ay + 0 + (int) (6.5 * y / 9), ax + 5 + (int) ((915 + 6 * i - 1) * x / 1200), ay + 0 + (int) (2.5 * y / 9));
432 }
433
434 for (i = 1; i < 11; i++) {
435 g.setColor(new Color((int) (((int) ((i + 1) % 2) * 100 + 100) * r[1] / 255), (int) ((int) (((i + 1) % 2) * 100 + 100) * g1 / 255), (int) ((int) (((i + 1) % 2) * 100 + 100) * b1 / 255)));
436 g.drawLine(ax + 5 + (int) (.01 * x / 12), ay + 0 + (int) ((29 + i) * y / 90), ax + 5 + (int) (x / 12), ay + 0 + (int) ((30 + i) * y / 90));
437 g.drawLine(ax + 5 + (int) (.01 * x / 12), ay + 0 + (int) ((29.3 + i) * y / 90), ax + 5 + (int) (x / 12), ay + 0 + (int) ((30.3 + i) * y / 90));
438 g.drawLine(ax + 5 + (int) (.01 * x / 12), ay + 0 + (int) ((29.6 + i) * y / 90), ax + 5 + (int) (x / 12), ay + 0 + (int) ((30.6 + i) * y / 90));
439 g.drawLine(ax + 5 + (int) (.01 * x / 12), ay + 0 + (int) ((29.8 + i) * y / 90), ax + 5 + (int) (x / 12), ay + 0 + (int) ((30.8 + i) * y / 90));
440 }
441
442 for (i = 1; i < 20; i++) {
443 g.setColor(new Color((int) ((int) (((i + 1) % 2) * 100 + 100) * r[1] / 255), (int) ((int) (((i + 1) % 2) * 100 + 100) * g1 / 255), (int) (((int) ((i + 1) % 2) * 100 + 100) * b1 / 255)));
444 g.drawLine(ax + 5 + (int) (.01 * x / 12), ay + 0 + (int) ((78 + i) * y / 180), ax + 5 + (int) (x / 12), ay + 0 + (int) ((80 + i) * y / 180));
445 g.drawLine(ax + 5 + (int) (.01 * x / 12), ay + 0 + (int) ((78.4 + i) * y / 180), ax + 5 + (int) (x / 12), ay + 0 + (int) ((80.4 + i) * y / 180));
446 }
447
448 for (i = 1; i < 40; i++) {
449 g.setColor(new Color((int) (((int) ((i + 1) % 2) * 100 + 100) * r[1] / 255), (int) (((int) ((i + 1) % 2) * 100 + 100) * g1 / 255), (int) (((int) ((i + 1) % 2) * 100 + 100) * b1 / 255)));
450 g.drawLine(ax + 5 + (int) (.01 * x / 12), ay + 0 + (int) ((196 + i) * y / 360), ax + 5 + (int) (x / 12), ay + 0 + (int) ((200 + i) * y / 360));
451 }
452
453 for (i = 1; i < 40; i++) {
454 g.setColor(new Color((int) (((int) ((i + 1) % 2) * 100 + 100) * r[1] / 255), (int) (((int) ((i + 1) % 2) * 100 + 100) * g1 / 255), (int) (((int) ((i + 1) % 2) * 100 + 100) * b1 / 255)));
455 g.drawLine(ax + 5 + (int) ((40 + i) * x / 480), ay + 0 + (int) (1.01 * y / 9), ax + 5 + (int) ((40 + i) * x / 480), ay + 0 + (int) (1.97 * y / 9));
456 g.drawLine(ax + 5 + (int) ((40 + i) * x / 480), ay + 0 + (int) (7.01 * y / 9), ax + 5 + (int) ((40 + i) * x / 480), ay + 0 + (int) (7.97 * y / 9));
457 g.drawLine(ax + 5 + (int) ((400 + i) * x / 480), ay + 0 + (int) (1.01 * y / 9), ax + 5 + (int) ((400 + i) * x / 480), ay + 0 + (int) (1.97 * y / 9));
458 }
459
460 for (i = 1; i < 37; i++) {
461 g.setColor(new Color((int) (((int) ((i + 1) % 2) * 100 + 100) * r[1] / 255), (int) (((int) ((i + 1) % 2) * 100 + 100) * g1 / 255), (int) (((int) ((i + 1) % 2) * 100 + 100) * b1 / 255)));
462 g.drawLine(ax + 5 + (int) (10.5 * x / 12), ay + 0 + (int) (7.5 * y / 9), ax + 5 + (int) (10.5 * x / 12 + (x / 30) * Math.cos(i * Math.PI / 18)), ay + 0 + (int) (7.5 * y / 9 + (y / 22) * Math.sin(i * Math.PI / 18)));
463 }
464
465 g.setColor(new Color((int) (128 * r[1] / 255), (int) (128 * g1 / 255), (int) (128 * b1 / 255)));
466 g.fillOval(ax + 5 + (int) (10.5 * x / 12) - (int) (x / 96), ay + 0 + (int) (7.5 * y / 9) - (int) (x / 72), (int) (x / 48), (int) (x / 36));
467 }
468
469 private void drawUpperLeft(Graphics g) {
470 g.setColor(new Color((int) (192 * r[1] / 255), (int) (192 * g1 / 255), (int) (0 * b1 / 255)));
471 g.fillRect(ax + 5, ay + 0, (int) (x / 24), (int) (y / 20));
472 g.setColor(new Color((int) (0 * r[1] / 255), (int) (192 * g1 / 255), (int) (192 * b1 / 255)));
473 g.fillRect(ax + 5 + (int) (x / 24), ay + 0, (int) (x / 24), (int) (y / 20));
474 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (192 * b1 / 255)));
475 g.fillRect(ax + 5 + (int) (2 * x / 24), ay + 0, (int) (x / 24), (int) (y / 20));
476 g.setColor(new Color((int) (192 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
477 g.fillRect(ax + 5 + (int) (3 * x / 24), ay + 0, (int) (x / 24), (int) (y / 20));
478
479 g.setColor(new Color((int) (192 * r[1] / 255), (int) (0 * g1 / 255), (int) (192 * b1 / 255)));
480 g.fillRect(ax + 5, ay + 0 + (int) (y / 20), (int) (x / 24), (int) (y / 20));
481 g.setColor(new Color((int) (0 * r[1] / 255), (int) (192 * g1 / 255), (int) (0 * b1 / 255)));
482 g.fillRect(ax + 5 + (int) (x / 24), ay + 0 + (int) (y / 20), (int) (x / 24), (int) (y / 20));
483 g.setColor(new Color((int) (192 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
484 g.fillRect(ax + 5 + (int) (2 * x / 24), ay + 0 + (int) (y / 20), (int) (x / 24), (int) (y / 20));
485 g.setColor(new Color((int) (0 * r[1] / 255), (int) (192 * g1 / 255), (int) (192 * b1 / 255)));
486 g.fillRect(ax + 5 + (int) (3 * x / 24), ay + 0 + (int) (y / 20), (int) (x / 24), (int) (y / 20));
487
488 g.setColor(new Color((int) (64 * r[1] / 255), (int) (64 * g1 / 255), (int) (64 * b1 / 255)));
489 g.fillRect(ax + 5, ay + 0 + (int) (y / 10), (int) (x / 24), (int) (y / 80));
490 g.setColor(new Color((int) (92 * r[1] / 255), (int) (92 * g1 / 255), (int) (92 * b1 / 255)));
491 g.fillRect(ax + 5 + (int) (x / 24), ay + 0 + (int) (y / 10), (int) (x / 24), (int) (y / 80));
492 g.setColor(new Color((int) (162 * r[1] / 255), (int) (162 * g1 / 255), (int) (162 * b1 / 255)));
493 g.fillRect(ax + 5 + (int) (2 * x / 24), ay + 0 + (int) (y / 10), (int) (x / 24), (int) (y / 80));
494 g.setColor(new Color((int) (210 * r[1] / 255), (int) (210 * g1 / 255), (int) (210 * b1 / 255)));
495 g.fillRect(ax + 5 + (int) (3 * x / 24), ay + 0 + (int) (y / 10), (int) (x / 24), (int) (y / 80));
496 }
497
498 private void drawUpperRight(Graphics g) {
499 g.setColor(new Color((int) (192 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
500 g.fillRect(ax + (int) x + 5 - (int) (4 * x / 24), ay + 0, (int) (x / 24), (int) (y / 20));
501 g.setColor(new Color((int) (0 * r[1] / 255), (int) (192 * g1 / 255), (int) (0 * b1 / 255)));
502 g.fillRect(ax + (int) x + 5 - (int) (3 * x / 24), ay + 0, (int) (x / 24), (int) (y / 20));
503 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (192 * b1 / 255)));
504 g.fillRect(ax + (int) x + 5 - (int) (2 * x / 24), ay + 0, (int) (x / 24), (int) (y / 20));
505 g.setColor(new Color((int) (0 * r[1] / 255), (int) (192 * g1 / 255), (int) (192 * b1 / 255)));
506 g.fillRect(ax + (int) x + 5 - (int) (1 * x / 24), ay + 0, (int) (x / 24), (int) (y / 20));
507
508 g.setColor(new Color((int) (0 * r[1] / 255), (int) (192 * g1 / 255), (int) (0 * b1 / 255)));
509 g.fillRect(ax + (int) x + 5 - (int) (4 * x / 24), ay + 0 + (int) (y / 20), (int) (x / 24), (int) (y / 20));
510 g.setColor(new Color((int) (192 * r[1] / 255), (int) (0 * g1 / 255), (int) (192 * b1 / 255)));
511 g.fillRect(ax + (int) x + 5 - (int) (3 * x / 24), ay + 0 + (int) (y / 20), (int) (x / 24), (int) (y / 20));
512 g.setColor(new Color((int) (192 * r[1] / 255), (int) (192 * g1 / 255), (int) (0 * b1 / 255)));
513 g.fillRect(ax + (int) x + 5 - (int) (2 * x / 24), ay + 0 + (int) (y / 20), (int) (x / 24), (int) (y / 20));
514 g.setColor(new Color((int) (192 * r[1] / 255), (int) (0 * g1 / 255), (int) (192 * b1 / 255)));
515 g.fillRect(ax + (int) x + 5 - (int) (1 * x / 24), ay + 0 + (int) (y / 20), (int) (x / 24), (int) (y / 20));
516
517 g.setColor(new Color((int) (210 * r[1] / 255), (int) (210 * g1 / 255), (int) (210 * b1 / 255)));
518 g.fillRect(ax + (int) x + 5 - (int) (4 * x / 24), ay + 0 + (int) (y / 10), (int) (x / 24), (int) (y / 80));
519 g.setColor(new Color((int) (162 * r[1] / 255), (int) (162 * g1 / 255), (int) (162 * b1 / 255)));
520 g.fillRect(ax + (int) x + 5 - (int) (3 * x / 24), ay + 0 + (int) (y / 10), (int) (x / 24), (int) (y / 80));
521 g.setColor(new Color((int) (92 * r[1] / 255), (int) (92 * g1 / 255), (int) (92 * b1 / 255)));
522 g.fillRect(ax + (int) x + 5 - (int) (2 * x / 24), ay + 0 + (int) (y / 10), (int) (x / 24), (int) (y / 80));
523 g.setColor(new Color((int) (64 * r[1] / 255), (int) (64 * g1 / 255), (int) (64 * b1 / 255)));
524 g.fillRect(ax + (int) x + 5 - (int) (1 * x / 24), ay + 0 + (int) (y / 10), (int) (x / 24), (int) (y / 80));
525 }
526
527 private void drawLowerMidColors(Graphics g) {
528 g.setColor(new Color((int) (128 * r[1] / 255), (int) (60 * g1 / 255), (int) (60 * b1 / 255)));
529 g.fillRect(ax + 5 + (int) (4 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.11 * x / 12), (int) (y / 18));
530 g.setColor(new Color((int) (60 * r[1] / 255), (int) (168 * g1 / 255), (int) (168 * b1 / 255)));
531 g.fillRect(ax + 5 + (int) (4.12 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.11 * x / 12), (int) (y / 18));
532
533 g.setColor(new Color((int) (128 * r[1] / 255), (int) (60 * g1 / 255), (int) (60 * b1 / 255)));
534 g.fillRect(ax + 5 + (int) (4.23 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.11 * x / 12), (int) (y / 18));
535 g.setColor(new Color((int) (60 * r[1] / 255), (int) (168 * g1 / 255), (int) (168 * b1 / 255)));
536 g.fillRect(ax + 5 + (int) (4.34 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.11 * x / 12), (int) (y / 18));
537
538 g.setColor(new Color((int) (128 * r[1] / 255), (int) (60 * g1 / 255), (int) (60 * b1 / 255)));
539 g.fillRect(ax + 5 + (int) (4.45 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.11 * x / 12), (int) (y / 18));
540 g.setColor(new Color((int) (60 * r[1] / 255), (int) (168 * g1 / 255), (int) (168 * b1 / 255)));
541 g.fillRect(ax + 5 + (int) (4.56 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.11 * x / 12), (int) (y / 18));
542
543 g.setColor(new Color((int) (128 * r[1] / 255), (int) (60 * g1 / 255), (int) (60 * b1 / 255)));
544 g.fillRect(ax + 5 + (int) (4.67 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.11 * x / 12), (int) (y / 18));
545 g.setColor(new Color((int) (60 * r[1] / 255), (int) (168 * g1 / 255), (int) (168 * b1 / 255)));
546 g.fillRect(ax + 5 + (int) (4.78 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.11 * x / 12), (int) (y / 18));
547
548 g.setColor(new Color((int) (128 * r[1] / 255), (int) (60 * g1 / 255), (int) (60 * b1 / 255)));
549 g.fillRect(ax + 5 + (int) (4.89 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.12 * x / 12), (int) (y / 18));
550
551 //b
552 g.setColor(new Color((int) (192 * r[1] / 255), (int) (192 * g1 / 255), (int) (30 * b1 / 255)));
553 g.fillRect(ax + 5 + (int) (5.01 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.22 * x / 12), (int) (y / 18));
554 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (192 * b1 / 255)));
555 g.fillRect(ax + 5 + (int) (5.23 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.22 * x / 12), (int) (y / 18));
556
557 g.setColor(new Color((int) (192 * r[1] / 255), (int) (192 * g1 / 255), (int) (30 * b1 / 255)));
558 g.fillRect(ax + 5 + (int) (5.45 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.22 * x / 12), (int) (y / 18));
559 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (192 * b1 / 255)));
560 g.fillRect(ax + 5 + (int) (5.67 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.22 * x / 12), (int) (y / 18));
561
562 g.setColor(new Color((int) (192 * r[1] / 255), (int) (192 * g1 / 255), (int) (30 * b1 / 255)));
563 g.fillRect(ax + 5 + (int) (5.89 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.22 * x / 12), (int) (y / 18));
564 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (192 * b1 / 255)));
565 g.fillRect(ax + 5 + (int) (6.12 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.22 * x / 12), (int) (y / 18));
566
567 g.setColor(new Color((int) (192 * r[1] / 255), (int) (192 * g1 / 255), (int) (30 * b1 / 255)));
568 g.fillRect(ax + 5 + (int) (6.34 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.22 * x / 12), (int) (y / 18));
569 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (192 * b1 / 255)));
570 g.fillRect(ax + 5 + (int) (6.56 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.22 * x / 12), (int) (y / 18));
571
572 g.setColor(new Color((int) (192 * r[1] / 255), (int) (192 * g1 / 255), (int) (30 * b1 / 255)));
573 g.fillRect(ax + 5 + (int) (6.78 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (.22 * x / 12), (int) (y / 18));
574 }
575
576 private void drawText(Graphics g) {
577 g.setColor(new Color((int) (127 * r[1] / 255), (int) (127 * g1 / 255), (int) (127 * b1 / 255)));
578 g.fillRect(ax + 5 + (int) (4 * x / 12), ay + 0 + (int) y - (int) (y / 9), (int) (4 * x / 12), 0 + (int) (y / 9));
579 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
580 g.drawLine(ax + 5 + (int) (4 * x / 12), ay + 0 + (int) (8 * y / 9), ax + 5 + (int) (4 * x / 12), ay + 0 + (int) (y));
581 g.drawLine(ax + 5 + (int) (8 * x / 12), ay + 0 + (int) (8 * y / 9), ax + 5 + (int) (8 * x / 12), ay + 0 + (int) (y));
582 g.drawLine(ax + 5 + (int) (5 * x / 12), ay + 0 + (int) (8 * y / 9), ax + 5 + (int) (5 * x / 12), ay + 0 + (int) (y));
583 g.drawLine(ax + 5 + (int) (7 * x / 12), ay + 0 + (int) (8 * y / 9), ax + 5 + (int) (7 * x / 12), ay + 0 + (int) (y));
584
585
586 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
587 Font fix = new Font("TimesRoman", Font.BOLD, (int) (y / 30));
588 g.setFont(fix);
589 g.drawString("1.0", ax + 5 + (int) (4.3 * x / 12), ay + 0 + (int) y - (int) (.05 * y / 10));
590 g.drawString("0.5", ax + 5 + (int) (4.9 * x / 12) + (int) (x / 12), ay + 0 + (int) y - (int) (.05 * y / 10));
591 g.drawString("1.5", ax + 5 + (int) (4.3 * x / 12) + (int) (3 * x / 12), ay + 0 + (int) y - (int) (.05 * y / 10));
592
593 g.drawString("3", ax + 5 + (int) (10.1 * x / 12), ay + 0 + (int) y - (int) (5.1 * y / 9));
594 g.drawString("4", ax + 5 + (int) (10.1 * x / 12), ay + 0 + (int) y - (int) (4.1 * y / 9));
595 g.drawString("5", ax + 5 + (int) (10.1 * x / 12), ay + 0 + (int) y - (int) (3.1 * y / 9));
596
597 g.drawString("4.43", ax + 5 + (int) (10.1 * x / 12), ay + 0 + (int) y - (int) (6.7 * y / 9));
598 g.drawString("3.58", ax + 5 + (int) (1.1 * x / 12), ay + 0 + (int) y - (int) (6.7 * y / 9));
599 g.drawString("4.28", ax + 5 + (int) (1.1 * x / 12), ay + 0 + (int) y - (int) (2.1 * y / 9));
600 g.drawString("Mhz", ax + 5 + (int) (9.1 * x / 12), ay + 0 + (int) y - (int) (6.7 * y / 9));
601
602 fix = new Font("TimesRoman", Font.PLAIN, (int) (y / 23));
603 g.setFont(fix);
604 g.drawString("NTSC", ax + 5 + (int) (5.6 * x / 12), ay + 0 + (int) y - (int) (7.1 * y / 9));
605
606 fix = new Font("TimesRoman", Font.PLAIN, (int) (y / 26));
607 g.setFont(fix);
608 g.setColor(new Color((int) (255 * r[1] / 255), (int) (255 * g1 / 255), (int) (255 * b1 / 255)));
609 g.fillRect(ax + 5 + (int) (5.5 * x / 12), ay + 0 + (int) (1.1 * y / 9), (int) (x / 12), (int) (y / 20));
610 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
611 g.drawString("SW2", ax + 5 + (int) (5.6 * x / 12), ay + 0 + (int) y - (int) (7.6 * y / 9));
612
613 g.setColor(new Color((int) (255 * r[1] / 255), (int) (255 * g1 / 255), (int) (255 * b1 / 255)));
614 fix = new Font("TimesRoman", Font.PLAIN, (int) (y / 33));
615 g.setFont(fix);
616
617 g.drawString("300", ax + 5 + (int) (.1 * x / 12), ay + 0 + (int) y - (int) (2.6 * y / 9));
618 g.drawString("100", ax + 5 + (int) (.1 * x / 12), ay + 0 + (int) y - (int) (6.2 * y / 9));
619 g.drawString("TVL", ax + 5 + (int) (.1 * x / 12), ay + 0 + (int) y - (int) (6.7 * y / 9));
620 g.drawString("300", ax + 5 + (int) (4.2 * x / 12), ay + 0 + (int) y - (int) (8.2 * y / 9));
621 g.drawString("400", ax + 5 + (int) (7.2 * x / 12), ay + 0 + (int) y - (int) (8.2 * y / 9));
622
623 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
624 g.fillRect(ax + 5 + (int) (2.1 * x / 12), ay + 0 + (int) (y / 20), (int) (x / 16), (int) (y / 20));
625 g.fillRect(ax + 5 + (int) (9.1 * x / 12), ay + 0 + (int) (y / 20), (int) (x / 16), (int) (y / 20));
626 g.setColor(new Color((int) (255 * r[1] / 255), (int) (255 * g1 / 255), (int) (255 * b1 / 255)));
627 g.drawLine(ax + 5 + (int) (2.2 * x / 12), ay + 0 + (int) (1.1 * y / 20), ax + 5 + (int) (2.7 * x / 12), ay + 0 + (int) (1.7 * y / 20));
628 g.drawLine(ax + 5 + (int) (9.45 * x / 12), ay + 0 + (int) (1.1 * y / 20), ax + 5 + (int) (9.45 * x / 12), ay + 0 + (int) (1.7 * y / 20));
629 g.drawLine(ax + 5 + (int) (9.2 * x / 12), ay + 0 + (int) (1.45 * y / 20), ax + 5 + (int) (9.75 * x / 12), ay + 0 + (int) (1.45 * y / 20));
630
631 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
632 g.fillRect(ax + 5 + (int) (11 * x / 12), ay + 0 + (int) y - (int) (6 * y / 9), (int) (x / 12), (int) (y / 9));
633 g.setColor(new Color((int) (255 * r[1] / 255), (int) (255 * g1 / 255), (int) (255 * b1 / 255)));
634 g.drawLine(ax + 5 + (int) (11.5 * x / 12), ay + 0 + (int) y - (int) (5.9 * y / 9), ax + 5 + (int) (11.5 * x / 12), ay + 0 + (int) y - (int) (5.1 * y / 9));
635 g.setColor(new Color((int) (255 * r[1] / 255), (int) (255 * g1 / 255), (int) (255 * b1 / 255)));
636 g.fillRect(ax + 5 + (int) (11 * x / 12), ay + 0 + (int) y - (int) (5 * y / 9), (int) (x / 12), (int) (y / 9));
637 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
638 g.drawLine(ax + 5 + (int) (11.5 * x / 12), ay + 0 + (int) y - (int) (4.9 * y / 9), ax + 5 + (int) (11.5 * x / 12), ay + 0 + (int) y - (int) (4.1 * y / 9));
639 g.setColor(new Color((int) (64 * r[1] / 255), (int) (64 * g1 / 255), (int) (64 * b1 / 255)));
640 g.fillRect(ax + 5 + (int) (11 * x / 12), ay + 0 + (int) y - (int) (4 * y / 9), (int) (x / 12), (int) (y / 9));
641 g.setColor(new Color((int) (255 * r[1] / 255), (int) (255 * g1 / 255), (int) (255 * b1 / 255)));
642 g.drawLine(ax + 5 + (int) (11.5 * x / 12), ay + 0 + (int) y - (int) (3.9 * y / 9), ax + 5 + (int) (11.5 * x / 12), ay + 0 + (int) y - (int) (3.1 * y / 9));
643
644
645 g.setColor(new Color((int) (255 * r[1] / 255), (int) (255 * g1 / 255), (int) (255 * b1 / 255)));
646 g.fillRect(ax + 5 + (int) (2.15 * x / 12), ay + 0 + (int) (3.2 * y / 9), (int) (x / 16), (int) (y / 12));
647 g.setColor(new Color((int) (92 * r[1] / 255), (int) (92 * g1 / 255), (int) (92 * b1 / 255)));
648 g.fillRect(ax + 5 + (int) (2.15 * x / 12), ay + 0 + (int) (4.2 * y / 9), (int) (x / 16), (int) (y / 12));
649 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
650 g.fillRect(ax + 5 + (int) (2.15 * x / 12), ay + 0 + (int) (5.2 * y / 9), (int) (x / 16), (int) (y / 12));
651 g.setColor(new Color((int) (128 * r[1] / 255), (int) (128 * g1 / 255), (int) (128 * b1 / 255)));
652 g.drawLine(ax + 5 + (int) (2.25 * x / 12), ay + 0 + (int) (3.3 * y / 9), ax + 5 + (int) (2.25 * x / 12), ay + 0 + (int) (3.8 * y / 9));
653 g.drawLine(ax + 5 + (int) (2.25 * x / 12), ay + 0 + (int) (5.3 * y / 9), ax + 5 + (int) (2.25 * x / 12), ay + 0 + (int) (5.8 * y / 9));
654 g.drawLine(ax + 5 + (int) (2.73 * x / 12), ay + 0 + (int) (3.3 * y / 9), ax + 5 + (int) (2.73 * x / 12), ay + 0 + (int) (3.8 * y / 9));
655 g.drawLine(ax + 5 + (int) (2.73 * x / 12), ay + 0 + (int) (5.3 * y / 9), ax + 5 + (int) (2.73 * x / 12), ay + 0 + (int) (5.8 * y / 9));
656 }
657
658 private void drawLowerLeft(Graphics g) {
659 g.setColor(new Color((int) (92 * r[1] / 255), (int) (0 * g1 / 255), (int) (92 * b1 / 255)));
660 g.fillRect(ax + 5, ay + 0 + (int) y - (int) (y / 10), (int) (x / 12), (int) (y / 10));
661 g.setColor(new Color((int) (163 * r[1] / 255), (int) (0 * g1 / 255), (int) (163 * b1 / 255)));
662 g.fillRect(ax + 5 + (int) (x / 12), ay + 0 + (int) y - (int) (y / 10), (int) (x / 14), (int) (y / 10));
663 g.setColor(new Color((int) (255 * r[1] / 255), (int) (0 * g1 / 255), (int) (255 * b1 / 255)));
664 g.fillRect(ax + 5 + (int) (2 * x / 13), ay + 0 + (int) y - (int) (y / 10), (int) (x / 14), (int) (y / 10));
665
666 g.setColor(new Color((int) (255 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
667 g.fillRect(ax + 5 + (int) x - (int) (3 * x / 13), ay + 0 + (int) y - (int) (y / 10), (int) (3 * x / 13), (int) (y / 10));
668 }
669
670 public Panel getP() {
671 return p;
672 }
673
674 public void setP(Panel p) {
675 this.p = p;
676 }
677
678 public int getOption() {
679 return option;
680 }
681
682 public void setOption(int option) {
683 this.option = option;
684 }
685
686 public int getCnt() {
687 return cnt;
688 }
689
690 public void setCnt(int cnt) {
691 this.cnt = cnt;
692 }
693
694 private void drawOption2(Graphics g) {
695 g.setColor(new Color((int) (187 * r[1] / 255), (int) (187 * g1 / 255), (int) (187 * b1 / 255)));
696 g.fillRect(ax + 1, ay + 0, (int) (x), (int) (y));
697 g.setColor(new Color((int) (255 * r[1] / 255), (int) (255 * g1 / 255), (int) (255 * b1 / 255)));
698 g.fillRect((int) (ax + x * 55 / 512), (int) (ay + y * 78 / 512), (int) (x * 45 / 512), (int) (y * 100 / 512));
699 g.setColor(new Color((int) (17 * r[1] / 255), (int) (17 * g1 / 255), (int) (17 * b1 / 255)));
700 g.fillRect((int) (ax + x * 55 / 512), (int) (ay + y * 338 / 512), (int) (x * 45 / 512), (int) (y * 100 / 512));
701
702 g.setColor(new Color((int) (238 * r[1] / 255), (int) (238 * g1 / 255), (int) (238 * b1 / 255)));
703 g.fillRect((int) (ax + x * 100 / 512), (int) (ay + y * 78 / 512), (int) (x * 45 / 512), (int) (y * 100 / 512));
704 g.setColor(new Color((int) (51 * r[1] / 255), (int) (51 * g1 / 255), (int) (51 * b1 / 255)));
705 g.fillRect((int) (ax + x * 100 / 512), (int) (ay + y * 338 / 512), (int) (x * 45 / 512), (int) (y * 100 / 512));
706
707 g.setColor(new Color((int) (204 * r[1] / 255), (int) (204 * g1 / 255), (int) (204 * b1 / 255)));
708 g.fillRect((int) (ax + x * 145 / 512), (int) (ay + y * 78 / 512), (int) (x * 45 / 512), (int) (y * 100 / 512));
709 g.setColor(new Color((int) (68 * r[1] / 255), (int) (68 * g1 / 255), (int) (68 * b1 / 255)));
710 g.fillRect((int) (ax + x * 145 / 512), (int) (ay + y * 338 / 512), (int) (x * 45 / 512), (int) (y * 100 / 512));
711
712 g.setColor(new Color((int) (187 * r[1] / 255), (int) (187 * g1 / 255), (int) (187 * b1 / 255)));
713 g.fillRect((int) (ax + x * 190 / 512), (int) (ay + y * 78 / 512), (int) (x * 45 / 512), (int) (y * 100 / 512));
714 g.setColor(new Color((int) (102 * r[1] / 255), (int) (102 * g1 / 255), (int) (102 * b1 / 255)));
715 g.fillRect((int) (ax + x * 190 / 512), (int) (ay + y * 338 / 512), (int) (x * 45 / 512), (int) (y * 100 / 512));
716
717 g.setColor(new Color((int) (153 * r[1] / 255), (int) (153 * g1 / 255), (int) (153 * b1 / 255)));
718 g.fillRect((int) (ax + x * 235 / 512), (int) (ay + y * 78 / 512), (int) (x * 45 / 512), (int) (y * 100 / 512));
719 g.setColor(new Color((int) (119 * r[1] / 255), (int) (119 * g1 / 255), (int) (119 * b1 / 255)));
720 g.fillRect((int) (ax + x * 235 / 512), (int) (ay + y * 338 / 512), (int) (x * 45 / 512), (int) (y * 100 / 512));
721
722 g.setColor(new Color((int) (119 * r[1] / 255), (int) (119 * g1 / 255), (int) (119 * b1 / 255)));
723 g.fillRect((int) (ax + x * 280 / 512), (int) (ay + y * 78 / 512), (int) (x * 45 / 512), (int) (y * 100 / 512));
724 g.setColor(new Color((int) (153 * r[1] / 255), (int) (153 * g1 / 255), (int) (153 * b1 / 255)));
725 g.fillRect((int) (ax + x * 280 / 512), (int) (ay + y * 338 / 512), (int) (x * 45 / 512), (int) (y * 100 / 512));
726
727 g.setColor(new Color((int) (102 * r[1] / 255), (int) (102 * g1 / 255), (int) (102 * b1 / 255)));
728 g.fillRect((int) (ax + x * 325 / 512), (int) (ay + y * 78 / 512), (int) (x * 45 / 512), (int) (y * 100 / 512));
729 g.setColor(new Color((int) (187 * r[1] / 255), (int) (187 * g1 / 255), (int) (187 * b1 / 255)));
730 g.fillRect((int) (ax + x * 325 / 512), (int) (ay + y * 338 / 512), (int) (x * 45 / 512), (int) (y * 100 / 512));
731
732 g.setColor(new Color((int) (51 * r[1] / 255), (int) (51 * g1 / 255), (int) (51 * b1 / 255)));
733 g.fillRect((int) (ax + x * 370 / 512), (int) (ay + y * 78 / 512), (int) (x * 45 / 512), (int) (y * 100 / 512));
734 g.setColor(new Color((int) (238 * r[1] / 255), (int) (238 * g1 / 255), (int) (238 * b1 / 255)));
735 g.fillRect((int) (ax + x * 370 / 512), (int) (ay + y * 338 / 512), (int) (x * 45 / 512), (int) (y * 100 / 512));
736
737 g.setColor(new Color((int) (17 * r[1] / 255), (int) (17 * g1 / 255), (int) (17 * b1 / 255)));
738 g.fillRect((int) (ax + x * 415 / 512), (int) (ay + y * 78 / 512), (int) (x * 45 / 512), (int) (y * 100 / 512));
739 g.setColor(new Color((int) (255 * r[1] / 255), (int) (255 * g1 / 255), (int) (255 * b1 / 255)));
740 g.fillRect((int) (ax + x * 415 / 512), (int) (ay + y * 338 / 512), (int) (x * 45 / 512), (int) (y * 100 / 512));
741
742 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
743 g.fillRect((int) (ax + x * 170 / 512), (int) (ay + y * 211 / 512), (int) (x * 172 / 512), (int) (y * 91 / 512));
744 }
745
746 private void drawOption1(Graphics g) {
747 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
748 g.fillRect(ax + 1, ay + 0, (int) (x), (int) (y));
749 g.setColor(new Color((int) (192 * r[1] / 255), (int) (192 * g1 / 255), (int) (192 * b1 / 255)));
750 g.fillRect(ax + 1, ay + 0, (int) (x * 72 / 512), (int) (y * 409 / 512));
751 g.setColor(new Color((int) (192 * r[1] / 255), (int) (192 * g1 / 255), (int) (0 * b1 / 255)));
752 g.fillRect((int) (ax + x * 73 / 512), ay + 0, (int) (x * 75 / 512), (int) (y * 409 / 512));
753 g.setColor(new Color((int) (0 * r[1] / 255), (int) (192 * g1 / 255), (int) (192 * b1 / 255)));
754 g.fillRect((int) (ax + x * 146 / 512), ay + 0, (int) (x * 75 / 512), (int) (y * 409 / 512));
755 g.setColor(new Color((int) (0 * r[1] / 255), (int) (192 * g1 / 255), (int) (0 * b1 / 255)));
756 g.fillRect((int) (ax + x * 219 / 512), ay + 0, (int) (x * 75 / 512), (int) (y * 409 / 512));
757 g.setColor(new Color((int) (192 * r[1] / 255), (int) (0 * g1 / 255), (int) (192 * b1 / 255)));
758 g.fillRect((int) (ax + x * 292 / 512), ay + 0, (int) (x * 75 / 512), (int) (y * 409 / 512));
759 g.setColor(new Color((int) (192 * r[1] / 255), (int) (0 * g1 / 255), (int) (0 * b1 / 255)));
760 g.fillRect((int) (ax + x * 365 / 512), ay + 0, (int) (x * 75 / 512), (int) (y * 409 / 512));
761 g.setColor(new Color((int) (0 * r[1] / 255), (int) (0 * g1 / 255), (int) (192 * b1 / 255)));
762 g.fillRect((int) (ax + x * 438 / 512), ay + 0, (int) (x * 75 / 512), (int) (y * 409 / 512));
763 g.setColor(new Color((int) (255 * r[1] / 255), (int) (255 * g1 / 255), (int) (255 * b1 / 255)));
764 g.fillRect((int) (ax + x * 93 / 512), (int) (ay + y * 410 / 512), (int) (x * 94 / 512), (int) (y * 105 / 512));
765 }
766
767 private void drawOption4(Graphics g) {
768 g.setColor(new Color((int) (255 * r[1] / 255), (int) (255 * g1 / 255), (int) (255 * b1 / 255)));
769 g.fillRect(ax + 0, ay + 0, (int) (x), (int) (y));
770 }
771 }
772
773 class TestPatternFrame extends ShortCutFrame
774 implements ActionListener {
775 SnellWlx snellWlcx;
776
777 MenuBar mbar = new MenuBar();
778 Menu testPatternsMenu = getMenu("Test Patterns");
779 MenuItem eiaBars_mi = addMenuItem(testPatternsMenu, "[e]iabars");
780 MenuItem chip_chart_mi = addMenuItem(testPatternsMenu, "[c]hip_chart");
781 MenuItem black_mi = addMenuItem(testPatternsMenu, "[b]lack");
782 MenuItem white_mi = addMenuItem(testPatternsMenu, "[w]hite");
783 MenuItem grid_mi = addMenuItem(testPatternsMenu, "[g]rid");
784 MenuItem pulseAndBar_mi = addMenuItem(testPatternsMenu, "[p]ulse and bar");
785 MenuItem smpteBars_mi = addMenuItem(testPatternsMenu, "smpte bars");
786 MenuItem increaseGrid_mi = addMenuItem(testPatternsMenu, "[+]increase grid");
787 MenuItem decreaseGrid_mi = addMenuItem(testPatternsMenu, "[-]decrease grid");
788 MenuItem snellWilcox_mi = addMenuItem(testPatternsMenu, "[s]nell & wilcox");
789 MenuItem print_mi = addMenuItem(testPatternsMenu, "print...");
790
791 public static void main(String args[]) {
792 SnellWlx sw = new SnellWlx();
793 sw.init();
794 new TestPatternFrame(sw);
795 }
796
797 public TestPatternFrame(SnellWlx _sw) {
798 super("Test Patterns");
799 this.snellWlcx = _sw;
800 _sw.getP().setVisible(false);
801 mbar.add(testPatternsMenu);
802 setMenuBar(mbar);
803 }
804
805 public MenuItem addMenuItem(Menu aMenu, String itemName) {
806 MenuItem mi = new MenuItem(itemName);
807 aMenu.add(mi);
808 mi.addActionListener(this);
809 return (mi);
810 }
811
812 public void actionPerformed(ActionEvent e) {
813
814
815 if (match(e, print_mi)) snellWlcx.print();
816 if (match(e, eiaBars_mi)) snellWlcx.setOption(1);
817 if (match(e, chip_chart_mi)) snellWlcx.setOption(2);
818 if (match(e, black_mi)) snellWlcx.setOption(3);
819 if (match(e, white_mi)) snellWlcx.setOption(4);
820 if (match(e, grid_mi)) snellWlcx.setOption(5);
821 if (match(e, pulseAndBar_mi)) snellWlcx.setOption(6);
822 if (match(e, smpteBars_mi)) snellWlcx.setOption(7);
823 if (match(e, snellWilcox_mi)) snellWlcx.setOption(8);
824 if (match(e, increaseGrid_mi)) snellWlcx.step += 1;
825
826 if (match(e, decreaseGrid_mi)) snellWlcx.step -= 1;
827
828
829 snellWlcx.repaint();
830 }
831
832 }
833