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:
57:
58:
61: public class MetalIconFactory implements Serializable
62: {
63:
64:
65: public static final boolean DARK = false;
66:
67:
68: public static final boolean LIGHT = true;
69:
70:
73: private static class CheckBoxMenuItemIcon implements Icon, Serializable
74: {
75:
78: public CheckBoxMenuItemIcon()
79: {
80:
81: }
82:
83:
88: public int getIconWidth()
89: {
90: return 10;
91: }
92:
93:
98: public int getIconHeight()
99: {
100: return 10;
101: }
102:
103:
111: public void paintIcon(Component c, Graphics g, int x, int y)
112: {
113: JCheckBoxMenuItem item = (JCheckBoxMenuItem) c;
114:
115: if (item.isArmed())
116: g.setColor(MetalLookAndFeel.getBlack());
117: else
118: g.setColor(MetalLookAndFeel.getControlDarkShadow());
119: g.drawLine(x, y, x + 8, y);
120: g.drawLine(x, y + 1, x, y + 8);
121: g.drawLine(x + 2, y + 8, x + 8, y + 8);
122: g.drawLine(x + 8, y + 2, x + 8, y + 7);
123:
124: g.setColor(MetalLookAndFeel.getWhite());
125: g.drawLine(x + 1, y + 1, x + 7, y + 1);
126: g.drawLine(x + 1, y + 2, x + 1, y + 7);
127: g.drawLine(x + 1, y + 9, x + 9, y + 9);
128: g.drawLine(x + 9, y + 1, x + 9, y + 8);
129:
130:
131: if (item.isSelected())
132: {
133: g.setColor(MetalLookAndFeel.getBlack());
134: g.fillRect(x + 2, y + 2, 2, 5);
135: for (int i = 0; i < 6; i++)
136: g.drawLine(x + 8 - i, y + i, x + 9 - i, y + i);
137: }
138:
139: }
140: }
141:
142:
148: private static class FileChooserDetailViewIcon implements Icon, Serializable
149: {
150:
151:
154: public FileChooserDetailViewIcon()
155: {
156:
157: }
158:
159:
164: public int getIconWidth()
165: {
166: return 18;
167: }
168:
169:
174: public int getIconHeight()
175: {
176: return 18;
177: }
178:
179:
187: public void paintIcon(Component c, Graphics g, int x, int y)
188: {
189: Color savedColor = g.getColor();
190: g.setColor(MetalLookAndFeel.getBlack());
191:
192:
193: g.drawLine(x + 2, y + 2, x + 5, y + 2);
194: g.drawLine(x + 6, y + 3, x + 6, y + 7);
195: g.drawLine(x + 2, y + 7, x + 6, y + 7);
196: g.drawLine(x + 2, y + 2, x + 2, y + 7);
197:
198:
199: g.drawLine(x + 2, y + 10, x + 5, y + 10);
200: g.drawLine(x + 6, y + 11, x + 6, y + 15);
201: g.drawLine(x + 2, y + 15, x + 6, y + 15);
202: g.drawLine(x + 2, y + 10, x + 2, y + 15);
203:
204:
205: g.drawLine(x + 8, y + 5, x + 15, y + 5);
206: g.drawLine(x + 8, y + 13, x + 15, y + 13);
207:
208:
209: g.setColor(MetalLookAndFeel.getPrimaryControl());
210: g.fillRect(x + 3, y + 3, 3, 4);
211: g.fillRect(x + 3, y + 11, 3, 4);
212:
213:
214: g.setColor(MetalLookAndFeel.getPrimaryControlHighlight());
215: g.drawLine(x + 4, y + 4, x + 4, y + 5);
216: g.drawLine(x + 4, y + 12, x + 4, y + 13);
217:
218: g.setColor(savedColor);
219: }
220: }
221:
222:
228: private static class FileChooserHomeFolderIcon implements Icon, Serializable
229: {
230:
231:
234: public FileChooserHomeFolderIcon()
235: {
236:
237: }
238:
239:
244: public int getIconWidth()
245: {
246: return 18;
247: }
248:
249:
254: public int getIconHeight()
255: {
256: return 18;
257: }
258:
259:
267: public void paintIcon(Component c, Graphics g, int x, int y)
268: {
269: Color savedColor = g.getColor();
270: g.setColor(MetalLookAndFeel.getBlack());
271:
272:
273: g.drawLine(x + 1, y + 8, x + 8, y + 1);
274: g.drawLine(x + 8, y + 1, x + 15, y + 8);
275:
276:
277: g.drawLine(x + 3, y + 6, x + 3, y + 15);
278: g.drawLine(x + 3, y + 15, x + 13, y + 15);
279: g.drawLine(x + 13, y + 6, x + 13, y + 15);
280:
281:
282: g.drawLine(x + 6, y + 9, x + 6, y + 15);
283: g.drawLine(x + 6, y + 9, x + 10, y + 9);
284: g.drawLine(x + 10, y + 9, x + 10, y + 15);
285:
286:
287: g.drawLine(x + 11, y + 2, x + 11, y + 4);
288: g.drawLine(x + 12, y + 2, x + 12, y + 5);
289:
290: g.setColor(MetalLookAndFeel.getControlDarkShadow());
291:
292:
293: int xx = x + 8;
294: for (int i = 0; i < 4; i++)
295: g.drawLine(xx - i, y + 2 + i, xx + i, y + 2 + i);
296: g.fillRect(x + 4, y + 6, 9, 2);
297:
298:
299: g.drawLine(x + 9, y + 12, x + 9, y + 12);
300:
301:
302: g.setColor(MetalLookAndFeel.getPrimaryControl());
303: g.drawLine(x + 4, y + 8, x + 12, y + 8);
304: g.fillRect(x + 4, y + 9, 2, 6);
305: g.fillRect(x + 11, y + 9, 2, 6);
306:
307: g.setColor(savedColor);
308: }
309: }
310:
311:
317: private static class FileChooserListViewIcon implements Icon, Serializable
318: {
319:
322: public FileChooserListViewIcon()
323: {
324:
325: }
326:
327:
332: public int getIconWidth()
333: {
334: return 18;
335: }
336:
337:
342: public int getIconHeight()
343: {
344: return 18;
345: }
346:
347:
355: public void paintIcon(Component c, Graphics g, int x, int y)
356: {
357: Color savedColor = g.getColor();
358: g.setColor(MetalLookAndFeel.getBlack());
359:
360:
361: g.drawLine(x + 2, y + 2, x + 5, y + 2);
362: g.drawLine(x + 6, y + 3, x + 6, y + 7);
363: g.drawLine(x + 2, y + 7, x + 6, y + 7);
364: g.drawLine(x + 2, y + 2, x + 2, y + 7);
365:
366:
367: g.drawLine(x + 2, y + 10, x + 5, y + 10);
368: g.drawLine(x + 6, y + 11, x + 6, y + 15);
369: g.drawLine(x + 2, y + 15, x + 6, y + 15);
370: g.drawLine(x + 2, y + 10, x + 2, y + 15);
371:
372:
373: g.drawLine(x + 10, y + 2, x + 13, y + 2);
374: g.drawLine(x + 14, y + 3, x + 14, y + 7);
375: g.drawLine(x + 10, y + 7, x + 14, y + 7);
376: g.drawLine(x + 10, y + 2, x + 10, y + 7);
377:
378:
379: g.drawLine(x + 10, y + 10, x + 13, y + 10);
380: g.drawLine(x + 14, y + 11, x + 14, y + 15);
381: g.drawLine(x + 10, y + 15, x + 14, y + 15);
382: g.drawLine(x + 10, y + 10, x + 10, y + 15);
383:
384: g.drawLine(x + 8, y + 5, x + 8, y + 5);
385: g.drawLine(x + 8, y + 13, x + 8, y + 13);
386: g.drawLine(x + 16, y + 5, x + 16, y + 5);
387: g.drawLine(x + 16, y + 13, x + 16, y + 13);
388:
389:
390: g.setColor(MetalLookAndFeel.getPrimaryControl());
391: g.fillRect(x + 3, y + 3, 3, 4);
392: g.fillRect(x + 3, y + 11, 3, 4);
393: g.fillRect(x + 11, y + 3, 3, 4);
394: g.fillRect(x + 11, y + 11, 3, 4);
395:
396:
397: g.setColor(MetalLookAndFeel.getPrimaryControlHighlight());
398: g.drawLine(x + 4, y + 4, x + 4, y + 5);
399: g.drawLine(x + 4, y + 12, x + 4, y + 13);
400: g.drawLine(x + 12, y + 4, x + 12, y + 5);
401: g.drawLine(x + 12, y + 12, x + 12, y + 13);
402:
403: g.setColor(savedColor);
404: }
405: }
406:
407:
413: private static class FileChooserNewFolderIcon implements Icon, Serializable
414: {
415:
418: public FileChooserNewFolderIcon()
419: {
420:
421: }
422:
423:
428: public int getIconWidth()
429: {
430: return 18;
431: }
432:
433:
438: public int getIconHeight()
439: {
440: return 18;
441: }
442:
443:
451: public void paintIcon(Component c, Graphics g, int x, int y)
452: {
453: Color savedColor = g.getColor();
454: g.setColor(MetalLookAndFeel.getBlack());
455:
456: g.drawLine(x + 2, y + 5, x + 9, y + 5);
457: g.drawLine(x + 10, y + 6, x + 15, y + 6);
458: g.drawLine(x + 15, y + 5, x + 15, y + 14);
459: g.drawLine(x + 2, y + 14, x + 15, y + 14);
460: g.drawLine(x + 1, y + 6, x + 1, y + 14);
461:
462: g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());
463: g.drawLine(x + 11, y + 3, x + 15, y + 3);
464: g.drawLine(x + 10, y + 4, x + 15, y + 4);
465:
466: g.setColor(MetalLookAndFeel.getPrimaryControl());
467: g.fillRect(x + 3, y + 7, 7, 7);
468: g.fillRect(x + 10, y + 8, 5, 6);
469: g.drawLine(x + 10, y + 5, x + 14, y + 5);
470:
471: g.setColor(MetalLookAndFeel.getPrimaryControlHighlight());
472: g.drawLine(x + 10, y + 7, x + 14, y + 7);
473: g.drawLine(x + 2, y + 6, x + 9, y + 6);
474: g.drawLine(x + 2, y + 6, x + 2, y + 13);
475: g.setColor(savedColor);
476: }
477: }
478:
479:
485: private static class FileChooserUpFolderIcon extends FileChooserNewFolderIcon
486: implements Icon, Serializable
487: {
488:
491: public FileChooserUpFolderIcon()
492: {
493:
494: }
495:
496:
504: public void paintIcon(Component c, Graphics g, int x, int y)
505: {
506: Color savedColor = g.getColor();
507:
508:
509: super.paintIcon(c, g, x, y);
510:
511:
512: g.setColor(MetalLookAndFeel.getBlack());
513: g.drawLine(x + 8, y + 9, x + 8, y + 16);
514: int xx = x + 8;
515: for (int i = 0; i < 4; i++)
516: g.drawLine(xx - i, y + 9 + i, xx + i, y + 9 + i);
517: g.setColor(savedColor);
518: }
519: }
520:
521:
525: public static class FileIcon16 implements Icon, Serializable
526: {
527:
532: public int getIconWidth()
533: {
534: return 16;
535: }
536:
537:
544: public int getIconHeight()
545: {
546: return 16 + getAdditionalHeight();
547: }
548:
549:
557: public void paintIcon(Component c, Graphics g, int x, int y)
558: {
559:
560: g.setColor(Color.black);
561: g.drawLine(x, y, x + 9, y);
562: g.drawLine(x, y + 1, x, y + 15);
563: g.drawLine(x, y + 15, x + 12, y + 15);
564: g.drawLine(x + 12, y + 15, x + 12, y + 6);
565: g.drawLine(x + 12, y + 6, x + 9, y);
566:
567: g.drawLine(x + 7, y + 2, x + 11, y + 6);
568: g.drawLine(x + 8, y + 1, x + 9, y + 1);
569:
570: g.setColor(new Color(204, 204, 255));
571: g.drawLine(x + 1, y + 1, x + 7, y + 1);
572: g.drawLine(x + 1, y + 1, x + 1, y + 14);
573: g.drawLine(x + 1, y + 14, x + 11, y + 14);
574: g.drawLine(x + 11, y + 14, x + 11, y + 7);
575: g.drawLine(x + 8, y + 2, x + 10, y + 4);
576: }
577:
578:
585: public int getAdditionalHeight()
586: {
587: return 0;
588: }
589:
590:
595: public int getShift()
596: {
597: return 0;
598: }
599:
600: }
601:
602:
605: public static class FolderIcon16 implements Icon, Serializable
606: {
607:
612: public int getIconWidth() {
613: return 16;
614: }
615:
616:
623: public int getIconHeight()
624: {
625: return 16 + getAdditionalHeight();
626: }
627:
628:
636: public void paintIcon(Component c, Graphics g, int x, int y)
637: {
638:
639: g.setColor(Color.black);
640: g.drawLine(x, y + 3, x, y + 12);
641: g.drawLine(x, y + 12, x + 15, y + 12);
642: g.drawLine(x + 15, y + 12, x + 15, y + 2);
643: g.drawLine(x + 14, y + 3, x + 9, y + 3);
644: g.drawLine(x + 8, y + 2, x + 1, y + 2);
645: g.setColor(new Color(204, 204, 255));
646: g.fillRect(x + 2, y + 4, 7, 8);
647: g.fillRect(x + 9, y + 5, 6, 7);
648: g.setColor(new Color(102, 102, 153));
649: g.drawLine(x + 9, y + 2, x + 14, y + 2);
650: g.setColor(new Color(50, 50, 120));
651: g.drawLine(x + 9, y + 1, x + 15, y + 1);
652: g.drawLine(x + 10, y, x + 15, y);
653: }
654:
655:
662: public int getAdditionalHeight()
663: {
664: return 0;
665: }
666:
667:
672: public int getShift()
673: {
674: return 0;
675: }
676:
677: }
678:
679:
685: public static class PaletteCloseIcon
686: implements Icon, Serializable, UIResource
687: {
688:
693: public int getIconWidth()
694: {
695: return 7;
696: }
697:
698:
703: public int getIconHeight()
704: {
705: return 7;
706: }
707:
708:
716: public void paintIcon(Component c, Graphics g, int x, int y)
717: {
718: Color savedColor = g.getColor();
719: AbstractButton button = (AbstractButton) c;
720: if (button.getModel().isPressed())
721: g.setColor(MetalLookAndFeel.getBlack());
722: else
723: g.setColor(MetalLookAndFeel.getControlDarkShadow());
724: g.fillRect(x + 2, y + 2, 3, 3);
725: g.drawLine(x + 1, y, x + 1, y + 2);
726: g.drawLine(x, y + 1, x + 2, y + 1);
727: g.drawLine(x + 5, y, x + 5, y + 2);
728: g.drawLine(x + 4, y + 1, x + 6, y + 1);
729: g.drawLine(x + 1, y + 4, x + 1, y + 6);
730: g.drawLine(x, y + 5, x + 2, y + 5);
731: g.drawLine(x + 5, y + 4, x + 5, y + 6);
732: g.drawLine(x + 4, y + 5, x + 6, y + 5);
733: g.setColor(MetalLookAndFeel.getControlHighlight());
734: g.drawLine(x + 2, y + 6, x + 3, y + 5);
735: g.drawLine(x + 5, y + 3, x + 6, y + 2);
736: g.drawLine(x + 6, y + 6, x + 6, y + 6);
737: g.setColor(savedColor);
738: }
739: }
740:
741:
747: static class RadioButtonIcon implements Icon, UIResource, Serializable
748: {
749:
750:
755: public int getIconWidth()
756: {
757: return 13;
758: }
759:
760:
765: public int getIconHeight()
766: {
767: return 13;
768: }
769:
770:
780: public void paintIcon(Component c, Graphics g, int x, int y)
781: {
782: Color savedColor = g.getColor();
783: JRadioButton b = (JRadioButton) c;
784:
785:
786: if (b.isEnabled())
787: g.setColor(MetalLookAndFeel.getControlDarkShadow());
788: else
789: g.setColor(MetalLookAndFeel.getControlDisabled());
790: g.drawLine(x + 2, y + 1, x + 3, y + 1);
791: g.drawLine(x + 4, y, x + 7, y);
792: g.drawLine(x + 8, y + 1, x + 9, y + 1);
793: g.drawLine(x + 10, y + 2, x + 10, y + 3);
794: g.drawLine(x + 11, y + 4, x + 11, y + 7);
795: g.drawLine(x + 10, y + 8, x + 10, y + 9);
796: g.drawLine(x + 8, y + 10, x + 9, y + 10);
797: g.drawLine(x + 4, y + 11, x + 7, y + 11);
798: g.drawLine(x + 2, y + 10, x + 3, y + 10);
799: g.drawLine(x + 1, y + 9, x + 1, y + 8);
800: g.drawLine(x, y + 7, x, y + 4);
801: g.drawLine(x + 1, y + 2, x + 1, y + 3);
802:
803: if (b.getModel().isArmed())
804: {
805: g.setColor(MetalLookAndFeel.getControlShadow());
806: g.drawLine(x + 4, y + 1, x + 7, y + 1);
807: g.drawLine(x + 4, y + 10, x + 7, y + 10);
808: g.drawLine(x + 1, y + 4, x + 1, y + 7);
809: g.drawLine(x + 10, y + 4, x + 10, y + 7);
810: g.fillRect(x + 2, y + 2, 8, 8);
811: }
812: else
813: {
814:
815: if (b.isEnabled())
816: {
817: g.setColor(MetalLookAndFeel.getWhite());
818:
819: g.drawLine(x + 2, y + 8, x + 2, y + 9);
820: g.drawLine(x + 1, y + 4, x + 1, y + 7);
821: g.drawLine(x + 2, y + 2, x + 2, y + 3);
822: g.drawLine(x + 3, y + 2, x + 3, y + 2);
823: g.drawLine(x + 4, y + 1, x + 7, y + 1);
824: g.drawLine(x + 8, y + 2, x + 9, y + 2);
825: }
826: }
827:
828:
829: if (b.isEnabled())
830: {
831: g.setColor(MetalLookAndFeel.getWhite());
832:
833:
834: g.drawLine(x + 10, y + 1, x + 10, y + 1);
835: g.drawLine(x + 11, y + 2, x + 11, y + 3);
836: g.drawLine(x + 12, y + 4, x + 12, y + 7);
837: g.drawLine(x + 11, y + 8, x + 11, y + 9);
838: g.drawLine(x + 10, y + 10, x + 10, y + 10);
839: g.drawLine(x + 8, y + 11, x + 9, y + 11);
840: g.drawLine(x + 4, y + 12, x + 7, y + 12);
841: g.drawLine(x + 2, y + 11, x + 3, y + 11);
842: }
843:
844: if (b.isSelected())
845: {
846: if (b.isEnabled())
847: g.setColor(MetalLookAndFeel.getBlack());
848: else
849: g.setColor(MetalLookAndFeel.getControlDisabled());
850: g.drawLine(x + 4, y + 3, x + 7, y + 3);
851: g.fillRect(x + 3, y + 4, 6, 4);
852: g.drawLine(x + 4, y + 8, x + 7, y + 8);
853: }
854: g.setColor(savedColor);
855: }
856: }
857:
858:
861: private static class RadioButtonMenuItemIcon implements Icon, Serializable
862: {
863:
866: public RadioButtonMenuItemIcon()
867: {
868:
869: }
870:
871:
876: public int getIconWidth()
877: {
878: return 10;
879: }
880:
881:
886: public int getIconHeight()
887: {
888: return 10;
889: }
890:
891:
899: public void paintIcon(Component c, Graphics g, int x, int y)
900: {
901: Color savedColor = g.getColor();
902: JRadioButtonMenuItem item = (JRadioButtonMenuItem) c;
903: g.setColor(MetalLookAndFeel.getBlack());
904: g.drawLine(x + 2, y, x + 6, y);
905: g.drawLine(x + 7, y + 1, x + 7, y + 1);
906: g.drawLine(x + 8, y + 2, x + 8, y + 6);
907: g.drawLine(x + 7, y + 7, x + 7, y + 7);
908: g.drawLine(x + 2, y + 8, x + 6, y + 8);
909: g.drawLine(x + 1, y + 7, x + 1, y + 7);
910: g.drawLine(x, y + 2, x, y + 6);
911: g.drawLine(x + 1, y + 1, x + 1, y + 1);
912:
913: if (item.isSelected())
914: {
915: g.drawLine(x + 3, y + 2, x + 5, y + 2);
916: g.fillRect(x + 2, y + 3, 5, 3);
917: g.drawLine(x + 3, y + 6, x + 5, y + 6);
918: }
919:
920:
921: g.setColor(MetalLookAndFeel.getControlHighlight());
922: g.drawLine(x + 3, y + 1, x + 6, y + 1);
923: g.drawLine(x + 8, y + 1, x + 8, y + 1);
924: g.drawLine(x + 9, y + 2, x + 9, y + 7);
925: g.drawLine(x + 8, y + 8, x + 8, y + 8);
926: g.drawLine(x + 2, y + 9, x + 7, y + 9);
927: g.drawLine(x + 1, y + 8, x + 1, y + 8);
928: g.drawLine(x + 1, y + 3, x + 1, y + 6);
929: g.drawLine(x + 2, y + 2, x + 2, y + 2);
930: g.setColor(savedColor);
931: }
932: }
933:
934:
938: private static class HorizontalSliderThumbIcon implements Icon, Serializable
939: {
940:
941:
944: public HorizontalSliderThumbIcon()
945: {
946:
947: }
948:
949:
954: public int getIconWidth()
955: {
956: return 15;
957: }
958:
959:
964: public int getIconHeight()
965: {
966: return 16;
967: }
968:
969:
978: public void paintIcon(Component c, Graphics g, int x, int y)
979: {
980: boolean enabled = false;
981: boolean focus = false;
982: if (c != null)
983: {
984: enabled = c.isEnabled();
985: focus = c.hasFocus();
986: }
987:
988:
989: if (enabled)
990: g.setColor(MetalLookAndFeel.getBlack());
991: else
992: g.setColor(MetalLookAndFeel.getControlDarkShadow());
993: g.drawLine(x + 1, y, x + 13, y);
994: g.drawLine(x + 14, y + 1, x + 14, y + 7);
995: g.drawLine(x + 14, y + 8, x + 7, y + 15);
996: g.drawLine(x + 6, y + 14, x, y + 8);
997: g.drawLine(x, y + 7, x, y + 1);
998:
999:
1000: if (focus)
1001: g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
1002: else
1003: g.setColor(MetalLookAndFeel.getControl());
1004: g.fillRect(x + 1, y + 2, 13, 7);
1005: g.drawLine(x + 2, y + 9, x + 12, y + 9);
1006: g.drawLine(x + 3, y + 10, x + 11, y + 10);
1007: g.drawLine(x + 4, y + 11, x + 10, y + 11);
1008: g.drawLine(x + 5, y + 12, x + 9, y + 12);
1009: g.drawLine(x + 6, y + 13, x + 8, y + 13);
1010: g.drawLine(x + 7, y + 14, x + 7, y + 14);
1011:
1012:
1013: if (c.isEnabled())
1014: {
1015: if (focus)
1016: g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());
1017: else
1018: g.setColor(MetalLookAndFeel.getBlack());
1019: g.drawLine(x + 3, y + 3, x + 3, y + 3);
1020: g.drawLine(x + 7, y + 3, x + 7, y + 3);
1021: g.drawLine(x + 11, y + 3, x + 11, y + 3);
1022:
1023: g.drawLine(x + 5, y + 5, x + 5, y + 5);
1024: g.drawLine(x + 9, y + 5, x + 9, y + 5);
1025:
1026: g.drawLine(x + 3, y + 7, x + 3, y + 7);
1027: g.drawLine(x + 7, y + 7, x + 7, y + 7);
1028: g.drawLine(x + 11, y + 7, x + 11, y + 7);
1029:
1030:
1031: if (focus)
1032: g.setColor(MetalLookAndFeel.getPrimaryControl());
1033: else
1034: g.setColor(MetalLookAndFeel.getWhite());
1035: g.drawLine(x + 1, y + 1, x + 13, y + 1);
1036: g.drawLine(x + 1, y + 2, x + 1, y + 8);
1037: g.drawLine(x + 2, y + 2, x + 2, y + 2);
1038: g.drawLine(x + 6, y + 2, x + 6, y + 2);
1039: g.drawLine(x + 10, y + 2, x + 10, y + 2);
1040:
1041: g.drawLine(x + 4, y + 4, x + 4, y + 4);
1042: g.drawLine(x + 8, y + 4, x + 8, y + 4);
1043:
1044: g.drawLine(x + 2, y + 6, x + 2, y + 6);
1045: g.drawLine(x + 6, y + 6, x + 6, y + 6);
1046: g.drawLine(x + 10, y + 6, x + 10, y + 6);
1047: }
1048:
1049: }
1050: }
1051:
1052:
1056: private static class InternalFrameCloseIcon implements Icon, Serializable
1057: {
1058:
1059: private int size;
1060:
1061:
1066: public InternalFrameCloseIcon(int size)
1067: {
1068: this.size = size;
1069: }
1070:
1071:
1076: public int getIconWidth()
1077: {
1078: return size;
1079: }
1080:
1081:
1086: public int getIconHeight()
1087: {
1088: return size;
1089: }
1090:
1091:
1099: public void paintIcon(Component c, Graphics g, int x, int y)
1100: {
1101: Color savedColor = g.getColor();
1102: AbstractButton b = (AbstractButton) c;
1103:
1104:
1105: if (b.getModel().isPressed())
1106:
1107:
1108: g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
1109: else
1110: g.setColor(MetalLookAndFeel.getPrimaryControl());
1111: g.fillRect(x + 2, y + 2, 10, 10);
1112:
1113:
1114: if (b.getModel().isPressed())
1115: g.setColor(MetalLookAndFeel.getBlack());
1116: else
1117: {
1118:
1119:
1120: boolean selected = true;
1121: if (selected)
1122: g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());
1123: else
1124: g.setColor(MetalLookAndFeel.getControlDarkShadow());
1125: }
1126: g.drawLine(x + 1, y + 1, x + 13, y + 1);
1127: g.drawLine(x + 1, y + 2, x + 1, y + 12);
1128: g.drawLine(x + 1, y + 13, x + 13, y + 13);
1129: g.drawLine(x + 13, y + 2, x + 13, y + 12);
1130: g.drawLine(x + 2, y + 12, x + 2, y + 12);
1131: g.drawLine(x + 12, y + 2, x + 12, y + 2);
1132:
1133: g.fillRect(x + 4, y + 4, 2, 2);
1134: g.fillRect(x + 5, y + 5, 4, 4);
1135: g.drawLine(x + 9, y + 4, x + 10, y + 4);
1136: g.drawLine(x + 9, y + 4, x + 9, y + 5);
1137: g.drawLine(x + 4, y + 9, x + 4, y + 10);
1138: g.drawLine(x + 4, y + 9, x + 5, y + 9);
1139: g.drawLine(x + 9, y + 8, x + 9, y + 10);
1140: g.drawLine(x + 8, y + 9, x + 10, y + 9);
1141:
1142: g.setColor(MetalLookAndFeel.getBlack());
1143: g.drawLine(x, y, x + 13, y);
1144: g.drawLine(x, y + 1, x, y + 13);
1145: g.drawLine(x + 3, y + 4, x + 4, y + 3);
1146: g.drawLine(x + 3, y + 9, x + 5, y + 7);
1147: g.drawLine(x + 7, y + 5, x + 9, y + 3);
1148:
1149: g.drawLine(x + 12, y + 3, x + 12, y + 11);
1150: g.drawLine(x + 3, y + 12, x + 12, y + 12);
1151:
1152: g.setColor(MetalLookAndFeel.getWhite());
1153: g.drawLine(x + 1, y + 14, x + 14, y + 14);
1154: g.drawLine(x + 14, y + 1, x + 14, y + 14);
1155:
1156: if (!b.getModel().isPressed())
1157: {
1158: g.drawLine(x + 5, y + 10, x + 5, y + 10);
1159: g.drawLine(x + 6, y + 9, x + 7, y + 9);
1160: g.drawLine(x + 10, y + 5, x + 10, y + 5);
1161: g.drawLine(x + 9, y + 6, x + 9, y + 7);
1162: g.drawLine(x + 10, y + 10, x + 11, y + 10);
1163: g.drawLine(x + 10, y + 11, x + 10, y + 11);
1164: }
1165: g.setColor(savedColor);
1166: }
1167: }
1168:
1169:
1172: private static class InternalFrameDefaultMenuIcon
1173: implements Icon, Serializable
1174: {
1175:
1176:
1179: public InternalFrameDefaultMenuIcon()
1180: {
1181:
1182: }
1183:
1184:
1189: public int getIconWidth()
1190: {
1191: return 16;
1192: }
1193:
1194:
1199: public int getIconHeight()
1200: {
1201: return 16;
1202: }
1203:
1204:
1212: public void paintIcon(Component c, Graphics g, int x, int y)
1213: {
1214: g.setColor(new Color(102, 102, 153));
1215: g.fillRect(x + 1, y, 14, 2);
1216: g.fillRect(x, y + 1, 2, 14);
1217: g.fillRect(x + 1, y + 14, 14, 2);
1218: g.fillRect(x + 14, y + 1, 2, 14);
1219: g.drawLine(x + 2, y + 5, x + 14, y + 5);
1220:
1221: g.setColor(new Color(204, 204, 255));
1222: g.fillRect(x + 2, y + 2, 12, 3);
1223:
1224: g.setColor(new Color(102, 102, 153));
1225: g.drawLine(x + 3, y + 3, x + 3, y + 3);
1226: g.drawLine(x + 6, y + 3, x + 6, y + 3);
1227: g.drawLine(x + 9, y + 3, x + 9, y + 3);
1228: g.drawLine(x + 12, y + 3, x + 12, y + 3);
1229:
1230: g.setColor(Color.white);
1231: g.fillRect(x + 2, y + 6, 12, 8);
1232: g.drawLine(x + 2, y + 2, x + 2, y + 2);
1233: g.drawLine(x + 5, y + 2, x + 5, y + 2);
1234: g.drawLine(x + 8, y + 2, x + 8, y + 2);
1235: g.drawLine(x + 11, y + 2, x + 11, y + 2);
1236: }
1237: }
1238:
1239:
1244: private static class InternalFrameAltMaximizeIcon
1245: implements Icon, Serializable
1246: {
1247:
1248: private int size;
1249:
1250:
1255: public InternalFrameAltMaximizeIcon(int size)
1256: {
1257: this.size = size;
1258: }
1259:
1260:
1265: public int getIconWidth()
1266: {
1267: return size;
1268: }
1269:
1270:
1275: public int getIconHeight()
1276: {
1277: return size;
1278: }
1279:
1280:
1288: public void paintIcon(Component c, Graphics g, int x, int y)
1289: {
1290: Color savedColor = g.getColor();
1291:
1292: AbstractButton b = (AbstractButton) c;
1293:
1294:
1295: if (b.getModel().isPressed())
1296: g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
1297: else
1298: g.setColor(MetalLookAndFeel.getPrimaryControl());
1299: g.fillRect(x + 2, y + 6, 7, 7);
1300:
1301:
1302: if (b.getModel().isPressed())
1303: g.setColor(MetalLookAndFeel.getBlack());
1304: else
1305: g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());
1306:
1307: g.drawLine(x + 12, y + 1, x + 13, y + 1);
1308: g.drawLine(x + 11, y + 2, x + 12, y + 2);
1309: g.drawLine(x + 10, y + 3, x + 11, y + 3);
1310: g.drawLine(x + 8, y + 2, x + 8, y + 3);
1311: g.fillRect(x + 8, y + 4, 3, 3);
1312: g.drawLine(x + 11, y + 6, x + 12, y + 6);
1313:
1314: g.drawLine(x + 1, y + 5, x + 5, y + 5);
1315: g.drawLine(x + 1, y + 6, x + 1, y + 12);
1316: g.drawLine(x + 9, y + 9, x + 9, y + 12);
1317: g.drawLine(x + 1, y + 13, x + 9, y + 13);
1318:
1319: g.drawLine(x + 2, y + 12, x + 2, y + 12);
1320:
1321: g.setColor(MetalLookAndFeel.getBlack());
1322: g.drawLine(x + 12, y, x + 9, y + 3);
1323: g.drawLine(x + 7, y + 1, x + 8, y + 1);
1324: g.drawLine(x + 7, y + 2, x + 7, y + 6);
1325: g.drawLine(x + 11, y + 5, x + 12, y + 5);
1326: g.drawLine(x, y + 4, x + 5, y + 4);
1327: g.drawLine(x, y + 5, x, y + 13);
1328: g.drawLine(x + 3, y + 12, x + 8, y + 12);
1329: g.drawLine(x + 8, y + 8, x + 8, y + 11);
1330: g.drawLine(x + 9, y + 8, x + 9, y + 8);
1331:
1332: g.setColor(MetalLookAndFeel.getWhite());
1333: g.drawLine(x + 9, y + 2, x + 9, y + 2);
1334: g.drawLine(x + 11, y + 4, x + 13, y + 2);
1335: g.drawLine(x + 13, y + 6, x + 13, y + 6);
1336: g.drawLine(x + 8, y + 7, x + 13, y + 7);
1337: g.drawLine(x + 6, y + 5, x + 6, y + 5);
1338: g.drawLine(x + 10, y + 8, x + 10, y + 13);
1339: g.drawLine(x + 1, y + 14, x + 10, y + 14);
1340:
1341: if (!b.getModel().isPressed())
1342: {
1343: g.drawLine(x + 2, y + 6, x + 6, y + 6);
1344: g.drawLine(x + 2, y + 6, x + 2, y + 11);
1345: }
1346:
1347: g.setColor(savedColor);
1348: }
1349: }
1350:
1351:
1355: private static class InternalFrameMaximizeIcon implements Icon, Serializable
1356: {
1357:
1358:
1361: public InternalFrameMaximizeIcon()
1362: {
1363:
1364: }
1365:
1366:
1371: public int getIconWidth()
1372: {
1373: return 16;
1374: }
1375:
1376:
1381: public int getIconHeight()
1382: {
1383: return 16;
1384: }
1385:
1386:
1394: public void paintIcon(Component c, Graphics g, int x, int y)
1395: {
1396: Color savedColor = g.getColor();
1397:
1398: AbstractButton b = (AbstractButton) c;
1399:
1400:
1401: if (b.getModel().isPressed())
1402: g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
1403: else
1404: g.setColor(MetalLookAndFeel.getPrimaryControl());
1405: g.fillRect(x + 2, y + 6, 7, 7);
1406:
1407: if (b.getModel().isPressed())
1408: g.setColor(MetalLookAndFeel.getBlack());
1409: else
1410: g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());
1411:
1412: g.drawLine(x + 9, y + 1, x + 10, y + 1);
1413: g.fillRect(x + 11, y + 1, 3, 3);
1414: g.fillRect(x + 12, y + 4, 2, 2);
1415: g.drawLine(x + 10, y + 3, x + 10, y + 3);
1416: g.drawLine(x + 9, y + 4, x + 10, y + 4);
1417: g.drawLine(x + 1, y + 5, x + 9, y + 5);
1418: g.drawLine(x + 1, y + 6, x + 1, y + 12);
1419: g.drawLine(x + 9, y + 6, x + 9, y + 12);
1420: g.drawLine(x + 1, y + 13, x + 9, y + 13);
1421:
1422:
1423: g.drawLine(x + 7, y + 6, x + 8, y + 6);
1424: g.drawLine(x + 6, y + 7, x + 8, y + 7);
1425: g.drawLine(x + 5, y + 8, x + 6, y + 8);
1426: g.drawLine(x + 4, y + 9, x + 5, y + 9);
1427: g.drawLine(x + 3, y + 10, x + 4, y + 10);
1428: g.drawLine(x + 2, y + 11, x + 3, y + 11);
1429: g.drawLine(x + 2, y + 12, x + 4, y + 12);
1430: g.drawLine(x + 8, y + 8, x + 8, y + 8);
1431:
1432:
1433: g.setColor(MetalLookAndFeel.getBlack());
1434: g.drawLine(x + 8, y, x + 13, y);
1435: g.drawLine(x + 8, y + 1, x + 8, y + 1);
1436: g.drawLine(x + 10, y + 2, x + 9, y + 3);
1437: g.drawLine(x, y + 4, x + 8, y + 4);
1438: g.drawLine(x, y + 5, x, y + 13);
1439:
1440: g.drawLine(x + 2, y + 10, x + 6, y + 6);
1441: g.drawLine(x + 8, y + 9, x + 8, y + 11);
1442: g.drawLine(x + 5, y + 12, x + 8, y + 12);
1443:
1444:
1445: g.setColor(MetalLookAndFeel.getWhite());
1446: if (!b.getModel().isPressed())
1447: {
1448: g.drawLine(x + 2, y + 6, x + 5, y + 6);
1449: g.drawLine(x + 2, y + 7, x + 2, y + 9);
1450: g.drawLine(x + 4, y + 11, x + 7, y + 8);
1451: }
1452:
1453: g.drawLine(x + 1, y + 14, x + 10, y + 14);
1454: g.drawLine(x + 10, y + 5, x + 10, y + 13);
1455:
1456: g.drawLine(x + 9, y + 2, x + 9, y + 2);
1457: g.drawLine(x + 11, y + 4, x + 11, y + 5);
1458: g.drawLine(x + 13, y + 6, x + 14, y + 6);
1459: g.drawLine(x + 14, y + 1, x + 14, y + 5);
1460: g.setColor(savedColor);
1461: }
1462: }
1463:
1464:
1467: private static class InternalFrameMinimizeIcon implements Icon, Serializable
1468: {
1469:
1470:
1473: public InternalFrameMinimizeIcon()
1474: {
1475:
1476: }
1477:
1478:
1483: public int getIconWidth()
1484: {
1485: return 16;
1486: }
1487:
1488:
1493: public int getIconHeight()
1494: {
1495: return 16;
1496: }
1497:
1498:
1506: public void paintIcon(Component c, Graphics g, int x, int y)
1507: {
1508: Color savedColor = g.getColor();
1509:
1510: AbstractButton b = (AbstractButton) c;
1511:
1512: if (b.getModel().isPressed())
1513: g.setColor(MetalLookAndFeel.getBlack());
1514: else
1515:
1516:
1517: g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());
1518:
1519: g.drawLine(x + 12, y + 1, x + 13, y + 1);
1520: g.drawLine(x + 11, y + 2, x + 12, y + 2);
1521: g.drawLine(x + 10, y + 3, x + 11, y + 3);
1522: g.drawLine(x + 8, y + 2, x + 8, y + 3);
1523: g.fillRect(x + 8, y + 4, 3, 3);
1524: g.drawLine(x + 11, y + 6, x + 12, y + 6);
1525:
1526: g.drawLine(x + 1, y + 8, x + 6, y + 8);
1527: g.drawLine(x + 1, y + 9, x + 1, y + 12);
1528: g.drawLine(x + 6, y + 9, x + 6, y + 12);
1529: g.drawLine(x + 1, y + 13, x + 6, y + 13);
1530:
1531: g.drawLine(x + 5, y + 9, x + 5, y + 9);
1532: g.drawLine(x + 2, y + 12, x + 2, y + 12);
1533:
1534: g.setColor(MetalLookAndFeel.getBlack());
1535: g.drawLine(x + 12, y, x + 9, y + 3);
1536: g.drawLine(x + 7, y + 1, x + 8, y + 1);
1537: g.drawLine(x + 7, y + 2, x + 7, y + 6);
1538: g.drawLine(x, y + 7, x + 6, y + 7);
1539: g.drawLine(x, y + 8, x, y + 13);
1540: g.drawLine(x + 3, y + 12, x + 5, y + 12);
1541: g.drawLine(x + 5, y + 10, x + 5, y + 11);
1542: g.drawLine(x + 11, y + 5, x + 12, y + 5);
1543:
1544: g.setColor(MetalLookAndFeel.getWhite());
1545: g.drawLine(x + 9, y + 2, x + 9, y + 2);
1546: g.drawLine(x + 11, y + 4, x + 13, y + 2);
1547: g.drawLine(x + 13, y + 6, x + 13, y + 6);
1548: g.drawLine(x + 8, y + 7, x + 13, y + 7);
1549: g.drawLine(x + 7, y + 9, x + 7, y + 13);
1550: g.drawLine(x + 1, y + 14, x + 7, y + 14);
1551:
1552: if (b.getModel().isPressed())
1553: {
1554: g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
1555: g.fillRect(x + 2, y + 9, 3, 3);
1556: }
1557: else
1558: {
1559: g.drawLine(x + 2, y + 9, x + 4, y + 9);
1560: g.drawLine(x + 2, y + 10, x + 2, y + 11);
1561: }
1562:
1563: g.setColor(savedColor);
1564: }
1565: }
1566:
1567:
1571: private static class VerticalSliderThumbIcon implements Icon, Serializable
1572: {
1573:
1576: public VerticalSliderThumbIcon()
1577: {
1578:
1579: }
1580:
1581:
1586: public int getIconWidth()
1587: {
1588: return 16;
1589: }
1590:
1591:
1596: public int getIconHeight()
1597: {
1598: return 15;
1599: }
1600:
1601:
1611: public void paintIcon(Component c, Graphics g, int x, int y)
1612: {
1613: boolean enabled = false;
1614: boolean focus = false;
1615: if (c != null)
1616: {
1617: enabled = c.isEnabled();
1618: focus = c.hasFocus();
1619: }
1620:
1621:
1622: if (enabled)
1623: g.setColor(MetalLookAndFeel.getBlack());
1624: else
1625: g.setColor(MetalLookAndFeel.getControlDarkShadow());
1626: g.drawLine(x + 1, y, x + 7, y);
1627: g.drawLine(x + 8, y, x + 15, y + 7);
1628: g.drawLine(x + 14, y + 8, x + 8, y + 14);
1629: g.drawLine(x + 8, y + 14, x + 1, y + 14);
1630: g.drawLine(x, y + 13, x, y + 1);
1631:
1632:
1633: if (focus)
1634: g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
1635: else
1636: g.setColor(MetalLookAndFeel.getControl());
1637: g.fillRect(x + 2, y + 1, 7, 13);
1638: g.drawLine(x + 9, y + 2, x + 9, y + 12);
1639: g.drawLine(x + 10, y + 3, x + 10, y + 11);
1640: g.drawLine(x + 11, y + 4, x + 11, y + 10);
1641: g.drawLine(x + 12, y + 5, x + 12, y + 9);
1642: g.drawLine(x + 13, y + 6, x + 13, y + 8);
1643: g.drawLine(x + 14, y + 7, x + 14, y + 7);
1644:
1645:
1646: if (enabled)
1647: {
1648: if (focus)
1649: g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());
1650: else
1651: g.setColor(MetalLookAndFeel.getBlack());
1652: g.drawLine(x + 3, y + 3, x + 3, y + 3);
1653: g.drawLine(x + 3, y + 7, x + 3, y + 7);
1654: g.drawLine(x + 3, y + 11, x + 3, y + 11);
1655:
1656: g.drawLine(x + 5, y + 5, x + 5, y + 5);
1657: g.drawLine(x + 5, y + 9, x + 5, y + 9);
1658:
1659: g.drawLine(x + 7, y + 3, x + 7, y + 3);
1660: g.drawLine(x + 7, y + 7, x + 7, y + 7);
1661: g.drawLine(x + 7, y + 11, x + 7, y + 11);
1662:
1663:
1664: if (focus)
1665: g.setColor(MetalLookAndFeel.getPrimaryControl());
1666: else
1667: g.setColor(MetalLookAndFeel.getWhite());
1668: g.drawLine(x + 1, y + 1, x + 8, y + 1);
1669: g.drawLine(x + 1, y + 2, x + 1, y + 13);
1670: g.drawLine(x + 2, y + 2, x + 2, y + 2);
1671: g.drawLine(x + 2, y + 6, x + 2, y + 6);
1672: g.drawLine(x + 2, y + 10, x + 2, y + 10);
1673:
1674: g.drawLine(x + 4, y + 4, x + 4, y + 4);
1675: g.drawLine(x + 4, y + 8, x + 4, y + 8);
1676:
1677: g.drawLine(x + 6, y + 2, x + 6, y + 2);
1678: g.drawLine(x + 6, y + 6, x + 6, y + 6);
1679: g.drawLine(x + 6, y + 10, x + 6, y + 10);
1680:
1681: }
1682: }
1683: }
1684:
1685:
1689: public static class TreeControlIcon implements Icon, Serializable
1690: {
1691:
1692:
1693: protected boolean isLight;
1694:
1695:
1696: private boolean collapsed;
1697:
1698:
1704: public TreeControlIcon(boolean isCollapsed)
1705: {
1706: collapsed = isCollapsed;
1707: }
1708:
1709:
1714: public int getIconWidth()
1715: {
1716: return 18;
1717: }
1718:
1723: public int getIconHeight()
1724: {
1725: return 18;
1726: }
1727:
1728:
1736: public void paintIcon(Component c, Graphics g, int x, int y)
1737: {
1738: x = x + 5;
1739: y = y + 5;
1740: if (collapsed)
1741: {
1742:
1743: g.setColor(Color.black);
1744: g.drawLine(x + 2, y, x + 5, y);
1745: g.drawLine(x + 6, y + 1, x + 7, y + 2);
1746: g.fillRect(x + 7, y + 3, 5, 2);
1747: g.drawLine(x + 7, y + 5, x + 6, y + 6);
1748: g.drawLine(x + 1, y + 1, x + 1, y + 1);
1749: g.drawLine(x, y + 2, x, y + 5);
1750: g.drawLine(x + 1, y + 6, x + 1, y + 6);
1751: g.drawLine(x + 2, y + 7, x + 5, y + 7);
1752: g.fillRect(x + 3, y + 3, 2, 2);
1753:
1754: g.setColor(new Color(204, 204, 255));
1755: g.drawLine(x + 3, y + 2, x + 4, y + 2);
1756: g.drawLine(x + 2, y + 3, x + 2, y + 4);
1757: g.drawLine(x + 3, y + 5, x + 3, y + 5);
1758: g.drawLine(x + 5, y + 3, x + 5, y + 3);
1759:
1760: g.setColor(new Color(153, 153, 204));
1761: g.drawLine(x + 2, y + 2, x + 2, y + 2);
1762: g.drawLine(x + 2, y + 5, x + 2, y + 5);
1763: g.drawLine(x + 2, y + 6, x + 5, y + 6);
1764: g.drawLine(x + 5, y + 2, x + 5, y + 2);
1765: g.drawLine(x + 6, y + 2, x + 6, y + 5);
1766:
1767: g.setColor(new Color(102, 102, 153));
1768: g.drawLine(x + 2, y + 1, x + 5, y + 1);
1769: g.drawLine(x + 1, y + 2, x + 1, y + 5);
1770: }
1771: else
1772: {
1773:
1774: g.setColor(Color.black);
1775: g.drawLine(x + 2, y, x + 5, y);
1776: g.drawLine(x + 6, y + 1, x + 7, y + 2);
1777: g.drawLine(x + 7, y + 2, x + 7, y + 5);
1778: g.fillRect(x + 3, y + 7, 2, 5);
1779: g.drawLine(x + 7, y + 5, x + 6, y + 6);
1780: g.drawLine(x + 1, y + 1, x + 1, y + 1);
1781: g.drawLine(x, y + 2, x, y + 5);
1782: g.drawLine(x + 1, y + 6, x + 1, y + 6);
1783: g.drawLine(x + 2, y + 7, x + 5, y + 7);
1784: g.fillRect(x + 3, y + 3, 2, 2);
1785:
1786: g.setColor(new Color(204, 204, 255));
1787: g.drawLine(x + 3, y + 2, x + 4, y + 2);
1788: g.drawLine(x + 2, y + 3, x + 2, y + 4);
1789: g.drawLine(x + 3, y + 5, x + 3, y + 5);
1790: g.drawLine(x + 5, y + 3, x + 5, y + 3);
1791:
1792: g.setColor(new Color(153, 153, 204));
1793: g.drawLine(x + 2, y + 2, x + 2, y + 2);
1794: g.drawLine(x + 2, y + 5, x + 2, y + 5);
1795: g.drawLine(x + 2, y + 6, x + 5, y + 6);
1796: g.drawLine(x + 5, y + 2, x + 5, y + 2);
1797: g.drawLine(x + 6, y + 2, x + 6, y + 5);
1798:
1799: g.setColor(new Color(102, 102, 153));
1800: g.drawLine(x + 2, y + 1, x + 5, y + 1);
1801: g.drawLine(x + 1, y + 2, x + 1, y + 5);
1802: }
1803: }
1804:
1805:
1813: public void paintMe(Component c, Graphics g, int x, int y)
1814: {
1815: paintIcon(c, g, x, y);
1816: }
1817: }
1818:
1819:
1822: public static class TreeFolderIcon extends FolderIcon16
1823: {
1824:
1827: public TreeFolderIcon()
1828: {
1829:
1830: }
1831:
1832:
1838: public int getAdditionalHeight()
1839: {
1840: return 2;
1841: }
1842:
1843:
1848: public int getShift()
1849: {
1850: return -1;
1851: }
1852: }
1853:
1854:
1857: public static class TreeLeafIcon extends FileIcon16
1858: {
1859:
1862: public TreeLeafIcon()
1863: {
1864:
1865: }
1866:
1867:
1873: public int getAdditionalHeight()
1874: {
1875: return 4;
1876: }
1877:
1878:
1883: public int getShift()
1884: {
1885: return 2;
1886: }
1887: }
1888:
1889:
1894: private static class TreeHardDriveIcon implements Icon, Serializable
1895: {
1896:
1897:
1900: public TreeHardDriveIcon()
1901: {
1902:
1903: }
1904:
1905:
1910: public int getIconWidth()
1911: {
1912: return 16;
1913: }
1914:
1915:
1920: public int getIconHeight()
1921: {
1922: return 16;
1923: }
1924:
1925:
1934: public void paintIcon(Component c, Graphics g, int x, int y)
1935: {
1936: Color saved = g.getColor();
1937: g.setColor(MetalLookAndFeel.getBlack());
1938: g.drawLine(x + 1, y + 4, x + 1, y + 5);
1939: g.drawLine(x + 14, y + 4, x + 14, y + 5);
1940: g.drawLine(x + 1, y + 7, x + 1, y + 8);
1941: g.drawLine(x + 14, y + 7, x + 14, y + 8);
1942: g.drawLine(x + 1, y + 10, x + 1, y + 11);
1943: g.drawLine(x + 14, y + 10, x + 14, y + 11);
1944:
1945: g.drawLine(x + 2, y + 3, x + 3, y + 3);
1946: g.drawLine(x + 12, y + 3, x + 13, y + 3);
1947: g.drawLine(x + 2, y + 6, x + 3, y + 6);
1948: g.drawLine(x + 12, y + 6, x + 13, y + 6);
1949: g.drawLine(x + 2, y + 9, x + 3, y + 9);
1950: g.drawLine(x + 12, y + 9, x + 13, y + 9);
1951: g.drawLine(x + 2, y + 12, x + 3, y + 12);
1952: g.drawLine(x + 12, y + 12, x + 13, y + 12);
1953:
1954: g.drawLine(x + 4, y + 2, x + 11, y + 2);
1955: g.drawLine(x + 4, y + 7, x + 11, y + 7);
1956: g.drawLine(x + 4, y + 10, x + 11, y + 10);
1957: g.drawLine(x + 4, y + 13, x + 11, y + 13);
1958:
1959: g.setColor(MetalLookAndFeel.getWhite());
1960: g.fillRect(x + 4, y + 3, 2, 2);
1961: g.drawLine(x + 6, y + 4, x + 6, y + 4);
1962: g.drawLine(x + 7, y + 3, x + 9, y + 3);
1963: g.drawLine(x + 8, y + 4, x + 8, y + 4);
1964: g.drawLine(x + 11, y + 3, x + 11, y + 3);
1965: g.fillRect(x + 2, y + 4, 2, 2);
1966: g.fillRect(x + 2, y + 7, 2, 2);
1967: g.fillRect(x + 2, y + 10, 2, 2);
1968: g.drawLine(x + 4, y + 6, x + 4, y + 6);
1969: g.drawLine(x + 4, y + 9, x + 4, y + 9);
1970: g.drawLine(x + 4, y + 12, x + 4, y + 12);
1971:
1972: g.setColor(MetalLookAndFeel.getControlShadow());
1973: g.drawLine(x + 13, y + 4, x + 13, y + 4);
1974: g.drawLine(x + 12, y + 5, x + 13, y + 5);
1975: g.drawLine(x + 13, y + 7, x + 13, y + 7);
1976: g.drawLine(x + 12, y + 8, x + 13, y + 8);
1977: g.drawLine(x + 13, y + 10, x + 13, y + 10);
1978: g.drawLine(x + 12, y + 11, x + 13, y + 11);
1979:
1980: g.drawLine(x + 10, y + 5, x + 10, y + 5);
1981: g.drawLine(x + 7, y + 6, x + 7, y + 6);
1982: g.drawLine(x + 9, y + 6, x + 9, y + 6);
1983: g.drawLine(x + 11, y + 6, x + 11, y + 6);
1984:
1985: g.drawLine(x + 10, y + 8, x + 10, y + 8);
1986: g.drawLine(x + 7, y + 9, x + 7, y + 9);
1987: g.drawLine(x + 9, y + 9, x + 9, y + 9);
1988: g.drawLine(x + 11, y + 9, x + 11, y + 9);
1989:
1990: g.drawLine(x + 10, y + 11, x + 10, y + 11);
1991: g.drawLine(x + 7, y + 12, x + 7, y + 12);
1992: g.drawLine(x + 9, y + 12, x + 9, y + 12);
1993: g.drawLine(x + 11, y + 12, x + 11, y + 12);
1994:
1995: g.setColor(saved);
1996: }
1997: }
1998:
1999:
2004: private static class TreeFloppyDriveIcon implements Icon, Serializable
2005: {
2006:
2007:
2010: public TreeFloppyDriveIcon()
2011: {
2012:
2013: }
2014:
2015:
2020: public int getIconWidth()
2021: {
2022: return 16;
2023: }
2024:
2025:
2030: public int getIconHeight()
2031: {
2032: return 16;
2033: }
2034:
2035:
2044: public void paintIcon(Component c, Graphics g, int x, int y)
2045: {
2046: Color saved = g.getColor();
2047:
2048: g.setColor(MetalLookAndFeel.getBlack());
2049: g.drawLine(x + 1, y + 1, x + 13, y + 1);
2050: g.drawLine(x + 1, y + 1, x + 1, y + 14);
2051: g.drawLine(x + 1, y + 14, x + 14, y + 14);
2052: g.drawLine(x + 14, y + 2, x + 14, y + 14);
2053:
2054: g.setColor(MetalLookAndFeel.getPrimaryControl());
2055: g.fillRect(x + 2, y + 2, 12, 12);
2056:
2057: g.setColor(MetalLookAndFeel.getControlShadow());
2058: g.fillRect(x + 5, y + 2, 6, 5);
2059: g.drawLine(x + 4, y + 8, x + 11, y + 8);
2060: g.drawLine(x + 3, y + 9, x + 3, y + 13);
2061: g.drawLine(x + 12, y + 9, x + 12, y + 13);
2062:
2063: g.setColor(MetalLookAndFeel.getWhite());
2064: g.fillRect(x + 8, y + 3, 2, 3);
2065: g.fillRect(x + 4, y + 9, 8, 5);
2066:
2067: g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
2068: g.drawLine(x + 5, y + 10, x + 9, y + 10);
2069: g.drawLine(x + 5, y + 12, x + 8, y + 12);
2070:
2071: g.setColor(saved);
2072: }
2073: }
2074:
2075:
2080: private static class TreeComputerIcon implements Icon, Serializable
2081: {
2082:
2083:
2086: public TreeComputerIcon()
2087: {
2088:
2089: }
2090:
2091:
2096: public int getIconWidth()
2097: {
2098: return 16;
2099: }
2100:
2101:
2106: public int getIconHeight()
2107: {
2108: return 16;
2109: }
2110:
2111:
2120: public void paintIcon(Component c, Graphics g, int x, int y)
2121: {
2122: Color saved = g.getColor();
2123:
2124: g.setColor(MetalLookAndFeel.getBlack());
2125: g.drawLine(x + 3, y + 1, x + 12, y + 1);
2126: g.drawLine(x + 2, y + 2, x + 2, y + 8);
2127: g.drawLine(x + 13, y + 2, x + 13, y + 8);
2128: g.drawLine(x + 3, y + 9, x + 3, y + 9);
2129: g.drawLine(x + 12, y + 9, x + 12, y + 9);
2130: g.drawRect(x + 1, y + 10, 13, 4);
2131: g.drawLine(x + 5, y + 3, x + 10, y + 3);
2132: g.drawLine(x + 5, y + 8, x + 10, y + 8);
2133: g.drawLine(x + 4, y + 4, x + 4, y + 7);
2134: g.drawLine(x + 11, y + 4, x + 11, y + 7);
2135:
2136: g.setColor(MetalLookAndFeel.getPrimaryControl());
2137: g.fillRect(x + 5, y + 4, 6, 4);
2138:
2139: g.setColor(MetalLookAndFeel.getControlShadow());
2140: g.drawLine(x + 6, y + 12, x + 8, y + 12);
2141: g.drawLine(x + 10, y + 12, x + 12, y + 12);
2142: g.setColor(saved);
2143: }
2144: }
2145:
2146:
2147: private static Icon checkBoxIcon;
2148:
2149:
2150: private static Icon checkBoxMenuItemIcon;
2151:
2152:
2153: private static Icon fileChooserDetailViewIcon;
2154:
2155:
2156: private static Icon fileChooserHomeFolderIcon;
2157:
2158:
2159: private static Icon fileChooserListViewIcon;
2160:
2161:
2162: private static Icon fileChooserNewFolderIcon;
2163:
2164:
2165: private static Icon fileChooserUpFolderIcon;
2166:
2167:
2168: private static RadioButtonIcon radioButtonIcon;
2169:
2170:
2171: private static Icon radioButtonMenuItemIcon;
2172:
2173:
2174: private static Icon internalFrameDefaultMenuIcon;
2175:
2176:
2177: private static Icon treeComputerIcon;
2178:
2179:
2180: private static Icon treeFloppyDriveIcon;
2181:
2182:
2183: private static Icon treeHardDriveIcon;
2184:
2185:
2189: public MetalIconFactory()
2190: {
2191:
2192: }
2193:
2194:
2201: public static Icon getCheckBoxIcon()
2202: {
2203: if (checkBoxIcon == null)
2204: checkBoxIcon = new MetalCheckBoxIcon();
2205: return checkBoxIcon;
2206: }
2207:
2208:
2214: public static Icon getCheckBoxMenuItemIcon()
2215: {
2216: if (checkBoxMenuItemIcon == null)
2217: checkBoxMenuItemIcon = new CheckBoxMenuItemIcon();
2218: return checkBoxMenuItemIcon;
2219: }
2220:
2221:
2226: public static Icon getFileChooserDetailViewIcon()
2227: {
2228: if (fileChooserDetailViewIcon == null)
2229: fileChooserDetailViewIcon = new FileChooserDetailViewIcon();
2230: return fileChooserDetailViewIcon;
2231: }
2232:
2233:
2238: public static Icon getFileChooserHomeFolderIcon()
2239: {
2240: if (fileChooserHomeFolderIcon == null)
2241: fileChooserHomeFolderIcon = new FileChooserHomeFolderIcon();
2242: return fileChooserHomeFolderIcon;
2243: }
2244:
2245:
2250: public static Icon getFileChooserListViewIcon()
2251: {
2252: if (fileChooserListViewIcon == null)
2253: fileChooserListViewIcon = new FileChooserListViewIcon();
2254: return fileChooserListViewIcon;
2255: }
2256:
2257:
2262: public static Icon getFileChooserNewFolderIcon()
2263: {
2264: if (fileChooserNewFolderIcon == null)
2265: fileChooserNewFolderIcon = new FileChooserNewFolderIcon();
2266: return fileChooserNewFolderIcon;
2267: }
2268:
2269:
2274: public static Icon getFileChooserUpFolderIcon()
2275: {
2276: if (fileChooserUpFolderIcon == null)
2277: fileChooserUpFolderIcon = new FileChooserUpFolderIcon();
2278: return fileChooserUpFolderIcon;
2279: }
2280:
2281:
2286: public static Icon getRadioButtonIcon()
2287: {
2288: if (radioButtonIcon == null)
2289: radioButtonIcon = new RadioButtonIcon();
2290: return radioButtonIcon;
2291: }
2292:
2293:
2298: public static Icon getRadioButtonMenuItemIcon()
2299: {
2300: if (radioButtonMenuItemIcon == null)
2301: radioButtonMenuItemIcon = new RadioButtonMenuItemIcon();
2302: return radioButtonMenuItemIcon;
2303: }
2304:
2305:
2311: public static Icon getHorizontalSliderThumbIcon()
2312: {
2313: return new HorizontalSliderThumbIcon();
2314: }
2315:
2316:
2324: public static Icon getInternalFrameCloseIcon(int size)
2325: {
2326: return new InternalFrameCloseIcon(size);
2327: }
2328:
2329:
2335: public static Icon getInternalFrameDefaultMenuIcon()
2336: {
2337: if (internalFrameDefaultMenuIcon == null)
2338: internalFrameDefaultMenuIcon = new InternalFrameDefaultMenuIcon();
2339: return internalFrameDefaultMenuIcon;
2340: }
2341:
2342:
2351: public static Icon getInternalFrameMaximizeIcon(int size)
2352: {
2353: return new InternalFrameMaximizeIcon();
2354: }
2355:
2356:
2364: public static Icon getInternalFrameMinimizeIcon(int size)
2365: {
2366: return new InternalFrameMinimizeIcon();
2367: }
2368:
2369:
2379: public static Icon getInternalFrameAltMaximizeIcon(int size)
2380: {
2381: return new InternalFrameAltMaximizeIcon(size);
2382: }
2383:
2384:
2390: public static Icon getVerticalSliderThumbIcon()
2391: {
2392: return new VerticalSliderThumbIcon();
2393: }
2394:
2395:
2400: public static Icon getTreeFolderIcon()
2401: {
2402: return new TreeFolderIcon();
2403: }
2404:
2405:
2410: public static Icon getTreeLeafIcon()
2411: {
2412: return new TreeLeafIcon();
2413: }
2414:
2415:
2423: public static Icon getTreeControlIcon(boolean isCollapsed)
2424: {
2425: return new TreeControlIcon(isCollapsed);
2426: }
2427:
2428:
2433: public static Icon getTreeComputerIcon()
2434: {
2435: if (treeComputerIcon == null)
2436: treeComputerIcon = new TreeComputerIcon();
2437: return treeComputerIcon;
2438: }
2439:
2440:
2445: public static Icon getTreeFloppyDriveIcon()
2446: {
2447: if (treeFloppyDriveIcon == null)
2448: treeFloppyDriveIcon = new TreeFloppyDriveIcon();
2449: return treeFloppyDriveIcon;
2450: }
2451:
2452:
2457: public static Icon getTreeHardDriveIcon()
2458: {
2459: if (treeHardDriveIcon == null)
2460: treeHardDriveIcon = new TreeHardDriveIcon();
2461: return treeHardDriveIcon;
2462: }
2463:
2464: }