1:
37:
38:
39: package ;
40:
41: import ;
42: import ;
43: import ;
44: import ;
45:
46: import ;
47: import ;
48: import ;
49: import ;
50: import ;
51: import ;
52: import ;
53: import ;
54: import ;
55: import ;
56: import ;
57: import ;
58:
59:
60:
63: public class MetalIconFactory implements Serializable
64: {
65:
66:
67: public static final boolean DARK = false;
68:
69:
70: public static final boolean LIGHT = true;
71:
72:
75: private static class CheckBoxMenuItemIcon implements Icon, Serializable
76: {
77:
80: public CheckBoxMenuItemIcon()
81: {
82:
83: }
84:
85:
90: public int getIconWidth()
91: {
92: return 10;
93: }
94:
95:
100: public int getIconHeight()
101: {
102: return 10;
103: }
104:
105:
113: public void paintIcon(Component c, Graphics g, int x, int y)
114: {
115: JCheckBoxMenuItem item = (JCheckBoxMenuItem) c;
116:
117: if (item.isArmed())
118: g.setColor(MetalLookAndFeel.getBlack());
119: else
120: g.setColor(MetalLookAndFeel.getControlDarkShadow());
121: g.drawLine(x, y, x + 8, y);
122: g.drawLine(x, y + 1, x, y + 8);
123: g.drawLine(x + 2, y + 8, x + 8, y + 8);
124: g.drawLine(x + 8, y + 2, x + 8, y + 7);
125:
126: g.setColor(MetalLookAndFeel.getWhite());
127: g.drawLine(x + 1, y + 1, x + 7, y + 1);
128: g.drawLine(x + 1, y + 2, x + 1, y + 7);
129: g.drawLine(x + 1, y + 9, x + 9, y + 9);
130: g.drawLine(x + 9, y + 1, x + 9, y + 8);
131:
132:
133: if (item.isSelected())
134: {
135: g.setColor(MetalLookAndFeel.getBlack());
136: g.fillRect(x + 2, y + 2, 2, 5);
137: for (int i = 0; i < 6; i++)
138: g.drawLine(x + 8 - i, y + i, x + 9 - i, y + i);
139: }
140:
141: }
142: }
143:
144:
150: private static class FileChooserDetailViewIcon implements Icon, Serializable
151: {
152:
153:
156: public FileChooserDetailViewIcon()
157: {
158:
159: }
160:
161:
166: public int getIconWidth()
167: {
168: return 18;
169: }
170:
171:
176: public int getIconHeight()
177: {
178: return 18;
179: }
180:
181:
189: public void paintIcon(Component c, Graphics g, int x, int y)
190: {
191: Color savedColor = g.getColor();
192: g.setColor(MetalLookAndFeel.getBlack());
193:
194:
195: g.drawLine(x + 2, y + 2, x + 5, y + 2);
196: g.drawLine(x + 6, y + 3, x + 6, y + 7);
197: g.drawLine(x + 2, y + 7, x + 6, y + 7);
198: g.drawLine(x + 2, y + 2, x + 2, y + 7);
199:
200:
201: g.drawLine(x + 2, y + 10, x + 5, y + 10);
202: g.drawLine(x + 6, y + 11, x + 6, y + 15);
203: g.drawLine(x + 2, y + 15, x + 6, y + 15);
204: g.drawLine(x + 2, y + 10, x + 2, y + 15);
205:
206:
207: g.drawLine(x + 8, y + 5, x + 15, y + 5);
208: g.drawLine(x + 8, y + 13, x + 15, y + 13);
209:
210:
211: g.setColor(MetalLookAndFeel.getPrimaryControl());
212: g.fillRect(x + 3, y + 3, 3, 4);
213: g.fillRect(x + 3, y + 11, 3, 4);
214:
215:
216: g.setColor(MetalLookAndFeel.getPrimaryControlHighlight());
217: g.drawLine(x + 4, y + 4, x + 4, y + 5);
218: g.drawLine(x + 4, y + 12, x + 4, y + 13);
219:
220: g.setColor(savedColor);
221: }
222: }
223:
224:
230: private static class FileChooserHomeFolderIcon implements Icon, Serializable
231: {
232:
233:
236: public FileChooserHomeFolderIcon()
237: {
238:
239: }
240:
241:
246: public int getIconWidth()
247: {
248: return 18;
249: }
250:
251:
256: public int getIconHeight()
257: {
258: return 18;
259: }
260:
261:
269: public void paintIcon(Component c, Graphics g, int x, int y)
270: {
271: Color savedColor = g.getColor();
272: g.setColor(MetalLookAndFeel.getBlack());
273:
274:
275: g.drawLine(x + 1, y + 8, x + 8, y + 1);
276: g.drawLine(x + 8, y + 1, x + 15, y + 8);
277:
278:
279: g.drawLine(x + 3, y + 6, x + 3, y + 15);
280: g.drawLine(x + 3, y + 15, x + 13, y + 15);
281: g.drawLine(x + 13, y + 6, x + 13, y + 15);
282:
283:
284: g.drawLine(x + 6, y + 9, x + 6, y + 15);
285: g.drawLine(x + 6, y + 9, x + 10, y + 9);
286: g.drawLine(x + 10, y + 9, x + 10, y + 15);
287:
288:
289: g.drawLine(x + 11, y + 2, x + 11, y + 4);
290: g.drawLine(x + 12, y + 2, x + 12, y + 5);
291:
292: g.setColor(MetalLookAndFeel.getControlDarkShadow());
293:
294:
295: int xx = x + 8;
296: for (int i = 0; i < 4; i++)
297: g.drawLine(xx - i, y + 2 + i, xx + i, y + 2 + i);
298: g.fillRect(x + 4, y + 6, 9, 2);
299:
300:
301: g.drawLine(x + 9, y + 12, x + 9, y + 12);
302:
303:
304: g.setColor(MetalLookAndFeel.getPrimaryControl());
305: g.drawLine(x + 4, y + 8, x + 12, y + 8);
306: g.fillRect(x + 4, y + 9, 2, 6);
307: g.fillRect(x + 11, y + 9, 2, 6);
308:
309: g.setColor(savedColor);
310: }
311: }
312:
313:
319: private static class FileChooserListViewIcon implements Icon, Serializable
320: {
321:
324: public FileChooserListViewIcon()
325: {
326:
327: }
328:
329:
334: public int getIconWidth()
335: {
336: return 18;
337: }
338:
339:
344: public int getIconHeight()
345: {
346: return 18;
347: }
348:
349:
357: public void paintIcon(Component c, Graphics g, int x, int y)
358: {
359: Color savedColor = g.getColor();
360: g.setColor(MetalLookAndFeel.getBlack());
361:
362:
363: g.drawLine(x + 2, y + 2, x + 5, y + 2);
364: g.drawLine(x + 6, y + 3, x + 6, y + 7);
365: g.drawLine(x + 2, y + 7, x + 6, y + 7);
366: g.drawLine(x + 2, y + 2, x + 2, y + 7);
367:
368:
369: g.drawLine(x + 2, y + 10, x + 5, y + 10);
370: g.drawLine(x + 6, y + 11, x + 6, y + 15);
371: g.drawLine(x + 2, y + 15, x + 6, y + 15);
372: g.drawLine(x + 2, y + 10, x + 2, y + 15);
373:
374:
375: g.drawLine(x + 10, y + 2, x + 13, y + 2);
376: g.drawLine(x + 14, y + 3, x + 14, y + 7);
377: g.drawLine(x + 10, y + 7, x + 14, y + 7);
378: g.drawLine(x + 10, y + 2, x + 10, y + 7);
379:
380:
381: g.drawLine(x + 10, y + 10, x + 13, y + 10);
382: g.drawLine(x + 14, y + 11, x + 14, y + 15);
383: g.drawLine(x + 10, y + 15, x + 14, y + 15);
384: g.drawLine(x + 10, y + 10, x + 10, y + 15);
385:
386: g.drawLine(x + 8, y + 5, x + 8, y + 5);
387: g.drawLine(x + 8, y + 13, x + 8, y + 13);
388: g.drawLine(x + 16, y + 5, x + 16, y + 5);
389: g.drawLine(x + 16, y + 13, x + 16, y + 13);
390:
391:
392: g.setColor(MetalLookAndFeel.getPrimaryControl());
393: g.fillRect(x + 3, y + 3, 3, 4);
394: g.fillRect(x + 3, y + 11, 3, 4);
395: g.fillRect(x + 11, y + 3, 3, 4);
396: g.fillRect(x + 11, y + 11, 3, 4);
397:
398:
399: g.setColor(MetalLookAndFeel.getPrimaryControlHighlight());
400: g.drawLine(x + 4, y + 4, x + 4, y + 5);
401: g.drawLine(x + 4, y + 12, x + 4, y + 13);
402: g.drawLine(x + 12, y + 4, x + 12, y + 5);
403: g.drawLine(x + 12, y + 12, x + 12, y + 13);
404:
405: g.setColor(savedColor);
406: }
407: }
408:
409:
415: private static class FileChooserNewFolderIcon implements Icon, Serializable
416: {
417:
420: public FileChooserNewFolderIcon()
421: {
422:
423: }
424:
425:
430: public int getIconWidth()
431: {
432: return 18;
433: }
434:
435:
440: public int getIconHeight()
441: {
442: return 18;
443: }
444:
445:
453: public void paintIcon(Component c, Graphics g, int x, int y)
454: {
455: Color savedColor = g.getColor();
456: g.setColor(MetalLookAndFeel.getBlack());
457:
458: g.drawLine(x + 2, y + 5, x + 9, y + 5);
459: g.drawLine(x + 10, y + 6, x + 15, y + 6);
460: g.drawLine(x + 15, y + 5, x + 15, y + 14);
461: g.drawLine(x + 2, y + 14, x + 15, y + 14);
462: g.drawLine(x + 1, y + 6, x + 1, y + 14);
463:
464: g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());
465: g.drawLine(x + 11, y + 3, x + 15, y + 3);
466: g.drawLine(x + 10, y + 4, x + 15, y + 4);
467:
468: g.setColor(MetalLookAndFeel.getPrimaryControl());
469: g.fillRect(x + 3, y + 7, 7, 7);
470: g.fillRect(x + 10, y + 8, 5, 6);
471: g.drawLine(x + 10, y + 5, x + 14, y + 5);
472:
473: g.setColor(MetalLookAndFeel.getPrimaryControlHighlight());
474: g.drawLine(x + 10, y + 7, x + 14, y + 7);
475: g.drawLine(x + 2, y + 6, x + 9, y + 6);
476: g.drawLine(x + 2, y + 6, x + 2, y + 13);
477: g.setColor(savedColor);
478: }
479: }
480:
481:
487: private static class FileChooserUpFolderIcon extends FileChooserNewFolderIcon
488: implements Icon, Serializable
489: {
490:
493: public FileChooserUpFolderIcon()
494: {
495:
496: }
497:
498:
506: public void paintIcon(Component c, Graphics g, int x, int y)
507: {
508: Color savedColor = g.getColor();
509:
510:
511: super.paintIcon(c, g, x, y);
512:
513:
514: g.setColor(MetalLookAndFeel.getBlack());
515: g.drawLine(x + 8, y + 9, x + 8, y + 16);
516: int xx = x + 8;
517: for (int i = 0; i < 4; i++)
518: g.drawLine(xx - i, y + 9 + i, xx + i, y + 9 + i);
519: g.setColor(savedColor);
520: }
521: }
522:
523:
527: public static class FileIcon16 implements Icon, Serializable
528: {
529:
534: public int getIconWidth()
535: {
536: return 16;
537: }
538:
539:
546: public int getIconHeight()
547: {
548: return 16 + getAdditionalHeight();
549: }
550:
551:
559: public void paintIcon(Component c, Graphics g, int x, int y)
560: {
561:
562: g.setColor(Color.black);
563: g.drawLine(x, y, x + 9, y);
564: g.drawLine(x, y + 1, x, y + 15);
565: g.drawLine(x, y + 15, x + 12, y + 15);
566: g.drawLine(x + 12, y + 15, x + 12, y + 6);
567: g.drawLine(x + 12, y + 6, x + 9, y);
568:
569: g.drawLine(x + 7, y + 2, x + 11, y + 6);
570: g.drawLine(x + 8, y + 1, x + 9, y + 1);
571:
572: g.setColor(new Color(204, 204, 255));
573: g.drawLine(x + 1, y + 1, x + 7, y + 1);
574: g.drawLine(x + 1, y + 1, x + 1, y + 14);
575: g.drawLine(x + 1, y + 14, x + 11, y + 14);
576: g.drawLine(x + 11, y + 14, x + 11, y + 7);
577: g.drawLine(x + 8, y + 2, x + 10, y + 4);
578: }
579:
580:
587: public int getAdditionalHeight()
588: {
589: return 0;
590: }
591:
592:
597: public int getShift()
598: {
599: return 0;
600: }
601:
602: }
603:
604:
607: public static class FolderIcon16 implements Icon, Serializable
608: {
609:
614: public int getIconWidth() {
615: return 16;
616: }
617:
618:
625: public int getIconHeight()
626: {
627: return 16 + getAdditionalHeight();
628: }
629:
630:
638: public void paintIcon(Component c, Graphics g, int x, int y)
639: {
640:
641: g.setColor(Color.black);
642: g.drawLine(x, y + 3, x, y + 12);
643: g.drawLine(x, y + 12, x + 15, y + 12);
644: g.drawLine(x + 15, y + 12, x + 15, y + 2);
645: g.drawLine(x + 14, y + 3, x + 9, y + 3);
646: g.drawLine(x + 8, y + 2, x + 1, y + 2);
647: g.setColor(new Color(204, 204, 255));
648: g.fillRect(x + 2, y + 4, 7, 8);
649: g.fillRect(x + 9, y + 5, 6, 7);
650: g.setColor(new Color(102, 102, 153));
651: g.drawLine(x + 9, y + 2, x + 14, y + 2);
652: g.setColor(new Color(50, 50, 120));
653: g.drawLine(x + 9, y + 1, x + 15, y + 1);
654: g.drawLine(x + 10, y, x + 15, y);
655: }
656:
657:
664: public int getAdditionalHeight()
665: {
666: return 0;
667: }
668:
669:
674: public int getShift()
675: {
676: return 0;
677: }
678:
679: }
680:
681:
687: public static class PaletteCloseIcon
688: implements Icon, Serializable, UIResource
689: {
690:
695: public int getIconWidth()
696: {
697: return 7;
698: }
699:
700:
705: public int getIconHeight()
706: {
707: return 7;
708: }
709:
710:
718: public void paintIcon(Component c, Graphics g, int x, int y)
719: {
720: Color savedColor = g.getColor();
721: AbstractButton button = (AbstractButton) c;
722: if (button.getModel().isPressed())
723: g.setColor(MetalLookAndFeel.getBlack());
724: else
725: g.setColor(MetalLookAndFeel.getControlDarkShadow());
726: g.fillRect(x + 2, y + 2, 3, 3);
727: g.drawLine(x + 1, y, x + 1, y + 2);
728: g.drawLine(x, y + 1, x + 2, y + 1);
729: g.drawLine(x + 5, y, x + 5, y + 2);
730: g.drawLine(x + 4, y + 1, x + 6, y + 1);
731: g.drawLine(x + 1, y + 4, x + 1, y + 6);
732: g.drawLine(x, y + 5, x + 2, y + 5);
733: g.drawLine(x + 5, y + 4, x + 5, y + 6);
734: g.drawLine(x + 4, y + 5, x + 6, y + 5);
735: g.setColor(MetalLookAndFeel.getControlHighlight());
736: g.drawLine(x + 2, y + 6, x + 3, y + 5);
737: g.drawLine(x + 5, y + 3, x + 6, y + 2);
738: g.drawLine(x + 6, y + 6, x + 6, y + 6);
739: g.setColor(savedColor);
740: }
741: }
742:
743:
749: static class RadioButtonIcon implements Icon, UIResource, Serializable
750: {
751:
752:
757: public int getIconWidth()
758: {
759: return 13;
760: }
761:
762:
767: public int getIconHeight()
768: {
769: return 13;
770: }
771:
772:
782: public void paintIcon(Component c, Graphics g, int x, int y)
783: {
784: if (UIManager.get("RadioButton.gradient") != null)
785: MetalUtils.paintGradient(g, x, y, getIconWidth(), getIconHeight(),
786: SwingConstants.VERTICAL, "RadioButton.gradient");
787:
788: Color savedColor = g.getColor();
789: JRadioButton b = (JRadioButton) c;
790:
791:
792: if (b.isEnabled())
793: g.setColor(MetalLookAndFeel.getControlDarkShadow());
794: else
795: g.setColor(MetalLookAndFeel.getControlDisabled());
796: g.drawLine(x + 2, y + 1, x + 3, y + 1);
797: g.drawLine(x + 4, y, x + 7, y);
798: g.drawLine(x + 8, y + 1, x + 9, y + 1);
799: g.drawLine(x + 10, y + 2, x + 10, y + 3);
800: g.drawLine(x + 11, y + 4, x + 11, y + 7);
801: g.drawLine(x + 10, y + 8, x + 10, y + 9);
802: g.drawLine(x + 8, y + 10, x + 9, y + 10);
803: g.drawLine(x + 4, y + 11, x + 7, y + 11);
804: g.drawLine(x + 2, y + 10, x + 3, y + 10);
805: g.drawLine(x + 1, y + 9, x + 1, y + 8);
806: g.drawLine(x, y + 7, x, y + 4);
807: g.drawLine(x + 1, y + 2, x + 1, y + 3);
808:
809: if (b.getModel().isArmed())
810: {
811: g.setColor(MetalLookAndFeel.getControlShadow());
812: g.drawLine(x + 4, y + 1, x + 7, y + 1);
813: g.drawLine(x + 4, y + 10, x + 7, y + 10);
814: g.drawLine(x + 1, y + 4, x + 1, y + 7);
815: g.drawLine(x + 10, y + 4, x + 10, y + 7);
816: g.fillRect(x + 2, y + 2, 8, 8);
817: }
818: else
819: {
820:
821: if (b.isEnabled())
822: {
823: g.setColor(MetalLookAndFeel.getWhite());
824:
825: g.drawLine(x + 2, y + 8, x + 2, y + 9);
826: g.drawLine(x + 1, y + 4, x + 1, y + 7);
827: g.drawLine(x + 2, y + 2, x + 2, y + 3);
828: g.drawLine(x + 3, y + 2, x + 3, y + 2);
829: g.drawLine(x + 4, y + 1, x + 7, y + 1);
830: g.drawLine(x + 8, y + 2, x + 9, y + 2);
831: }
832: }
833:
834:
835: if (b.isEnabled())
836: {
837: g.setColor(MetalLookAndFeel.getWhite());
838:
839:
840: g.drawLine(x + 10, y + 1, x + 10, y + 1);
841: g.drawLine(x + 11, y + 2, x + 11, y + 3);
842: g.drawLine(x + 12, y + 4, x + 12, y + 7);
843: g.drawLine(x + 11, y + 8, x + 11, y + 9);
844: g.drawLine(x + 10, y + 10, x + 10, y + 10);
845: g.drawLine(x + 8, y + 11, x + 9, y + 11);
846: g.drawLine(x + 4, y + 12, x + 7, y + 12);
847: g.drawLine(x + 2, y + 11, x + 3, y + 11);
848: }
849:
850: if (b.isSelected())
851: {
852: if (b.isEnabled())
853: g.setColor(MetalLookAndFeel.getBlack());
854: else
855: g.setColor(MetalLookAndFeel.getControlDisabled());
856: g.drawLine(x + 4, y + 3, x + 7, y + 3);
857: g.fillRect(x + 3, y + 4, 6, 4);
858: g.drawLine(x + 4, y + 8, x + 7, y + 8);
859: }
860: g.setColor(savedColor);
861: }
862: }
863:
864:
867: private static class RadioButtonMenuItemIcon implements Icon, Serializable
868: {
869:
872: public RadioButtonMenuItemIcon()
873: {
874:
875: }
876:
877:
882: public int getIconWidth()
883: {
884: return 10;
885: }
886:
887:
892: public int getIconHeight()
893: {
894: return 10;
895: }
896:
897:
905: public void paintIcon(Component c, Graphics g, int x, int y)
906: {
907: Color savedColor = g.getColor();
908: JRadioButtonMenuItem item = (JRadioButtonMenuItem) c;
909: g.setColor(MetalLookAndFeel.getBlack());
910: g.drawLine(x + 2, y, x + 6, y);
911: g.drawLine(x + 7, y + 1, x + 7, y + 1);
912: g.drawLine(x + 8, y + 2, x + 8, y + 6);
913: g.drawLine(x + 7, y + 7, x + 7, y + 7);
914: g.drawLine(x + 2, y + 8, x + 6, y + 8);
915: g.drawLine(x + 1, y + 7, x + 1, y + 7);
916: g.drawLine(x, y + 2, x, y + 6);
917: g.drawLine(x + 1, y + 1, x + 1, y + 1);
918:
919: if (item.isSelected())
920: {
921: g.drawLine(x + 3, y + 2, x + 5, y + 2);
922: g.fillRect(x + 2, y + 3, 5, 3);
923: g.drawLine(x + 3, y + 6, x + 5, y + 6);
924: }
925:
926:
927: g.setColor(MetalLookAndFeel.getControlHighlight());
928: g.drawLine(x + 3, y + 1, x + 6, y + 1);
929: g.drawLine(x + 8, y + 1, x + 8, y + 1);
930: g.drawLine(x + 9, y + 2, x + 9, y + 7);
931: g.drawLine(x + 8, y + 8, x + 8, y + 8);
932: g.drawLine(x + 2, y + 9, x + 7, y + 9);
933: g.drawLine(x + 1, y + 8, x + 1, y + 8);
934: g.drawLine(x + 1, y + 3, x + 1, y + 6);
935: g.drawLine(x + 2, y + 2, x + 2, y + 2);
936: g.setColor(savedColor);
937: }
938: }
939:
940:
944: private static class HorizontalSliderThumbIcon implements Icon, Serializable
945: {
946:
947:
950: public HorizontalSliderThumbIcon()
951: {
952:
953: }
954:
955:
960: public int getIconWidth()
961: {
962: return 15;
963: }
964:
965:
970: public int getIconHeight()
971: {
972: return 16;
973: }
974:
975:
984: public void paintIcon(Component c, Graphics g, int x, int y)
985: {
986: boolean enabled = false;
987: boolean focus = false;
988: if (c != null)
989: {
990: enabled = c.isEnabled();
991: focus = c.hasFocus();
992: }
993:
994:
995: if (enabled)
996: g.setColor(MetalLookAndFeel.getBlack());
997: else
998: g.setColor(MetalLookAndFeel.getControlDarkShadow());
999: g.drawLine(x + 1, y, x + 13, y);
1000: g.drawLine(x + 14, y + 1, x + 14, y + 7);
1001: g.drawLine(x + 14, y + 8, x + 7, y + 15);
1002: g.drawLine(x + 6, y + 14, x, y + 8);
1003: g.drawLine(x, y + 7, x, y + 1);
1004:
1005:
1006: if (focus)
1007: g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
1008: else
1009: g.setColor(MetalLookAndFeel.getControl());
1010: g.fillRect(x + 1, y + 2, 13, 7);
1011: g.drawLine(x + 2, y + 9, x + 12, y + 9);
1012: g.drawLine(x + 3, y + 10, x + 11, y + 10);
1013: g.drawLine(x + 4, y + 11, x + 10, y + 11);
1014: g.drawLine(x + 5, y + 12, x + 9, y + 12);
1015: g.drawLine(x + 6, y + 13, x + 8, y + 13);
1016: g.drawLine(x + 7, y + 14, x + 7, y + 14);
1017:
1018:
1019: if (c.isEnabled())
1020: {
1021: if (focus)
1022: g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());
1023: else
1024: g.setColor(MetalLookAndFeel.getBlack());
1025: g.drawLine(x + 3, y + 3, x + 3, y + 3);
1026: g.drawLine(x + 7, y + 3, x + 7, y + 3);
1027: g.drawLine(x + 11, y + 3, x + 11, y + 3);
1028:
1029: g.drawLine(x + 5, y + 5, x + 5, y + 5);
1030: g.drawLine(x + 9, y + 5, x + 9, y + 5);
1031:
1032: g.drawLine(x + 3, y + 7, x + 3, y + 7);
1033: g.drawLine(x + 7, y + 7, x + 7, y + 7);
1034: g.drawLine(x + 11, y + 7, x + 11, y + 7);
1035:
1036:
1037: if (focus)
1038: g.setColor(MetalLookAndFeel.getPrimaryControl());
1039: else
1040: g.setColor(MetalLookAndFeel.getWhite());
1041: g.drawLine(x + 1, y + 1, x + 13, y + 1);
1042: g.drawLine(x + 1, y + 2, x + 1, y + 8);
1043: g.drawLine(x + 2, y + 2, x + 2, y + 2);
1044: g.drawLine(x + 6, y + 2, x + 6, y + 2);
1045: g.drawLine(x + 10, y + 2, x + 10, y + 2);
1046:
1047: g.drawLine(x + 4, y + 4, x + 4, y + 4);
1048: g.drawLine(x + 8, y + 4, x + 8, y + 4);
1049:
1050: g.drawLine(x + 2, y + 6, x + 2, y + 6);
1051: g.drawLine(x + 6, y + 6, x + 6, y + 6);
1052: g.drawLine(x + 10, y + 6, x + 10, y + 6);
1053: }
1054:
1055: }
1056: }
1057:
1058:
1062: private static class InternalFrameCloseIcon implements Icon, Serializable
1063: {
1064:
1065: private int size;
1066:
1067:
1072: public InternalFrameCloseIcon(int size)
1073: {
1074: this.size = size;
1075: }
1076:
1077:
1082: public int getIconWidth()
1083: {
1084: return size;
1085: }
1086:
1087:
1092: public int getIconHeight()
1093: {
1094: return size;
1095: }
1096:
1097:
1105: public void paintIcon(Component c, Graphics g, int x, int y)
1106: {
1107: Color savedColor = g.getColor();
1108: AbstractButton b = (AbstractButton) c;
1109:
1110:
1111: if (b.getModel().isPressed())
1112:
1113:
1114: g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
1115: else
1116: g.setColor(MetalLookAndFeel.getPrimaryControl());
1117: g.fillRect(x + 2, y + 2, 10, 10);
1118:
1119:
1120: if (b.getModel().isPressed())
1121: g.setColor(MetalLookAndFeel.getBlack());
1122: else
1123: {
1124:
1125:
1126: boolean selected = true;
1127: if (selected)
1128: g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());
1129: else
1130: g.setColor(MetalLookAndFeel.getControlDarkShadow());
1131: }
1132: g.drawLine(x + 1, y + 1, x + 13, y + 1);
1133: g.drawLine(x + 1, y + 2, x + 1, y + 12);
1134: g.drawLine(x + 1, y + 13, x + 13, y + 13);
1135: g.drawLine(x + 13, y + 2, x + 13, y + 12);
1136: g.drawLine(x + 2, y + 12, x + 2, y + 12);
1137: g.drawLine(x + 12, y + 2, x + 12, y + 2);
1138:
1139: g.fillRect(x + 4, y + 4, 2, 2);
1140: g.fillRect(x + 5, y + 5, 4, 4);
1141: g.drawLine(x + 9, y + 4, x + 10, y + 4);
1142: g.drawLine(x + 9, y + 4, x + 9, y + 5);
1143: g.drawLine(x + 4, y + 9, x + 4, y + 10);
1144: g.drawLine(x + 4, y + 9, x + 5, y + 9);
1145: g.drawLine(x + 9, y + 8, x + 9, y + 10);
1146: g.drawLine(x + 8, y + 9, x + 10, y + 9);
1147:
1148: g.setColor(MetalLookAndFeel.getBlack());
1149: g.drawLine(x, y, x + 13, y);
1150: g.drawLine(x, y + 1, x, y + 13);
1151: g.drawLine(x + 3, y + 4, x + 4, y + 3);
1152: g.drawLine(x + 3, y + 9, x + 5, y + 7);
1153: g.drawLine(x + 7, y + 5, x + 9, y + 3);
1154:
1155: g.drawLine(x + 12, y + 3, x + 12, y + 11);
1156: g.drawLine(x + 3, y + 12, x + 12, y + 12);
1157:
1158: g.setColor(MetalLookAndFeel.getWhite());
1159: g.drawLine(x + 1, y + 14, x + 14, y + 14);
1160: g.drawLine(x + 14, y + 1, x + 14, y + 14);
1161:
1162: if (!b.getModel().isPressed())
1163: {
1164: g.drawLine(x + 5, y + 10, x + 5, y + 10);
1165: g.drawLine(x + 6, y + 9, x + 7, y + 9);
1166: g.drawLine(x + 10, y + 5, x + 10, y + 5);
1167: g.drawLine(x + 9, y + 6, x + 9, y + 7);
1168: g.drawLine(x + 10, y + 10, x + 11, y + 10);
1169: g.drawLine(x + 10, y + 11, x + 10, y + 11);
1170: }
1171: g.setColor(savedColor);
1172: }
1173: }
1174:
1175:
1178: private static class InternalFrameDefaultMenuIcon
1179: implements Icon, Serializable
1180: {
1181:
1182:
1185: public InternalFrameDefaultMenuIcon()
1186: {
1187:
1188: }
1189:
1190:
1195: public int getIconWidth()
1196: {
1197: return 16;
1198: }
1199:
1200:
1205: public int getIconHeight()
1206: {
1207: return 16;
1208: }
1209:
1210:
1218: public void paintIcon(Component c, Graphics g, int x, int y)
1219: {
1220: g.setColor(new Color(102, 102, 153));
1221: g.fillRect(x + 1, y, 14, 2);
1222: g.fillRect(x, y + 1, 2, 14);
1223: g.fillRect(x + 1, y + 14, 14, 2);
1224: g.fillRect(x + 14, y + 1, 2, 14);
1225: g.drawLine(x + 2, y + 5, x + 14, y + 5);
1226:
1227: g.setColor(new Color(204, 204, 255));
1228: g.fillRect(x + 2, y + 2, 12, 3);
1229:
1230: g.setColor(new Color(102, 102, 153));
1231: g.drawLine(x + 3, y + 3, x + 3, y + 3);
1232: g.drawLine(x + 6, y + 3, x + 6, y + 3);
1233: g.drawLine(x + 9, y + 3, x + 9, y + 3);
1234: g.drawLine(x + 12, y + 3, x + 12, y + 3);
1235:
1236: g.setColor(Color.white);
1237: g.fillRect(x + 2, y + 6, 12, 8);
1238: g.drawLine(x + 2, y + 2, x + 2, y + 2);
1239: g.drawLine(x + 5, y + 2, x + 5, y + 2);
1240: g.drawLine(x + 8, y + 2, x + 8, y + 2);
1241: g.drawLine(x + 11, y + 2, x + 11, y + 2);
1242: }
1243: }
1244:
1245:
1250: private static class InternalFrameAltMaximizeIcon
1251: implements Icon, Serializable
1252: {
1253:
1254: private int size;
1255:
1256:
1261: public InternalFrameAltMaximizeIcon(int size)
1262: {
1263: this.size = size;
1264: }
1265:
1266:
1271: public int getIconWidth()
1272: {
1273: return size;
1274: }
1275:
1276:
1281: public int getIconHeight()
1282: {
1283: return size;
1284: }
1285:
1286:
1294: public void paintIcon(Component c, Graphics g, int x, int y)
1295: {
1296: Color savedColor = g.getColor();
1297:
1298: AbstractButton b = (AbstractButton) c;
1299:
1300:
1301: if (b.getModel().isPressed())
1302: g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
1303: else
1304: g.setColor(MetalLookAndFeel.getPrimaryControl());
1305: g.fillRect(x + 2, y + 6, 7, 7);
1306:
1307:
1308: if (b.getModel().isPressed())
1309: g.setColor(MetalLookAndFeel.getBlack());
1310: else
1311: g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());
1312:
1313: g.drawLine(x + 12, y + 1, x + 13, y + 1);
1314: g.drawLine(x + 11, y + 2, x + 12, y + 2);
1315: g.drawLine(x + 10, y + 3, x + 11, y + 3);
1316: g.drawLine(x + 8, y + 2, x + 8, y + 3);
1317: g.fillRect(x + 8, y + 4, 3, 3);
1318: g.drawLine(x + 11, y + 6, x + 12, y + 6);
1319:
1320: g.drawLine(x + 1, y + 5, x + 5, y + 5);
1321: g.drawLine(x + 1, y + 6, x + 1, y + 12);
1322: g.drawLine(x + 9, y + 9, x + 9, y + 12);
1323: g.drawLine(x + 1, y + 13, x + 9, y + 13);
1324:
1325: g.drawLine(x + 2, y + 12, x + 2, y + 12);
1326:
1327: g.setColor(MetalLookAndFeel.getBlack());
1328: g.drawLine(x + 12, y, x + 9, y + 3);
1329: g.drawLine(x + 7, y + 1, x + 8, y + 1);
1330: g.drawLine(x + 7, y + 2, x + 7, y + 6);
1331: g.drawLine(x + 11, y + 5, x + 12, y + 5);
1332: g.drawLine(x, y + 4, x + 5, y + 4);
1333: g.drawLine(x, y + 5, x, y + 13);
1334: g.drawLine(x + 3, y + 12, x + 8, y + 12);
1335: g.drawLine(x + 8, y + 8, x + 8, y + 11);
1336: g.drawLine(x + 9, y + 8, x + 9, y + 8);
1337:
1338: g.setColor(MetalLookAndFeel.getWhite());
1339: g.drawLine(x + 9, y + 2, x + 9, y + 2);
1340: g.drawLine(x + 11, y + 4, x + 13, y + 2);
1341: g.drawLine(x + 13, y + 6, x + 13, y + 6);
1342: g.drawLine(x + 8, y + 7, x + 13, y + 7);
1343: g.drawLine(x + 6, y + 5, x + 6, y + 5);
1344: g.drawLine(x + 10, y + 8, x + 10, y + 13);
1345: g.drawLine(x + 1, y + 14, x + 10, y + 14);
1346:
1347: if (!b.getModel().isPressed())
1348: {
1349: g.drawLine(x + 2, y + 6, x + 6, y + 6);
1350: g.drawLine(x + 2, y + 6, x + 2, y + 11);
1351: }
1352:
1353: g.setColor(savedColor);
1354: }
1355: }
1356:
1357:
1361: private static class InternalFrameMaximizeIcon implements Icon, Serializable
1362: {
1363:
1364:
1367: public InternalFrameMaximizeIcon()
1368: {
1369:
1370: }
1371:
1372:
1377: public int getIconWidth()
1378: {
1379: return 16;
1380: }
1381:
1382:
1387: public int getIconHeight()
1388: {
1389: return 16;
1390: }
1391:
1392:
1400: public void paintIcon(Component c, Graphics g, int x, int y)
1401: {
1402: Color savedColor = g.getColor();
1403:
1404: AbstractButton b = (AbstractButton) c;
1405:
1406:
1407: if (b.getModel().isPressed())
1408: g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
1409: else
1410: g.setColor(MetalLookAndFeel.getPrimaryControl());
1411: g.fillRect(x + 2, y + 6, 7, 7);
1412:
1413: if (b.getModel().isPressed())
1414: g.setColor(MetalLookAndFeel.getBlack());
1415: else
1416: g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());
1417:
1418: g.drawLine(x + 9, y + 1, x + 10, y + 1);
1419: g.fillRect(x + 11, y + 1, 3, 3);
1420: g.fillRect(x + 12, y + 4, 2, 2);
1421: g.drawLine(x + 10, y + 3, x + 10, y + 3);
1422: g.drawLine(x + 9, y + 4, x + 10, y + 4);
1423: g.drawLine(x + 1, y + 5, x + 9, y + 5);
1424: g.drawLine(x + 1, y + 6, x + 1, y + 12);
1425: g.drawLine(x + 9, y + 6, x + 9, y + 12);
1426: g.drawLine(x + 1, y + 13, x + 9, y + 13);
1427:
1428:
1429: g.drawLine(x + 7, y + 6, x + 8, y + 6);
1430: g.drawLine(x + 6, y + 7, x + 8, y + 7);
1431: g.drawLine(x + 5, y + 8, x + 6, y + 8);
1432: g.drawLine(x + 4, y + 9, x + 5, y + 9);
1433: g.drawLine(x + 3, y + 10, x + 4, y + 10);
1434: g.drawLine(x + 2, y + 11, x + 3, y + 11);
1435: g.drawLine(x + 2, y + 12, x + 4, y + 12);
1436: g.drawLine(x + 8, y + 8, x + 8, y + 8);
1437:
1438:
1439: g.setColor(MetalLookAndFeel.getBlack());
1440: g.drawLine(x + 8, y, x + 13, y);
1441: g.drawLine(x + 8, y + 1, x + 8, y + 1);
1442: g.drawLine(x + 10, y + 2, x + 9, y + 3);
1443: g.drawLine(x, y + 4, x + 8, y + 4);
1444: g.drawLine(x, y + 5, x, y + 13);
1445:
1446: g.drawLine(x + 2, y + 10, x + 6, y + 6);
1447: g.drawLine(x + 8, y + 9, x + 8, y + 11);
1448: g.drawLine(x + 5, y + 12, x + 8, y + 12);
1449:
1450:
1451: g.setColor(MetalLookAndFeel.getWhite());
1452: if (!b.getModel().isPressed())
1453: {
1454: g.drawLine(x + 2, y + 6, x + 5, y + 6);
1455: g.drawLine(x + 2, y + 7, x + 2, y + 9);
1456: g.drawLine(x + 4, y + 11, x + 7, y + 8);
1457: }
1458:
1459: g.drawLine(x + 1, y + 14, x + 10, y + 14);
1460: g.drawLine(x + 10, y + 5, x + 10, y + 13);
1461:
1462: g.drawLine(x + 9, y + 2, x + 9, y + 2);
1463: g.drawLine(x + 11, y + 4, x + 11, y + 5);
1464: g.drawLine(x + 13, y + 6, x + 14, y + 6);
1465: g.drawLine(x + 14, y + 1, x + 14, y + 5);
1466: g.setColor(savedColor);
1467: }
1468: }
1469:
1470:
1473: private static class InternalFrameMinimizeIcon implements Icon, Serializable
1474: {
1475:
1476:
1479: public InternalFrameMinimizeIcon()
1480: {
1481:
1482: }
1483:
1484:
1489: public int getIconWidth()
1490: {
1491: return 16;
1492: }
1493:
1494:
1499: public int getIconHeight()
1500: {
1501: return 16;
1502: }
1503:
1504:
1512: public void paintIcon(Component c, Graphics g, int x, int y)
1513: {
1514: Color savedColor = g.getColor();
1515:
1516: AbstractButton b = (AbstractButton) c;
1517:
1518: if (b.getModel().isPressed())
1519: g.setColor(MetalLookAndFeel.getBlack());
1520: else
1521:
1522:
1523: g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());
1524:
1525: g.drawLine(x + 12, y + 1, x + 13, y + 1);
1526: g.drawLine(x + 11, y + 2, x + 12, y + 2);
1527: g.drawLine(x + 10, y + 3, x + 11, y + 3);
1528: g.drawLine(x + 8, y + 2, x + 8, y + 3);
1529: g.fillRect(x + 8, y + 4, 3, 3);
1530: g.drawLine(x + 11, y + 6, x + 12, y + 6);
1531:
1532: g.drawLine(x + 1, y + 8, x + 6, y + 8);
1533: g.drawLine(x + 1, y + 9, x + 1, y + 12);
1534: g.drawLine(x + 6, y + 9, x + 6, y + 12);
1535: g.drawLine(x + 1, y + 13, x + 6, y + 13);
1536:
1537: g.drawLine(x + 5, y + 9, x + 5, y + 9);
1538: g.drawLine(x + 2, y + 12, x + 2, y + 12);
1539:
1540: g.setColor(MetalLookAndFeel.getBlack());
1541: g.drawLine(x + 12, y, x + 9, y + 3);
1542: g.drawLine(x + 7, y + 1, x + 8, y + 1);
1543: g.drawLine(x + 7, y + 2, x + 7, y + 6);
1544: g.drawLine(x, y + 7, x + 6, y + 7);
1545: g.drawLine(x, y + 8, x, y + 13);
1546: g.drawLine(x + 3, y + 12, x + 5, y + 12);
1547: g.drawLine(x + 5, y + 10, x + 5, y + 11);
1548: g.drawLine(x + 11, y + 5, x + 12, y + 5);
1549:
1550: g.setColor(MetalLookAndFeel.getWhite());
1551: g.drawLine(x + 9, y + 2, x + 9, y + 2);
1552: g.drawLine(x + 11, y + 4, x + 13, y + 2);
1553: g.drawLine(x + 13, y + 6, x + 13, y + 6);
1554: g.drawLine(x + 8, y + 7, x + 13, y + 7);
1555: g.drawLine(x + 7, y + 9, x + 7, y + 13);
1556: g.drawLine(x + 1, y + 14, x + 7, y + 14);
1557:
1558: if (b.getModel().isPressed())
1559: {
1560: g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
1561: g.fillRect(x + 2, y + 9, 3, 3);
1562: }
1563: else
1564: {
1565: g.drawLine(x + 2, y + 9, x + 4, y + 9);
1566: g.drawLine(x + 2, y + 10, x + 2, y + 11);
1567: }
1568:
1569: g.setColor(savedColor);
1570: }
1571: }
1572:
1573:
1577: private static class VerticalSliderThumbIcon implements Icon, Serializable
1578: {
1579:
1582: public VerticalSliderThumbIcon()
1583: {
1584:
1585: }
1586:
1587:
1592: public int getIconWidth()
1593: {
1594: return 16;
1595: }
1596:
1597:
1602: public int getIconHeight()
1603: {
1604: return 15;
1605: }
1606:
1607:
1617: public void paintIcon(Component c, Graphics g, int x, int y)
1618: {
1619: boolean enabled = false;
1620: boolean focus = false;
1621: if (c != null)
1622: {
1623: enabled = c.isEnabled();
1624: focus = c.hasFocus();
1625: }
1626:
1627:
1628: if (enabled)
1629: g.setColor(MetalLookAndFeel.getBlack());
1630: else
1631: g.setColor(MetalLookAndFeel.getControlDarkShadow());
1632: g.drawLine(x + 1, y, x + 7, y);
1633: g.drawLine(x + 8, y, x + 15, y + 7);
1634: g.drawLine(x + 14, y + 8, x + 8, y + 14);
1635: g.drawLine(x + 8, y + 14, x + 1, y + 14);
1636: g.drawLine(x, y + 13, x, y + 1);
1637:
1638:
1639: if (focus)
1640: g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
1641: else
1642: g.setColor(MetalLookAndFeel.getControl());
1643: g.fillRect(x + 2, y + 1, 7, 13);
1644: g.drawLine(x + 9, y + 2, x + 9, y + 12);
1645: g.drawLine(x + 10, y + 3, x + 10, y + 11);
1646: g.drawLine(x + 11, y + 4, x + 11, y + 10);
1647: g.drawLine(x + 12, y + 5, x + 12, y + 9);
1648: g.drawLine(x + 13, y + 6, x + 13, y + 8);
1649: g.drawLine(x + 14, y + 7, x + 14, y + 7);
1650:
1651:
1652: if (enabled)
1653: {
1654: if (focus)
1655: g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());
1656: else
1657: g.setColor(MetalLookAndFeel.getBlack());
1658: g.drawLine(x + 3, y + 3, x + 3, y + 3);
1659: g.drawLine(x + 3, y + 7, x + 3, y + 7);
1660: g.drawLine(x + 3, y + 11, x + 3, y + 11);
1661:
1662: g.drawLine(x + 5, y + 5, x + 5, y + 5);
1663: g.drawLine(x + 5, y + 9, x + 5, y + 9);
1664:
1665: g.drawLine(x + 7, y + 3, x + 7, y + 3);
1666: g.drawLine(x + 7, y + 7, x + 7, y + 7);
1667: g.drawLine(x + 7, y + 11, x + 7, y + 11);
1668:
1669:
1670: if (focus)
1671: g.setColor(MetalLookAndFeel.getPrimaryControl());
1672: else
1673: g.setColor(MetalLookAndFeel.getWhite());
1674: g.drawLine(x + 1, y + 1, x + 8, y + 1);
1675: g.drawLine(x + 1, y + 2, x + 1, y + 13);
1676: g.drawLine(x + 2, y + 2, x + 2, y + 2);
1677: g.drawLine(x + 2, y + 6, x + 2, y + 6);
1678: g.drawLine(x + 2, y + 10, x + 2, y + 10);
1679:
1680: g.drawLine(x + 4, y + 4, x + 4, y + 4);
1681: g.drawLine(x + 4, y + 8, x + 4, y + 8);
1682:
1683: g.drawLine(x + 6, y + 2, x + 6, y + 2);
1684: g.drawLine(x + 6, y + 6, x + 6, y + 6);
1685: g.drawLine(x + 6, y + 10, x + 6, y + 10);
1686:
1687: }
1688: }
1689: }
1690:
1691:
1695: public static class TreeControlIcon implements Icon, Serializable
1696: {
1697:
1698:
1699: protected boolean isLight;
1700:
1701:
1702: private boolean collapsed;
1703:
1704:
1710: public TreeControlIcon(boolean isCollapsed)
1711: {
1712: collapsed = isCollapsed;
1713: }
1714:
1715:
1720: public int getIconWidth()
1721: {
1722: return 18;
1723: }
1724:
1729: public int getIconHeight()
1730: {
1731: return 18;
1732: }
1733:
1734:
1742: public void paintIcon(Component c, Graphics g, int x, int y)
1743: {
1744: x = x + 5;
1745: y = y + 5;
1746: if (collapsed)
1747: {
1748:
1749: g.setColor(Color.black);
1750: g.drawLine(x + 2, y, x + 5, y);
1751: g.drawLine(x + 6, y + 1, x + 7, y + 2);
1752: g.fillRect(x + 7, y + 3, 5, 2);
1753: g.drawLine(x + 7, y + 5, x + 6, y + 6);
1754: g.drawLine(x + 1, y + 1, x + 1, y + 1);
1755: g.drawLine(x, y + 2, x, y + 5);
1756: g.drawLine(x + 1, y + 6, x + 1, y + 6);
1757: g.drawLine(x + 2, y + 7, x + 5, y + 7);
1758: g.fillRect(x + 3, y + 3, 2, 2);
1759:
1760: g.setColor(new Color(204, 204, 255));
1761: g.drawLine(x + 3, y + 2, x + 4, y + 2);
1762: g.drawLine(x + 2, y + 3, x + 2, y + 4);
1763: g.drawLine(x + 3, y + 5, x + 3, y + 5);
1764: g.drawLine(x + 5, y + 3, x + 5, y + 3);
1765:
1766: g.setColor(new Color(153, 153, 204));
1767: g.drawLine(x + 2, y + 2, x + 2, y + 2);
1768: g.drawLine(x + 2, y + 5, x + 2, y + 5);
1769: g.drawLine(x + 2, y + 6, x + 5, y + 6);
1770: g.drawLine(x + 5, y + 2, x + 5, y + 2);
1771: g.drawLine(x + 6, y + 2, x + 6, y + 5);
1772:
1773: g.setColor(new Color(102, 102, 153));
1774: g.drawLine(x + 2, y + 1, x + 5, y + 1);
1775: g.drawLine(x + 1, y + 2, x + 1, y + 5);
1776: }
1777: else
1778: {
1779:
1780: g.setColor(Color.black);
1781: g.drawLine(x + 2, y, x + 5, y);
1782: g.drawLine(x + 6, y + 1, x + 7, y + 2);
1783: g.drawLine(x + 7, y + 2, x + 7, y + 5);
1784: g.fillRect(x + 3, y + 7, 2, 5);
1785: g.drawLine(x + 7, y + 5, x + 6, y + 6);
1786: g.drawLine(x + 1, y + 1, x + 1, y + 1);
1787: g.drawLine(x, y + 2, x, y + 5);
1788: g.drawLine(x + 1, y + 6, x + 1, y + 6);
1789: g.drawLine(x + 2, y + 7, x + 5, y + 7);
1790: g.fillRect(x + 3, y + 3, 2, 2);
1791:
1792: g.setColor(new Color(204, 204, 255));
1793: g.drawLine(x + 3, y + 2, x + 4, y + 2);
1794: g.drawLine(x + 2, y + 3, x + 2, y + 4);
1795: g.drawLine(x + 3, y + 5, x + 3, y + 5);
1796: g.drawLine(x + 5, y + 3, x + 5, y + 3);
1797:
1798: g.setColor(new Color(153, 153, 204));
1799: g.drawLine(x + 2, y + 2, x + 2, y + 2);
1800: g.drawLine(x + 2, y + 5, x + 2, y + 5);
1801: g.drawLine(x + 2, y + 6, x + 5, y + 6);
1802: g.drawLine(x + 5, y + 2, x + 5, y + 2);
1803: g.drawLine(x + 6, y + 2, x + 6, y + 5);
1804:
1805: g.setColor(new Color(102, 102, 153));
1806: g.drawLine(x + 2, y + 1, x + 5, y + 1);
1807: g.drawLine(x + 1, y + 2, x + 1, y + 5);
1808: }
1809: }
1810:
1811:
1819: public void paintMe(Component c, Graphics g, int x, int y)
1820: {
1821: paintIcon(c, g, x, y);
1822: }
1823: }
1824:
1825:
1828: public static class TreeFolderIcon extends FolderIcon16
1829: {
1830:
1833: public TreeFolderIcon()
1834: {
1835:
1836: }
1837:
1838:
1844: public int getAdditionalHeight()
1845: {
1846: return 2;
1847: }
1848:
1849:
1854: public int getShift()
1855: {
1856: return -1;
1857: }
1858: }
1859:
1860:
1863: public static class TreeLeafIcon extends FileIcon16
1864: {
1865:
1868: public TreeLeafIcon()
1869: {
1870:
1871: }
1872:
1873:
1879: public int getAdditionalHeight()
1880: {
1881: return 4;
1882: }
1883:
1884:
1889: public int getShift()
1890: {
1891: return 2;
1892: }
1893: }
1894:
1895:
1900: private static class TreeHardDriveIcon implements Icon, Serializable
1901: {
1902:
1903:
1906: public TreeHardDriveIcon()
1907: {
1908:
1909: }
1910:
1911:
1916: public int getIconWidth()
1917: {
1918: return 16;
1919: }
1920:
1921:
1926: public int getIconHeight()
1927: {
1928: return 16;
1929: }
1930:
1931:
1940: public void paintIcon(Component c, Graphics g, int x, int y)
1941: {
1942: Color saved = g.getColor();
1943: g.setColor(MetalLookAndFeel.getBlack());
1944: g.drawLine(x + 1, y + 4, x + 1, y + 5);
1945: g.drawLine(x + 14, y + 4, x + 14, y + 5);
1946: g.drawLine(x + 1, y + 7, x + 1, y + 8);
1947: g.drawLine(x + 14, y + 7, x + 14, y + 8);
1948: g.drawLine(x + 1, y + 10, x + 1, y + 11);
1949: g.drawLine(x + 14, y + 10, x + 14, y + 11);
1950:
1951: g.drawLine(x + 2, y + 3, x + 3, y + 3);
1952: g.drawLine(x + 12, y + 3, x + 13, y + 3);
1953: g.drawLine(x + 2, y + 6, x + 3, y + 6);
1954: g.drawLine(x + 12, y + 6, x + 13, y + 6);
1955: g.drawLine(x + 2, y + 9, x + 3, y + 9);
1956: g.drawLine(x + 12, y + 9, x + 13, y + 9);
1957: g.drawLine(x + 2, y + 12, x + 3, y + 12);
1958: g.drawLine(x + 12, y + 12, x + 13, y + 12);
1959:
1960: g.drawLine(x + 4, y + 2, x + 11, y + 2);
1961: g.drawLine(x + 4, y + 7, x + 11, y + 7);
1962: g.drawLine(x + 4, y + 10, x + 11, y + 10);
1963: g.drawLine(x + 4, y + 13, x + 11, y + 13);
1964:
1965: g.setColor(MetalLookAndFeel.getWhite());
1966: g.fillRect(x + 4, y + 3, 2, 2);
1967: g.drawLine(x + 6, y + 4, x + 6, y + 4);
1968: g.drawLine(x + 7, y + 3, x + 9, y + 3);
1969: g.drawLine(x + 8, y + 4, x + 8, y + 4);
1970: g.drawLine(x + 11, y + 3, x + 11, y + 3);
1971: g.fillRect(x + 2, y + 4, 2, 2);
1972: g.fillRect(x + 2, y + 7, 2, 2);
1973: g.fillRect(x + 2, y + 10, 2, 2);
1974: g.drawLine(x + 4, y + 6, x + 4, y + 6);
1975: g.drawLine(x + 4, y + 9, x + 4, y + 9);
1976: g.drawLine(x + 4, y + 12, x + 4, y + 12);
1977:
1978: g.setColor(MetalLookAndFeel.getControlShadow());
1979: g.drawLine(x + 13, y + 4, x + 13, y + 4);
1980: g.drawLine(x + 12, y + 5, x + 13, y + 5);
1981: g.drawLine(x + 13, y + 7, x + 13, y + 7);
1982: g.drawLine(x + 12, y + 8, x + 13, y + 8);
1983: g.drawLine(x + 13, y + 10, x + 13, y + 10);
1984: g.drawLine(x + 12, y + 11, x + 13, y + 11);
1985:
1986: g.drawLine(x + 10, y + 5, x + 10, y + 5);
1987: g.drawLine(x + 7, y + 6, x + 7, y + 6);
1988: g.drawLine(x + 9, y + 6, x + 9, y + 6);
1989: g.drawLine(x + 11, y + 6, x + 11, y + 6);
1990:
1991: g.drawLine(x + 10, y + 8, x + 10, y + 8);
1992: g.drawLine(x + 7, y + 9, x + 7, y + 9);
1993: g.drawLine(x + 9, y + 9, x + 9, y + 9);
1994: g.drawLine(x + 11, y + 9, x + 11, y + 9);
1995:
1996: g.drawLine(x + 10, y + 11, x + 10, y + 11);
1997: g.drawLine(x + 7, y + 12, x + 7, y + 12);
1998: g.drawLine(x + 9, y + 12, x + 9, y + 12);
1999: g.drawLine(x + 11, y + 12, x + 11, y + 12);
2000:
2001: g.setColor(saved);
2002: }
2003: }
2004:
2005:
2010: private static class TreeFloppyDriveIcon implements Icon, Serializable
2011: {
2012:
2013:
2016: public TreeFloppyDriveIcon()
2017: {
2018:
2019: }
2020:
2021:
2026: public int getIconWidth()
2027: {
2028: return 16;
2029: }
2030:
2031:
2036: public int getIconHeight()
2037: {
2038: return 16;
2039: }
2040:
2041:
2050: public void paintIcon(Component c, Graphics g, int x, int y)
2051: {
2052: Color saved = g.getColor();
2053:
2054: g.setColor(MetalLookAndFeel.getBlack());
2055: g.drawLine(x + 1, y + 1, x + 13, y + 1);
2056: g.drawLine(x + 1, y + 1, x + 1, y + 14);
2057: g.drawLine(x + 1, y + 14, x + 14, y + 14);
2058: g.drawLine(x + 14, y + 2, x + 14, y + 14);
2059:
2060: g.setColor(MetalLookAndFeel.getPrimaryControl());
2061: g.fillRect(x + 2, y + 2, 12, 12);
2062:
2063: g.setColor(MetalLookAndFeel.getControlShadow());
2064: g.fillRect(x + 5, y + 2, 6, 5);
2065: g.drawLine(x + 4, y + 8, x + 11, y + 8);
2066: g.drawLine(x + 3, y + 9, x + 3, y + 13);
2067: g.drawLine(x + 12, y + 9, x + 12, y + 13);
2068:
2069: g.setColor(MetalLookAndFeel.getWhite());
2070: g.fillRect(x + 8, y + 3, 2, 3);
2071: g.fillRect(x + 4, y + 9, 8, 5);
2072:
2073: g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
2074: g.drawLine(x + 5, y + 10, x + 9, y + 10);
2075: g.drawLine(x + 5, y + 12, x + 8, y + 12);
2076:
2077: g.setColor(saved);
2078: }
2079: }
2080:
2081:
2086: private static class TreeComputerIcon implements Icon, Serializable
2087: {
2088:
2089:
2092: public TreeComputerIcon()
2093: {
2094:
2095: }
2096:
2097:
2102: public int getIconWidth()
2103: {
2104: return 16;
2105: }
2106:
2107:
2112: public int getIconHeight()
2113: {
2114: return 16;
2115: }
2116:
2117:
2126: public void paintIcon(Component c, Graphics g, int x, int y)
2127: {
2128: Color saved = g.getColor();
2129:
2130: g.setColor(MetalLookAndFeel.getBlack());
2131: g.drawLine(x + 3, y + 1, x + 12, y + 1);
2132: g.drawLine(x + 2, y + 2, x + 2, y + 8);
2133: g.drawLine(x + 13, y + 2, x + 13, y + 8);
2134: g.drawLine(x + 3, y + 9, x + 3, y + 9);
2135: g.drawLine(x + 12, y + 9, x + 12, y + 9);
2136: g.drawRect(x + 1, y + 10, 13, 4);
2137: g.drawLine(x + 5, y + 3, x + 10, y + 3);
2138: g.drawLine(x + 5, y + 8, x + 10, y + 8);
2139: g.drawLine(x + 4, y + 4, x + 4, y + 7);
2140: g.drawLine(x + 11, y + 4, x + 11, y + 7);
2141:
2142: g.setColor(MetalLookAndFeel.getPrimaryControl());
2143: g.fillRect(x + 5, y + 4, 6, 4);
2144:
2145: g.setColor(MetalLookAndFeel.getControlShadow());
2146: g.drawLine(x + 6, y + 12, x + 8, y + 12);
2147: g.drawLine(x + 10, y + 12, x + 12, y + 12);
2148: g.setColor(saved);
2149: }
2150: }
2151:
2152:
2153: private static Icon checkBoxIcon;
2154:
2155:
2156: private static Icon checkBoxMenuItemIcon;
2157:
2158:
2159: private static Icon fileChooserDetailViewIcon;
2160:
2161:
2162: private static Icon fileChooserHomeFolderIcon;
2163:
2164:
2165: private static Icon fileChooserListViewIcon;
2166:
2167:
2168: private static Icon fileChooserNewFolderIcon;
2169:
2170:
2171: private static Icon fileChooserUpFolderIcon;
2172:
2173:
2174: private static RadioButtonIcon radioButtonIcon;
2175:
2176:
2177: private static Icon radioButtonMenuItemIcon;
2178:
2179:
2180: private static Icon internalFrameDefaultMenuIcon;
2181:
2182:
2183: private static Icon treeComputerIcon;
2184:
2185:
2186: private static Icon treeFloppyDriveIcon;
2187:
2188:
2189: private static Icon treeHardDriveIcon;
2190:
2191:
2195: public MetalIconFactory()
2196: {
2197:
2198: }
2199:
2200:
2207: public static Icon getCheckBoxIcon()
2208: {
2209: if (checkBoxIcon == null)
2210: checkBoxIcon = new MetalCheckBoxIcon();
2211: return checkBoxIcon;
2212: }
2213:
2214:
2220: public static Icon getCheckBoxMenuItemIcon()
2221: {
2222: if (checkBoxMenuItemIcon == null)
2223: checkBoxMenuItemIcon = new CheckBoxMenuItemIcon();
2224: return checkBoxMenuItemIcon;
2225: }
2226:
2227:
2232: public static Icon getFileChooserDetailViewIcon()
2233: {
2234: if (fileChooserDetailViewIcon == null)
2235: fileChooserDetailViewIcon = new FileChooserDetailViewIcon();
2236: return fileChooserDetailViewIcon;
2237: }
2238:
2239:
2244: public static Icon getFileChooserHomeFolderIcon()
2245: {
2246: if (fileChooserHomeFolderIcon == null)
2247: fileChooserHomeFolderIcon = new FileChooserHomeFolderIcon();
2248: return fileChooserHomeFolderIcon;
2249: }
2250:
2251:
2256: public static Icon getFileChooserListViewIcon()
2257: {
2258: if (fileChooserListViewIcon == null)
2259: fileChooserListViewIcon = new FileChooserListViewIcon();
2260: return fileChooserListViewIcon;
2261: }
2262:
2263:
2268: public static Icon getFileChooserNewFolderIcon()
2269: {
2270: if (fileChooserNewFolderIcon == null)
2271: fileChooserNewFolderIcon = new FileChooserNewFolderIcon();
2272: return fileChooserNewFolderIcon;
2273: }
2274:
2275:
2280: public static Icon getFileChooserUpFolderIcon()
2281: {
2282: if (fileChooserUpFolderIcon == null)
2283: fileChooserUpFolderIcon = new FileChooserUpFolderIcon();
2284: return fileChooserUpFolderIcon;
2285: }
2286:
2287:
2292: public static Icon getRadioButtonIcon()
2293: {
2294: if (radioButtonIcon == null)
2295: radioButtonIcon = new RadioButtonIcon();
2296: return radioButtonIcon;
2297: }
2298:
2299:
2304: public static Icon getRadioButtonMenuItemIcon()
2305: {
2306: if (radioButtonMenuItemIcon == null)
2307: radioButtonMenuItemIcon = new RadioButtonMenuItemIcon();
2308: return radioButtonMenuItemIcon;
2309: }
2310:
2311:
2317: public static Icon getHorizontalSliderThumbIcon()
2318: {
2319: return new HorizontalSliderThumbIcon();
2320: }
2321:
2322:
2330: public static Icon getInternalFrameCloseIcon(int size)
2331: {
2332: return new InternalFrameCloseIcon(size);
2333: }
2334:
2335:
2341: public static Icon getInternalFrameDefaultMenuIcon()
2342: {
2343: if (internalFrameDefaultMenuIcon == null)
2344: internalFrameDefaultMenuIcon = new InternalFrameDefaultMenuIcon();
2345: return internalFrameDefaultMenuIcon;
2346: }
2347:
2348:
2357: public static Icon getInternalFrameMaximizeIcon(int size)
2358: {
2359: return new InternalFrameMaximizeIcon();
2360: }
2361:
2362:
2370: public static Icon getInternalFrameMinimizeIcon(int size)
2371: {
2372: return new InternalFrameMinimizeIcon();
2373: }
2374:
2375:
2385: public static Icon getInternalFrameAltMaximizeIcon(int size)
2386: {
2387: return new InternalFrameAltMaximizeIcon(size);
2388: }
2389:
2390:
2396: public static Icon getVerticalSliderThumbIcon()
2397: {
2398: return new VerticalSliderThumbIcon();
2399: }
2400:
2401:
2406: public static Icon getTreeFolderIcon()
2407: {
2408: return new TreeFolderIcon();
2409: }
2410:
2411:
2416: public static Icon getTreeLeafIcon()
2417: {
2418: return new TreeLeafIcon();
2419: }
2420:
2421:
2429: public static Icon getTreeControlIcon(boolean isCollapsed)
2430: {
2431: return new TreeControlIcon(isCollapsed);
2432: }
2433:
2434:
2439: public static Icon getTreeComputerIcon()
2440: {
2441: if (treeComputerIcon == null)
2442: treeComputerIcon = new TreeComputerIcon();
2443: return treeComputerIcon;
2444: }
2445:
2446:
2451: public static Icon getTreeFloppyDriveIcon()
2452: {
2453: if (treeFloppyDriveIcon == null)
2454: treeFloppyDriveIcon = new TreeFloppyDriveIcon();
2455: return treeFloppyDriveIcon;
2456: }
2457:
2458:
2463: public static Icon getTreeHardDriveIcon()
2464: {
2465: if (treeHardDriveIcon == null)
2466: treeHardDriveIcon = new TreeHardDriveIcon();
2467: return treeHardDriveIcon;
2468: }
2469:
2470: }