| 1 7 8 package javax.swing.plaf.metal; 9 10 import javax.swing.*; 11 import javax.swing.plaf.UIResource ; 12 import java.awt.*; 13 import java.awt.image.BufferedImage ; 14 import java.io.Serializable ; 15 import java.util.Enumeration ; 16 import java.util.Vector ; 17 18 43 public class MetalIconFactory implements Serializable { 44 45 private static Icon fileChooserDetailViewIcon; 47 private static Icon fileChooserHomeFolderIcon; 48 private static Icon fileChooserListViewIcon; 49 private static Icon fileChooserNewFolderIcon; 50 private static Icon fileChooserUpFolderIcon; 51 private static Icon internalFrameAltMaximizeIcon; 52 private static Icon internalFrameCloseIcon; 53 private static Icon internalFrameDefaultMenuIcon; 54 private static Icon internalFrameMaximizeIcon; 55 private static Icon internalFrameMinimizeIcon; 56 private static Icon radioButtonIcon; 57 private static Icon treeComputerIcon; 58 private static Icon treeFloppyDriveIcon; 59 private static Icon treeHardDriveIcon; 60 61 62 private static Icon menuArrowIcon; 63 private static Icon menuItemArrowIcon; 64 private static Icon checkBoxMenuItemIcon; 65 private static Icon radioButtonMenuItemIcon; 66 private static Icon checkBoxIcon; 67 68 69 private static Icon oceanHorizontalSliderThumb; 71 private static Icon oceanVerticalSliderThumb; 72 73 public static final boolean DARK = false; 75 public static final boolean LIGHT = true; 76 77 public static Icon getFileChooserDetailViewIcon() { 79 if (fileChooserDetailViewIcon == null) { 80 fileChooserDetailViewIcon = new FileChooserDetailViewIcon(); 81 } 82 return fileChooserDetailViewIcon; 83 } 84 85 public static Icon getFileChooserHomeFolderIcon() { 86 if (fileChooserHomeFolderIcon == null) { 87 fileChooserHomeFolderIcon = new FileChooserHomeFolderIcon(); 88 } 89 return fileChooserHomeFolderIcon; 90 } 91 92 public static Icon getFileChooserListViewIcon() { 93 if (fileChooserListViewIcon == null) { 94 fileChooserListViewIcon = new FileChooserListViewIcon(); 95 } 96 return fileChooserListViewIcon; 97 } 98 99 public static Icon getFileChooserNewFolderIcon() { 100 if (fileChooserNewFolderIcon == null) { 101 fileChooserNewFolderIcon = new FileChooserNewFolderIcon(); 102 } 103 return fileChooserNewFolderIcon; 104 } 105 106 public static Icon getFileChooserUpFolderIcon() { 107 if (fileChooserUpFolderIcon == null) { 108 fileChooserUpFolderIcon = new FileChooserUpFolderIcon(); 109 } 110 return fileChooserUpFolderIcon; 111 } 112 113 public static Icon getInternalFrameAltMaximizeIcon(int size) { 114 return new InternalFrameAltMaximizeIcon(size); 115 } 116 117 public static Icon getInternalFrameCloseIcon(int size) { 118 return new InternalFrameCloseIcon(size); 119 } 120 121 public static Icon getInternalFrameDefaultMenuIcon() { 122 if (internalFrameDefaultMenuIcon == null) { 123 internalFrameDefaultMenuIcon = new InternalFrameDefaultMenuIcon(); 124 } 125 return internalFrameDefaultMenuIcon; 126 } 127 128 public static Icon getInternalFrameMaximizeIcon(int size) { 129 return new InternalFrameMaximizeIcon(size); 130 } 131 132 public static Icon getInternalFrameMinimizeIcon(int size) { 133 return new InternalFrameMinimizeIcon(size); 134 } 135 136 public static Icon getRadioButtonIcon() { 137 if (radioButtonIcon == null) { 138 radioButtonIcon = new RadioButtonIcon(); 139 } 140 return radioButtonIcon; 141 } 142 143 147 public static Icon getCheckBoxIcon() { 148 if (checkBoxIcon == null) { 149 checkBoxIcon = new CheckBoxIcon(); 150 } 151 return checkBoxIcon; 152 } 153 154 public static Icon getTreeComputerIcon() { 155 if ( treeComputerIcon == null ) { 156 treeComputerIcon = new TreeComputerIcon(); 157 } 158 return treeComputerIcon; 159 } 160 161 public static Icon getTreeFloppyDriveIcon() { 162 if ( treeFloppyDriveIcon == null ) { 163 treeFloppyDriveIcon = new TreeFloppyDriveIcon(); 164 } 165 return treeFloppyDriveIcon; 166 } 167 168 public static Icon getTreeFolderIcon() { 169 return new TreeFolderIcon(); 170 } 171 172 public static Icon getTreeHardDriveIcon() { 173 if ( treeHardDriveIcon == null ) { 174 treeHardDriveIcon = new TreeHardDriveIcon(); 175 } 176 return treeHardDriveIcon; 177 } 178 179 public static Icon getTreeLeafIcon() { 180 return new TreeLeafIcon(); 181 } 182 183 public static Icon getTreeControlIcon( boolean isCollapsed ) { 184 return new TreeControlIcon( isCollapsed ); 185 } 186 187 public static Icon getMenuArrowIcon() { 188 if (menuArrowIcon == null) { 189 menuArrowIcon = new MenuArrowIcon(); 190 } 191 return menuArrowIcon; 192 } 193 194 200 public static Icon getMenuItemCheckIcon() { 201 return null; 202 } 203 204 public static Icon getMenuItemArrowIcon() { 205 if (menuItemArrowIcon == null) { 206 menuItemArrowIcon = new MenuItemArrowIcon(); 207 } 208 return menuItemArrowIcon; 209 } 210 211 public static Icon getCheckBoxMenuItemIcon() { 212 if (checkBoxMenuItemIcon == null) { 213 checkBoxMenuItemIcon = new CheckBoxMenuItemIcon(); 214 } 215 return checkBoxMenuItemIcon; 216 } 217 218 public static Icon getRadioButtonMenuItemIcon() { 219 if (radioButtonMenuItemIcon == null) { 220 radioButtonMenuItemIcon = new RadioButtonMenuItemIcon(); 221 } 222 return radioButtonMenuItemIcon; 223 } 224 225 public static Icon getHorizontalSliderThumbIcon() { 226 if (MetalLookAndFeel.usingOcean()) { 227 if (oceanHorizontalSliderThumb == null) { 228 oceanHorizontalSliderThumb = 229 new OceanHorizontalSliderThumbIcon(); 230 } 231 return oceanHorizontalSliderThumb; 232 } 233 return new HorizontalSliderThumbIcon(); 235 } 236 237 public static Icon getVerticalSliderThumbIcon() { 238 if (MetalLookAndFeel.usingOcean()) { 239 if (oceanVerticalSliderThumb == null) { 240 oceanVerticalSliderThumb = new OceanVerticalSliderThumbIcon(); 241 } 242 return oceanVerticalSliderThumb; 243 } 244 return new VerticalSliderThumbIcon(); 246 } 247 248 private static class FileChooserDetailViewIcon implements Icon, UIResource , Serializable { 250 public void paintIcon(Component c, Graphics g, int x, int y) { 251 g.translate(x, y); 252 253 g.setColor(MetalLookAndFeel.getPrimaryControlInfo()); 255 g.drawLine(2,2, 5,2); g.drawLine(2,3, 2,7); g.drawLine(3,7, 6,7); g.drawLine(6,6, 6,3); g.drawLine(2,10, 5,10); g.drawLine(2,11, 2,15); g.drawLine(3,15, 6,15); g.drawLine(6,14, 6,11); 266 g.drawLine(8,5, 15,5); g.drawLine(8,13, 15,13); 271 g.setColor(MetalLookAndFeel.getPrimaryControl()); 273 g.drawRect(3,3, 2,3); g.drawRect(3,11, 2,3); 276 g.setColor(MetalLookAndFeel.getPrimaryControlHighlight()); 278 g.drawLine(4,4, 4,5); g.drawLine(4,12, 4,13); 281 g.translate(-x, -y); 282 } 283 284 public int getIconWidth() { 285 return 18; 286 } 287 288 public int getIconHeight() { 289 return 18; 290 } 291 } 293 private static class FileChooserHomeFolderIcon implements Icon, UIResource , Serializable { 295 public void paintIcon(Component c, Graphics g, int x, int y) { 296 g.translate(x, y); 297 298 g.setColor(MetalLookAndFeel.getPrimaryControlInfo()); 300 g.drawLine(8,1, 1,8); g.drawLine(8,1, 15,8); g.drawLine(11,2, 11,3); g.drawLine(12,2, 12,4); g.drawLine(3,7, 3,15); g.drawLine(13,7, 13,15); g.drawLine(4,15, 12,15); g.drawLine( 6,9, 6,14); g.drawLine(10,9, 10,14); g.drawLine( 7,9, 9, 9); 313 g.setColor(MetalLookAndFeel.getControlDarkShadow()); 315 g.fillRect(8,2, 1,1); g.fillRect(7,3, 3,1); 317 g.fillRect(6,4, 5,1); 318 g.fillRect(5,5, 7,1); 319 g.fillRect(4,6, 9,2); 320 g.drawLine(9,12, 9,12); 323 324 g.setColor(MetalLookAndFeel.getPrimaryControl()); 326 g.drawLine(4,8, 12,8); g.fillRect(4,9, 2,6); g.fillRect(11,9, 2,6); 330 g.translate(-x, -y); 331 } 332 333 public int getIconWidth() { 334 return 18; 335 } 336 337 public int getIconHeight() { 338 return 18; 339 } 340 } 342 private static class FileChooserListViewIcon implements Icon, UIResource , Serializable { 344 public void paintIcon(Component c, Graphics g, int x, int y) { 345 g.translate(x, y); 346 347 g.setColor(MetalLookAndFeel.getPrimaryControlInfo()); 349 g.drawLine(2,2, 5,2); g.drawLine(2,3, 2,7); g.drawLine(3,7, 6,7); g.drawLine(6,6, 6,3); g.drawLine(10,2, 13,2); g.drawLine(10,3, 10,7); g.drawLine(11,7, 14,7); g.drawLine(14,6, 14,3); g.drawLine(2,10, 5,10); g.drawLine(2,11, 2,15); g.drawLine(3,15, 6,15); g.drawLine(6,14, 6,11); g.drawLine(10,10, 13,10); g.drawLine(10,11, 10,15); g.drawLine(11,15, 14,15); g.drawLine(14,14, 14,11); 370 g.drawLine(8,5, 8,5); g.drawLine(16,5, 16,5); g.drawLine(8,13, 8,13); g.drawLine(16,13, 16,13); 377 g.setColor(MetalLookAndFeel.getPrimaryControl()); 379 g.drawRect(3,3, 2,3); g.drawRect(11,3, 2,3); g.drawRect(3,11, 2,3); g.drawRect(11,11, 2,3); 384 g.setColor(MetalLookAndFeel.getPrimaryControlHighlight()); 386 g.drawLine(4,4, 4,5); g.drawLine(12,4, 12,5); g.drawLine(4,12, 4,13); g.drawLine(12,12, 12,13); 391 g.translate(-x, -y); 392 } 393 394 public int getIconWidth() { 395 return 18; 396 } 397 398 public int getIconHeight() { 399 return 18; 400 } 401 } 403 private static class FileChooserNewFolderIcon implements Icon, UIResource , Serializable { 405 public void paintIcon(Component c, Graphics g, int x, int y) { 406 g.translate(x, y); 407 408 g.setColor(MetalLookAndFeel.getPrimaryControl()); 410 g.fillRect(3,5, 12,9); 411 412 g.setColor(MetalLookAndFeel.getPrimaryControlInfo()); 414 g.drawLine(1,6, 1,14); g.drawLine(2,14, 15,14); g.drawLine(15,13, 15,5); g.drawLine(2,5, 9,5); g.drawLine(10,6, 14,6); 420 g.setColor(MetalLookAndFeel.getPrimaryControlHighlight()); 422 g.drawLine( 2,6, 2,13); g.drawLine( 3,6, 9,6); g.drawLine(10,7, 14,7); 426 g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); 428 g.drawLine(11,3, 15,3); g.drawLine(10,4, 15,4); 431 g.translate(-x, -y); 432 } 433 434 public int getIconWidth() { 435 return 18; 436 } 437 438 public int getIconHeight() { 439 return 18; 440 } 441 } 443 private static class FileChooserUpFolderIcon implements Icon, UIResource , Serializable { 445 public void paintIcon(Component c, Graphics g, int x, int y) { 446 g.translate(x, y); 447 448 g.setColor(MetalLookAndFeel.getPrimaryControl()); 450 g.fillRect(3,5, 12,9); 451 452 g.setColor(MetalLookAndFeel.getPrimaryControlInfo()); 454 g.drawLine(1,6, 1,14); g.drawLine(2,14, 15,14); g.drawLine(15,13, 15,5); g.drawLine(2,5, 9,5); g.drawLine(10,6, 14,6); g.drawLine(8,13, 8,16); g.drawLine(8, 9, 8, 9); g.drawLine(7,10, 9,10); 464 g.drawLine(6,11, 10,11); 465 g.drawLine(5,12, 11,12); 466 467 g.setColor(MetalLookAndFeel.getPrimaryControlHighlight()); 469 g.drawLine( 2,6, 2,13); g.drawLine( 3,6, 9,6); g.drawLine(10,7, 14,7); 473 g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); 475 g.drawLine(11,3, 15,3); g.drawLine(10,4, 15,4); 478 g.translate(-x, -y); 479 } 480 481 public int getIconWidth() { 482 return 18; 483 } 484 485 public int getIconHeight() { 486 return 18; 487 } 488 } 490 491 495 public static class PaletteCloseIcon implements Icon, UIResource , Serializable { 496 int iconSize = 7; 497 498 public void paintIcon(Component c, Graphics g, int x, int y) { 499 JButton parentButton = (JButton)c; 500 ButtonModel buttonModel = parentButton.getModel(); 501 502 Color back; 503 Color highlight = MetalLookAndFeel.getPrimaryControlHighlight(); 504 Color shadow = MetalLookAndFeel.getPrimaryControlInfo(); 505 if (buttonModel.isPressed() && buttonModel.isArmed()) { 506 back = shadow; 507 } else { 508 back = MetalLookAndFeel.getPrimaryControlDarkShadow(); 509 } 510 511 g.translate(x, y); 512 g.setColor(back); 513 g.drawLine( 0, 1, 5, 6); 514 g.drawLine( 1, 0, 6, 5); 515 g.drawLine( 1, 1, 6, 6); 516 g.drawLine( 6, 1, 1, 6); 517 g.drawLine( 5,0, 0,5); 518 g.drawLine(5,1, 1,5); 519 520 g.setColor(highlight); 521 g.drawLine(6,2, 5,3); 522 g.drawLine(2,6, 3, 5); 523 g.drawLine(6,6,6,6); 524 525 526 g.translate(-x, -y); 527 } 528 529 public int getIconWidth() { 530 return iconSize; 531 } 532 533 public int getIconHeight() { 534 return iconSize; 535 } 536 } 537 538 private static class InternalFrameCloseIcon implements Icon, UIResource , Serializable { 540 int iconSize = 16; 541 542 public InternalFrameCloseIcon(int size) { 543 iconSize = size; 544 } 545 546 public void paintIcon(Component c, Graphics g, int x, int y) { 547 JButton parentButton = (JButton)c; 548 ButtonModel buttonModel = parentButton.getModel(); 549 550 Color backgroundColor = MetalLookAndFeel.getPrimaryControl(); 551 Color internalBackgroundColor = 552 MetalLookAndFeel.getPrimaryControl(); 553 Color mainItemColor = 554 MetalLookAndFeel.getPrimaryControlDarkShadow(); 555 Color darkHighlightColor = MetalLookAndFeel.getBlack(); 556 Color xLightHighlightColor = MetalLookAndFeel.getWhite(); 557 Color boxLightHighlightColor = MetalLookAndFeel.getWhite(); 558 559 if (parentButton.getClientProperty("paintActive") != Boolean.TRUE) 561 { 562 backgroundColor = MetalLookAndFeel.getControl(); 563 internalBackgroundColor = backgroundColor; 564 mainItemColor = MetalLookAndFeel.getControlDarkShadow(); 565 if (buttonModel.isPressed() && buttonModel.isArmed()) { 567 internalBackgroundColor = 568 MetalLookAndFeel.getControlShadow(); 569 xLightHighlightColor = internalBackgroundColor; 570 mainItemColor = darkHighlightColor; 571 } 572 } 573 else if (buttonModel.isPressed() && buttonModel.isArmed()) { 575 internalBackgroundColor = 576 MetalLookAndFeel.getPrimaryControlShadow(); 577 xLightHighlightColor = internalBackgroundColor; 578 mainItemColor = darkHighlightColor; 579 } 581 582 int oneHalf = (int)(iconSize / 2); 585 g.translate(x, y); 586 587 g.setColor(backgroundColor); 589 g.fillRect(0,0, iconSize,iconSize); 590 591 g.setColor(internalBackgroundColor); 593 g.fillRect(3,3, iconSize-6,iconSize-6); 594 595 g.setColor(darkHighlightColor); 598 g.drawRect(1,1, iconSize-3,iconSize-3); 599 g.drawRect(2,2, iconSize-5,iconSize-5); 601 g.setColor(boxLightHighlightColor); 603 g.drawRect(2,2, iconSize-3,iconSize-3); 604 g.setColor(mainItemColor); 606 g.drawRect(2,2, iconSize-4,iconSize-4); 607 g.drawLine(3,iconSize-3, 3,iconSize-3); g.drawLine(iconSize-3,3, iconSize-3,3); 610 g.setColor(darkHighlightColor); 613 g.drawLine(4,5, 5,4); g.drawLine(4,iconSize-6, iconSize-6,4); g.setColor(xLightHighlightColor); 617 g.drawLine(6,iconSize-5, iconSize-5,6); g.drawLine(oneHalf,oneHalf+2, oneHalf+2,oneHalf); 620 g.drawLine(iconSize-5,iconSize-5, iconSize-4,iconSize-5); 622 g.drawLine(iconSize-5,iconSize-4, iconSize-5,iconSize-4); 623 g.setColor(mainItemColor); 625 g.drawLine(5,5, iconSize-6,iconSize-6); g.drawLine(6,5, iconSize-5,iconSize-6); g.drawLine(5,6, iconSize-6,iconSize-5); g.drawLine(5,iconSize-5, iconSize-5,5); g.drawLine(5,iconSize-6, iconSize-6,5); 633 g.translate(-x, -y); 634 } 635 636 public int getIconWidth() { 637 return iconSize; 638 } 639 640 public int getIconHeight() { 641 return iconSize; 642 } 643 } 645 private static class InternalFrameAltMaximizeIcon implements Icon, UIResource , Serializable { 647 int iconSize = 16; 648 649 public InternalFrameAltMaximizeIcon(int size) { 650 iconSize = size; 651 } 652 653 public void paintIcon(Component c, Graphics g, int x, int y) { 654 JButton parentButton = (JButton)c; 655 ButtonModel buttonModel = parentButton.getModel(); 656 657 Color backgroundColor = MetalLookAndFeel.getPrimaryControl(); 658 Color internalBackgroundColor = 659 MetalLookAndFeel.getPrimaryControl(); 660 Color mainItemColor = 661 MetalLookAndFeel.getPrimaryControlDarkShadow(); 662 Color darkHighlightColor = MetalLookAndFeel.getBlack(); 663 Color ulLightHighlightColor = MetalLookAndFeel.getWhite(); 665 Color lrLightHighlightColor = MetalLookAndFeel.getWhite(); 666 667 if (parentButton.getClientProperty("paintActive") != Boolean.TRUE) 669 { 670 backgroundColor = MetalLookAndFeel.getControl(); 671 internalBackgroundColor = backgroundColor; 672 mainItemColor = MetalLookAndFeel.getControlDarkShadow(); 673 if (buttonModel.isPressed() && buttonModel.isArmed()) { 675 internalBackgroundColor = 676 MetalLookAndFeel.getControlShadow(); 677 ulLightHighlightColor = internalBackgroundColor; 678 mainItemColor = darkHighlightColor; 679 } 680 } 681 else if (buttonModel.isPressed() && buttonModel.isArmed()) { 683 internalBackgroundColor = 684 MetalLookAndFeel.getPrimaryControlShadow(); 685 ulLightHighlightColor = internalBackgroundColor; 686 mainItemColor = darkHighlightColor; 687 } 689 690 g.translate(x, y); 691 692 g.setColor(backgroundColor); 694 g.fillRect(0,0, iconSize,iconSize); 695 696 g.setColor(internalBackgroundColor); 699 g.fillRect(3,6, iconSize-9,iconSize-9); 700 701 g.setColor(darkHighlightColor); 703 g.drawRect(1,5, iconSize-8,iconSize-8); 704 g.drawLine(1,iconSize-2, 1,iconSize-2); 706 g.setColor(lrLightHighlightColor); 708 g.drawRect(2,6, iconSize-7,iconSize-7); 709 g.setColor(ulLightHighlightColor); 711 g.drawRect(3,7, iconSize-9,iconSize-9); 712 713 g.setColor(mainItemColor); 715 g.drawRect(2,6, iconSize-8,iconSize-8); 716 717 g.setColor(ulLightHighlightColor); 719 g.drawLine(iconSize-6,8,iconSize-6,8); 720 g.drawLine(iconSize-9,6, iconSize-7,8); 721 g.setColor(mainItemColor); 722 g.drawLine(3,iconSize-3,3,iconSize-3); 723 g.setColor(darkHighlightColor); 724 g.drawLine(iconSize-6,9,iconSize-6,9); 725 g.setColor(backgroundColor); 726 g.drawLine(iconSize-9,5,iconSize-9,5); 727 728 g.setColor(mainItemColor); 731 g.fillRect(iconSize-7,3, 3,5); g.drawLine(iconSize-6,5, iconSize-3,2); g.drawLine(iconSize-6,6, iconSize-2,2); g.drawLine(iconSize-6,7, iconSize-3,7); 736 g.setColor(darkHighlightColor); 738 g.drawLine(iconSize-8,2, iconSize-7,2); g.drawLine(iconSize-8,3, iconSize-8,7); g.drawLine(iconSize-6,4, iconSize-3,1); g.drawLine(iconSize-4,6, iconSize-3,6); 743 g.setColor(lrLightHighlightColor); 745 g.drawLine(iconSize-6,3, iconSize-6,3); g.drawLine(iconSize-4,5, iconSize-2,3); g.drawLine(iconSize-4,8, iconSize-3,8); g.drawLine(iconSize-2,8, iconSize-2,7); 750 g.translate(-x, -y); 751 } 752 753 public int getIconWidth() { 754 return iconSize; 755 } 756 757 public int getIconHeight() { 758 return iconSize; 759 } 760 } 762 private static class InternalFrameDefaultMenuIcon implements Icon, UIResource , Serializable { 764 public void paintIcon(Component c, Graphics g, int x, int y) { 765 766 Color windowBodyColor = MetalLookAndFeel.getWindowBackground(); 767 Color titleColor = MetalLookAndFeel.getPrimaryControl(); 768 Color edgeColor = MetalLookAndFeel.getPrimaryControlDarkShadow(); 769 770 g.translate(x, y); 771 772 g.setColor(titleColor); 775 g.fillRect(0,0, 16,16); 776 777 g.setColor(windowBodyColor); 779 g.fillRect(2,6, 13,9); 780 g.drawLine(2,2, 2,2); 782 g.drawLine(5,2, 5,2); 783 g.drawLine(8,2, 8,2); 784 g.drawLine(11,2, 11,2); 785 786 g.setColor(edgeColor); 788 g.drawRect(1,1, 13,13); g.drawLine(1,0, 14,0); g.drawLine(15,1, 15,14); g.drawLine(1,15, 14,15); g.drawLine(0,1, 0,14); g.drawLine(2,5, 13,5); g.drawLine(3,3, 3,3); 796 g.drawLine(6,3, 6,3); 797 g.drawLine(9,3, 9,3); 798 g.drawLine(12,3, 12,3); 799 800 g.translate(-x, -y); 801 } 802 803 public int getIconWidth() { 804 return 16; 805 } 806 807 public int getIconHeight() { 808 return 16; 809 } 810 } 812 private static class InternalFrameMaximizeIcon implements Icon, UIResource , Serializable { 814 protected int iconSize = 16; 815 816 public InternalFrameMaximizeIcon(int size) { 817 iconSize = size; 818 } 819 820 public void paintIcon(Component c, Graphics g, int x, int y) { 821 JButton parentButton = (JButton)c; 822 ButtonModel buttonModel = parentButton.getModel(); 823 824 Color backgroundColor = MetalLookAndFeel.getPrimaryControl(); 825 Color internalBackgroundColor = 826 MetalLookAndFeel.getPrimaryControl(); 827 Color mainItemColor = 828 MetalLookAndFeel.getPrimaryControlDarkShadow(); 829 Color darkHighlightColor = MetalLookAndFeel.getBlack(); 830 Color ulLightHighlightColor = MetalLookAndFeel.getWhite(); 832 Color lrLightHighlightColor = MetalLookAndFeel.getWhite(); 833 834 if (parentButton.getClientProperty("paintActive") != Boolean.TRUE) 836 { 837 backgroundColor = MetalLookAndFeel.getControl(); 838 internalBackgroundColor = backgroundColor; 839 mainItemColor = MetalLookAndFeel.getControlDarkShadow(); 840 if (buttonModel.isPressed() && buttonModel.isArmed()) { 842 internalBackgroundColor = 843 |