~ubuntu-branches/ubuntu/precise/classpath/precise

« back to all changes in this revision

Viewing changes to javax/swing/plaf/metal/MetalLookAndFeel.java

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2006-05-27 16:11:15 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060527161115-h6e39eposdt5snb6
Tags: 2:0.91-3
* Install header files to /usr/include/classpath.
* debian/control: classpath: Conflict with jamvm < 1.4.3 and
  cacao < 0.96 (Closes: #368172).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* MetalLookAndFeel.java
2
 
   Copyright (C) 2002, 2005 Free Software Foundation, Inc.
 
2
   Copyright (C) 2002, 2005, 2006, Free Software Foundation, Inc.
3
3
 
4
4
This file is part of GNU Classpath.
5
5
 
40
40
 
41
41
import java.awt.Color;
42
42
import java.awt.Font;
43
 
import java.awt.Insets;
44
43
 
45
44
import javax.swing.LookAndFeel;
46
45
import javax.swing.UIDefaults;
55
54
 
56
55
/**
57
56
 * A custom look and feel that is designed to look similar across different
58
 
 * operating systems.
 
57
 * operating systems.  To install this look and feel, add the following code 
 
58
 * (or something similar) near the start of your application:</p>
 
59
 * <pre>
 
60
 * try
 
61
 * {
 
62
 * &nbsp;&nbsp;UIManager.setLookAndFeel(new MetalLookAndFeel());
 
63
 * }
 
64
 * catch (UnsupportedLookAndFeelException e)
 
65
 * {
 
66
 * &nbsp;&nbsp;e.printStackTrace();
 
67
 * }</pre>
59
68
 */
60
69
public class MetalLookAndFeel extends BasicLookAndFeel
61
70
{          
72
81
   */
73
82
  public MetalLookAndFeel()
74
83
  {
75
 
    if (theme == null)
76
 
      createDefaultTheme();
 
84
    createDefaultTheme();
77
85
  }
78
86
 
79
87
  /**
81
89
   */
82
90
  protected void createDefaultTheme()
83
91
  {
84
 
    setCurrentTheme(new DefaultMetalTheme());
 
92
    if (theme == null)
 
93
      setCurrentTheme(new OceanTheme());
85
94
  }
86
95
 
87
96
  /**
115
124
   */
116
125
  public String getDescription()
117
126
  {
118
 
    return "Metal look and feel";
 
127
    return "The Java(tm) Look and Feel";
119
128
  }
120
129
 
121
130
  /**
125
134
   */
126
135
  public String getID()
127
136
  {
128
 
    return "MetalLookAndFeel";
 
137
    return "Metal";
129
138
  }
130
139
 
131
140
  /**
135
144
   */
136
145
  public String getName()
137
146
  {
138
 
    return "MetalLookAndFeel";
 
147
    return "Metal";
139
148
  }
140
149
 
141
150
  public UIDefaults getDefaults()
145
154
        LAF_defaults = super.getDefaults();
146
155
 
147
156
        // add custom theme entries to the table
148
 
        theme.addCustomEntriesToTable(LAF_defaults);
 
157
        if (theme != null)
 
158
          theme.addCustomEntriesToTable(LAF_defaults);
149
159
      }
150
160
    
151
161
    // Returns the default values for this look and feel. 
159
169
   */
160
170
  public static ColorUIResource getAcceleratorForeground()
161
171
  {
162
 
    return theme.getAcceleratorForeground();
 
172
    if (theme != null)
 
173
      return theme.getAcceleratorForeground();
 
174
    return null;
163
175
  }
164
176
 
165
177
  /**
170
182
   */
171
183
  public static ColorUIResource getAcceleratorSelectedForeground()
172
184
  {
173
 
    return theme.getAcceleratorSelectedForeground();
 
185
    if (theme != null)
 
186
      return theme.getAcceleratorSelectedForeground();
 
187
    return null;
174
188
  }
175
189
 
176
190
  /**
180
194
   */
181
195
  public static ColorUIResource getBlack()
182
196
  {
183
 
    return theme.getBlack();
 
197
    if (theme != null)
 
198
      return theme.getBlack();
 
199
    return null;
184
200
  }
185
201
 
186
202
  /**
190
206
   */
191
207
  public static ColorUIResource getControl()
192
208
  {
193
 
    return theme.getControl();
 
209
    if (theme != null)
 
210
      return theme.getControl();
 
211
    return null;
194
212
  }
195
213
 
196
214
  /**
201
219
   */
202
220
  public static ColorUIResource getControlDarkShadow()
203
221
  {
204
 
    return theme.getControlDarkShadow();
 
222
    if (theme != null)
 
223
      return theme.getControlDarkShadow();
 
224
    return null;
205
225
  }
206
226
 
207
227
  /**
211
231
   */
212
232
  public static ColorUIResource getControlDisabled()
213
233
  {
214
 
    return theme.getControlDisabled();
 
234
    if (theme != null)
 
235
      return theme.getControlDisabled();
 
236
    return null;
215
237
  }
216
238
 
217
239
  /**
222
244
   */
223
245
  public static ColorUIResource getControlHighlight()
224
246
  {
225
 
    return theme.getControlHighlight();
 
247
    if (theme != null)
 
248
      return theme.getControlHighlight();
 
249
    return null;
226
250
  }
227
251
 
228
252
  /**
233
257
   */
234
258
  public static ColorUIResource getControlInfo()
235
259
  {
236
 
    return theme.getControlInfo();
 
260
    if (theme != null)
 
261
      return theme.getControlInfo();
 
262
    return null;
237
263
  }
238
264
 
239
265
  /**
244
270
   */
245
271
  public static ColorUIResource getControlShadow()
246
272
  {
247
 
    return theme.getControlShadow();
 
273
    if (theme != null)
 
274
      return theme.getControlShadow();
 
275
    return null;
248
276
  }
249
277
 
250
278
  /**
254
282
   */
255
283
  public static ColorUIResource getControlTextColor()
256
284
  {
257
 
    return theme.getControlTextColor();
 
285
    if (theme != null)
 
286
      return theme.getControlTextColor();
 
287
    return null;
258
288
  }
259
289
 
260
290
  /**
264
294
   */
265
295
  public static FontUIResource getControlTextFont()
266
296
  {
267
 
    return theme.getControlTextFont();
 
297
    if (theme != null)
 
298
      return theme.getControlTextFont();
 
299
    return null;
268
300
  }
269
301
 
270
302
  /**
275
307
   */
276
308
  public static ColorUIResource getDesktopColor()
277
309
  {
278
 
    return theme.getDesktopColor();
 
310
    if (theme != null)
 
311
      return theme.getDesktopColor();
 
312
    return null;
279
313
  }
280
314
 
281
315
  /**
286
320
   */
287
321
  public static ColorUIResource getFocusColor()
288
322
  {
289
 
    return theme.getFocusColor();
 
323
    if (theme != null)
 
324
      return theme.getFocusColor();
 
325
    return null;
290
326
  }
291
327
 
292
328
  /**
297
333
   */
298
334
  public static ColorUIResource getHighlightedTextColor()
299
335
  {
300
 
    return theme.getHighlightedTextColor();
 
336
    if (theme != null)
 
337
      return theme.getHighlightedTextColor();
 
338
    return null;
301
339
  }
302
340
 
303
341
  /**
308
346
   */
309
347
  public static ColorUIResource getInactiveControlTextColor()
310
348
  {
311
 
    return theme.getInactiveControlTextColor();
 
349
    if (theme != null)
 
350
      return theme.getInactiveControlTextColor();
 
351
    return null;
312
352
  }
313
353
 
314
354
  /**
319
359
   */
320
360
  public static ColorUIResource getInactiveSystemTextColor()
321
361
  {
322
 
    return theme.getInactiveSystemTextColor();
 
362
    if (theme != null)
 
363
      return theme.getInactiveSystemTextColor();
 
364
    return null;
323
365
  }
324
366
 
325
367
  /**
331
373
   */
332
374
  public static ColorUIResource getMenuBackground()
333
375
  {
334
 
    return theme.getMenuBackground();
 
376
    if (theme != null)
 
377
      return theme.getMenuBackground();
 
378
    return null;
335
379
  }
336
380
 
337
381
  /**
344
388
   */
345
389
  public static ColorUIResource getMenuDisabledForeground()
346
390
  {
347
 
    return theme.getMenuDisabledForeground();
 
391
    if (theme != null)
 
392
      return theme.getMenuDisabledForeground();
 
393
    return null;
348
394
  }
349
395
 
350
396
  /**
357
403
   */
358
404
  public static ColorUIResource getMenuForeground()
359
405
  {
360
 
    return theme.getMenuForeground();
 
406
    if (theme != null)
 
407
      return theme.getMenuForeground();
 
408
    return null;
361
409
  }
362
410
 
363
411
  /**
370
418
   */
371
419
  public static ColorUIResource getMenuSelectedBackground()
372
420
  {
373
 
    return theme.getMenuSelectedBackground();
 
421
    if (theme != null)
 
422
      return theme.getMenuSelectedBackground();
 
423
    return null;
374
424
  }
375
425
 
376
426
  /**
383
433
   */
384
434
  public static ColorUIResource getMenuSelectedForeground()
385
435
  {
386
 
    return theme.getMenuSelectedForeground();
 
436
    if (theme != null)
 
437
      return theme.getMenuSelectedForeground();
 
438
    return null;
387
439
  }
388
440
 
389
441
  /**
393
445
   */
394
446
  public static FontUIResource getMenuTextFont()
395
447
  {
396
 
    return theme.getMenuTextFont();
 
448
    if (theme != null)
 
449
      return theme.getMenuTextFont();
 
450
    return null;
397
451
  }
398
452
 
399
453
  /**
403
457
   */
404
458
  public static ColorUIResource getPrimaryControl()
405
459
  {
406
 
    return theme.getPrimaryControl();
 
460
    if (theme != null)
 
461
      return theme.getPrimaryControl();
 
462
    return null;
407
463
  }
408
464
 
409
465
  /**
414
470
   */
415
471
  public static ColorUIResource getPrimaryControlDarkShadow()
416
472
  {
417
 
    return theme.getPrimaryControlDarkShadow();
 
473
    if (theme != null)
 
474
      return theme.getPrimaryControlDarkShadow();
 
475
    return null;
418
476
  }
419
477
 
420
478
  /**
425
483
   */
426
484
  public static ColorUIResource getPrimaryControlHighlight()
427
485
  {
428
 
    return theme.getPrimaryControlHighlight();
 
486
    if (theme != null)
 
487
      return theme.getPrimaryControlHighlight();
 
488
    return null;
429
489
  }
430
490
 
431
491
  /**
436
496
   */
437
497
  public static ColorUIResource getPrimaryControlInfo()
438
498
  {
439
 
    return theme.getPrimaryControlInfo();
 
499
    if (theme != null)
 
500
      return theme.getPrimaryControlInfo();
 
501
    return null;
440
502
  }
441
503
 
442
504
  /**
447
509
   */
448
510
  public static ColorUIResource getPrimaryControlShadow()
449
511
  {
450
 
    return theme.getPrimaryControlShadow();
 
512
    if (theme != null)
 
513
      return theme.getPrimaryControlShadow();
 
514
    return null;
451
515
  }
452
516
 
453
517
  /**
457
521
   */
458
522
  public static ColorUIResource getSeparatorBackground()
459
523
  {
460
 
    return theme.getSeparatorBackground();
 
524
    if (theme != null)
 
525
      return theme.getSeparatorBackground();
 
526
    return null;
461
527
  }
462
528
 
463
529
  /**
467
533
   */
468
534
  public static ColorUIResource getSeparatorForeground()
469
535
  {
470
 
    return theme.getSeparatorForeground();
 
536
    if (theme != null)
 
537
      return theme.getSeparatorForeground();
 
538
    return null;
471
539
  }
472
540
 
473
541
  /**
477
545
   */
478
546
  public static FontUIResource getSubTextFont()
479
547
  {
480
 
    return theme.getSubTextFont();
 
548
    if (theme != null)
 
549
      return theme.getSubTextFont();
 
550
    return null;
481
551
  }
482
552
 
483
553
  /**
487
557
   */
488
558
  public static ColorUIResource getSystemTextColor()
489
559
  {
490
 
    return theme.getSystemTextColor();
 
560
    if (theme != null)
 
561
      return theme.getSystemTextColor();
 
562
    return null;
491
563
  }
492
564
 
493
565
  /**
497
569
   */
498
570
  public static FontUIResource getSystemTextFont()
499
571
  {
500
 
    return theme.getSystemTextFont();
 
572
    if (theme != null)
 
573
      return theme.getSystemTextFont();
 
574
    return null;
501
575
  }
502
576
 
503
577
  /**
507
581
   */
508
582
  public static ColorUIResource getTextHighlightColor()
509
583
  {
510
 
    return theme.getTextHighlightColor();
 
584
    if (theme != null)
 
585
      return theme.getTextHighlightColor();
 
586
    return null;
511
587
  }
512
588
 
513
589
  /**
517
593
   */
518
594
  public static ColorUIResource getUserTextColor()
519
595
  {
520
 
    return theme.getUserTextColor();
 
596
    if (theme != null)
 
597
      return theme.getUserTextColor();
 
598
    return null;
521
599
  }
522
600
 
523
601
  /**
527
605
   */
528
606
  public static FontUIResource getUserTextFont()
529
607
  {
530
 
    return theme.getUserTextFont();
 
608
    if (theme != null)
 
609
      return theme.getUserTextFont();
 
610
    return null;
531
611
  }
532
612
 
533
613
  /**
537
617
   */
538
618
  public static ColorUIResource getWhite()
539
619
  {
540
 
    return theme.getWhite();
 
620
    if (theme != null)
 
621
      return theme.getWhite();
 
622
    return null;
541
623
  }
542
624
 
543
625
  /**
547
629
   */
548
630
  public static ColorUIResource getWindowBackground()
549
631
  {
550
 
    return theme.getWindowBackground();
 
632
    if (theme != null)
 
633
      return theme.getWindowBackground();
 
634
    return null;
551
635
  }
552
636
 
553
637
  /**
557
641
   */
558
642
  public static ColorUIResource getWindowTitleBackground()
559
643
  {
560
 
    return theme.getWindowTitleBackground();
 
644
    if (theme != null)
 
645
      return theme.getWindowTitleBackground();
 
646
    return null;
561
647
  }
562
648
 
563
649
  /**
569
655
   */
570
656
  public static FontUIResource getWindowTitleFont()
571
657
  {
572
 
    return theme.getWindowTitleFont();
 
658
    if (theme != null)
 
659
      return theme.getWindowTitleFont();
 
660
    return null;
573
661
  }
574
662
 
575
663
  /**
579
667
   */
580
668
  public static ColorUIResource getWindowTitleForeground()
581
669
  {
582
 
    return theme.getWindowTitleForeground();
 
670
    if (theme != null)
 
671
      return theme.getWindowTitleForeground();
 
672
    return null;
583
673
  }
584
674
 
585
675
  /**
590
680
   */
591
681
  public static ColorUIResource getWindowTitleInactiveBackground()
592
682
  {
593
 
    return theme.getWindowTitleInactiveBackground();
 
683
    if (theme != null)
 
684
      return theme.getWindowTitleInactiveBackground();
 
685
    return null;
594
686
  }
595
687
 
596
688
  /**
601
693
   */
602
694
  public static ColorUIResource getWindowTitleInactiveForeground()
603
695
  {
604
 
    return theme.getWindowTitleInactiveForeground();
 
696
    if (theme != null)
 
697
      return theme.getWindowTitleInactiveForeground();
 
698
    return null;
605
699
  }
606
700
 
607
701
  /**
691
785
      "CheckBoxUI", "javax.swing.plaf.metal.MetalCheckBoxUI",
692
786
      "ComboBoxUI", "javax.swing.plaf.metal.MetalComboBoxUI",
693
787
      "DesktopIconUI", "javax.swing.plaf.metal.MetalDesktopIconUI",
 
788
      "FileChooserUI", "javax.swing.plaf.metal.MetalFileChooserUI",
694
789
      "InternalFrameUI", "javax.swing.plaf.metal.MetalInternalFrameUI",
695
790
      "LabelUI", "javax.swing.plaf.metal.MetalLabelUI",
 
791
      "MenuBarUI", "javax.swing.plaf.metal.MetalMenuBarUI",
696
792
      "PopupMenuSeparatorUI",
697
793
      "javax.swing.plaf.metal.MetalPopupMenuSeparatorUI",
698
794
      "ProgressBarUI", "javax.swing.plaf.metal.MetalProgressBarUI",
803
899
      "CheckBoxMenuItem.acceleratorForeground", getAcceleratorForeground(),
804
900
      "CheckBoxMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(),
805
901
      "CheckBoxMenuItem.background", getMenuBackground(),
806
 
      "CheckBoxMenuItem.borderPainted", new Boolean(true),
 
902
      "CheckBoxMenuItem.borderPainted", Boolean.TRUE,
807
903
      "CheckBoxMenuItem.commandSound", "sounds/MenuItemCommand.wav",
808
904
      "CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(),
809
905
      "CheckBoxMenuItem.disabledForeground", getMenuDisabledForeground(),
840
936
 
841
937
      "EditorPane.background", getWindowBackground(),
842
938
      "EditorPane.caretForeground", getUserTextColor(),
843
 
      "EditorPane.font", new FontUIResource("Dialog", Font.PLAIN, 12),
 
939
      "EditorPane.font", new FontUIResource("Dialog", Font.BOLD, 12),
844
940
      "EditorPane.foreground",  getUserTextColor(),
845
941
      "EditorPane.inactiveForeground",  getInactiveSystemTextColor(),
846
942
      "EditorPane.selectionBackground", getTextHighlightColor(),
857
953
      "FormattedTextField.selectionBackground", getTextHighlightColor(),
858
954
      "FormattedTextField.selectionForeground", getHighlightedTextColor(),
859
955
 
 
956
      "FileChooser.upFolderIcon", 
 
957
          MetalIconFactory.getFileChooserUpFolderIcon(),
 
958
      "FileChooser.listViewIcon", 
 
959
          MetalIconFactory.getFileChooserListViewIcon(),
 
960
      "FileChooser.newFolderIcon", 
 
961
          MetalIconFactory.getFileChooserNewFolderIcon(),
 
962
      "FileChooser.homeFolderIcon", 
 
963
          MetalIconFactory.getFileChooserHomeFolderIcon(),
 
964
      "FileChooser.detailsViewIcon", 
 
965
          MetalIconFactory.getFileChooserDetailViewIcon(),
 
966
      "FileChooser.fileNameLabelMnemonic", new Integer(78),
 
967
      "FileChooser.filesOfTypeLabelMnemonic",new Integer(84),
 
968
      "FileChooser.lookInLabelMnemonic", new Integer(73),
860
969
      "FileView.computerIcon", MetalIconFactory.getTreeComputerIcon(),
861
970
      "FileView.directoryIcon", MetalIconFactory.getTreeFolderIcon(),
862
971
      "FileView.fileIcon", MetalIconFactory.getTreeLeafIcon(),
874
983
      "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(),
875
984
      "InternalFrame.closeIcon", 
876
985
        MetalIconFactory.getInternalFrameCloseIcon(16),
 
986
      "InternalFrame.closeSound", "sounds/FrameClose.wav",
877
987
      "InternalFrame.inactiveTitleBackground", getWindowTitleInactiveBackground(),
878
988
      "InternalFrame.inactiveTitleForeground", getWindowTitleInactiveForeground(),
879
989
      "InternalFrame.maximizeIcon", 
880
990
        MetalIconFactory.getInternalFrameMaximizeIcon(16),
 
991
      "InternalFrame.maximizeSound", "sounds/FrameMaximize.wav",
881
992
      "InternalFrame.iconifyIcon", 
882
993
        MetalIconFactory.getInternalFrameMinimizeIcon(16),
 
994
      "InternalFrame.minimizeSound", "sounds/FrameMinimize.wav",
883
995
      "InternalFrame.paletteBorder", new MetalBorders.PaletteBorder(),
884
996
      "InternalFrame.paletteCloseIcon", new MetalIconFactory.PaletteCloseIcon(),
885
997
      "InternalFrame.paletteTitleHeight", new Integer(11),
 
998
      "InternalFrame.restoreDownSound", "sounds/FrameRestoreDown.wav",
 
999
      "InternalFrame.restoreUpSound", "sounds/FrameRestoreUp.wav",
886
1000
 
887
1001
      "Label.background", getControl(),
888
1002
      "Label.disabledForeground", getInactiveSystemTextColor(),
901
1015
      "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10),
902
1016
      "Menu.acceleratorForeground", getAcceleratorForeground(),
903
1017
      "Menu.acceleratorSelectionForeground", getAcceleratorSelectedForeground(),
 
1018
      "Menu.arrowIcon", MetalIconFactory.getMenuArrowIcon(),
904
1019
      "Menu.background", getMenuBackground(),
905
1020
      "Menu.border", new MetalBorders.MenuItemBorder(),
906
1021
      "Menu.borderPainted", Boolean.TRUE,
 
1022
      "MenuItem.commandSound", "sounds/MenuItemCommand.wav",
907
1023
      "Menu.disabledForeground", getMenuDisabledForeground(),
908
1024
      "Menu.font", getControlTextFont(),
909
1025
      "Menu.foreground", getMenuForeground(),
910
1026
      "Menu.selectionBackground", getMenuSelectedBackground(),
911
1027
      "Menu.selectionForeground", getMenuSelectedForeground(),
 
1028
      "Menu.submenuPopupOffsetX", new Integer(-4),
 
1029
      "Menu.submenuPopupOffsetY", new Integer(-3),
912
1030
 
913
1031
      "MenuBar.background", getMenuBackground(),
914
1032
      "MenuBar.border", new MetalBorders.MenuBarBorder(),
917
1035
      "MenuBar.highlight", getControlHighlight(),
918
1036
      "MenuBar.shadow", getControlShadow(),
919
1037
 
 
1038
      "MenuItem.acceleratorDelimiter", "-",
920
1039
      "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10),
921
1040
      "MenuItem.acceleratorForeground", getAcceleratorForeground(),
922
1041
      "MenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(),
 
1042
      "MenuItem.arrowIcon", MetalIconFactory.getMenuItemArrowIcon(),
923
1043
      "MenuItem.background", getMenuBackground(),
924
1044
      "MenuItem.border", new MetalBorders.MenuItemBorder(),
 
1045
      "MenuItem.borderPainted", Boolean.TRUE,
925
1046
      "MenuItem.disabledForeground", getMenuDisabledForeground(),
926
1047
      "MenuItem.font", getControlTextFont(),
927
1048
      "MenuItem.foreground", getMenuForeground(),
929
1050
      "MenuItem.selectionForeground", getMenuSelectedForeground(),
930
1051
 
931
1052
      "OptionPane.background", getControl(),
 
1053
      "OptionPane.errorSound", "sounds/OptionPaneError.wav",
 
1054
      "OptionPane.informationSound", "sounds/OptionPaneInformation.wav",
 
1055
      "OptionPane.questionSound", "sounds/OptionPaneQuestion.wav",
 
1056
      "OptionPane.warningSound", "sounds/OptionPaneWarning.wav",
932
1057
      "OptionPane.errorDialog.border.background", new ColorUIResource(153, 51, 51), 
933
1058
      "OptionPane.errorDialog.titlePane.background", new ColorUIResource(255, 153, 153),
934
1059
      "OptionPane.errorDialog.titlePane.foreground", new ColorUIResource(51, 0, 0),
952
1077
      new BorderUIResource(MetalBorders.getTextFieldBorder()),
953
1078
      "PasswordField.caretForeground", getUserTextColor(),
954
1079
      "PasswordField.foreground", getUserTextColor(),
 
1080
      "PasswordField.font", new FontUIResource("Dialog", Font.PLAIN, 12),
955
1081
      "PasswordField.inactiveBackground", getControl(),
956
1082
      "PasswordField.inactiveForeground", getInactiveSystemTextColor(),
957
1083
      "PasswordField.selectionBackground", getTextHighlightColor(),
961
1087
      "PopupMenu.border", new MetalBorders.PopupMenuBorder(),
962
1088
      "PopupMenu.font", new FontUIResource("Dialog", Font.BOLD, 12),
963
1089
      "PopupMenu.foreground", getMenuForeground(),
 
1090
      "PopupMenu.popupSound", "sounds/PopupMenuPopup.wav",
964
1091
 
965
1092
      "ProgressBar.background", getControl(),
966
1093
      "ProgressBar.border", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1),
996
1123
      "RadioButtonMenuItem.borderPainted", Boolean.TRUE,
997
1124
      "RadioButtonMenuItem.checkIcon", 
998
1125
        MetalIconFactory.getRadioButtonMenuItemIcon(),
 
1126
      "RadioButtonMenuItem.commandSound", "sounds/MenuItemCommand.wav",
999
1127
      "RadioButtonMenuItem.disabledForeground", getMenuDisabledForeground(),
1000
1128
      "RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(),
1001
1129
      "RadioButtonMenuItem.foreground", getMenuForeground(),
1005
1133
      "RadioButtonMenuItem.selectionForeground", 
1006
1134
        MetalLookAndFeel.getMenuSelectedForeground(),
1007
1135
 
 
1136
      "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE,
1008
1137
      "ScrollBar.background", getControl(),
1009
1138
      "ScrollBar.darkShadow", getControlDarkShadow(),
1010
1139
      "ScrollBar.foreground", getControl(),
1040
1169
      "Slider.verticalThumbIcon", 
1041
1170
      MetalIconFactory.getVerticalSliderThumbIcon(),
1042
1171
 
 
1172
      "Spinner.arrowButtonInsets", new InsetsUIResource(0, 0, 0, 0),
1043
1173
      "Spinner.background", getControl(),
 
1174
      "Spinner.border", MetalBorders.getTextFieldBorder(),
1044
1175
      "Spinner.font", new FontUIResource("Dialog", Font.BOLD, 12),
1045
1176
      "Spinner.foreground", getControl(),
1046
1177
 
1047
1178
      "SplitPane.background", getControl(),
1048
1179
      "SplitPane.darkShadow", getControlDarkShadow(),
1049
1180
      "SplitPane.dividerFocusColor", getPrimaryControl(),
 
1181
      "SplitPane.dividerSize", new Integer(10),
1050
1182
      "SplitPane.highlight", getControlHighlight(),
1051
1183
      "SplitPane.shadow", getControlShadow(),
1052
1184
 
1072
1204
      "Table.focusCellForeground", getControlTextColor(),
1073
1205
      "Table.foreground", getControlTextColor(),
1074
1206
      "Table.focusCellHighlightBorder",
1075
 
      new BorderUIResource.LineBorderUIResource(getControlShadow()),
 
1207
      new BorderUIResource.LineBorderUIResource(getFocusColor()),
1076
1208
      "Table.focusCellBackground", getWindowBackground(),
1077
1209
      "Table.gridColor", getControlDarkShadow(),
1078
1210
      "Table.selectionBackground", new ColorUIResource(204, 204, 255),
1149
1281
      "ToolTip.font", new FontUIResource("Dialog", Font.PLAIN, 12),
1150
1282
      "ToolTip.foreground", getPrimaryControlInfo(),
1151
1283
      "ToolTip.foregroundInactive", getControlDarkShadow(),
 
1284
      "ToolTip.hideAccelerator", Boolean.FALSE,
1152
1285
 
1153
1286
      "Tree.background", getWindowBackground(),
1154
1287
      "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(),
1162
1295
      "Tree.line", getPrimaryControl(),
1163
1296
      "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(),
1164
1297
      "Tree.rightChildIndent", new Integer(13),
1165
 
      "Tree.rowHeight", new Integer(20),
 
1298
      "Tree.rowHeight", new Integer(0),
1166
1299
      "Tree.scrollsOnExpand", Boolean.TRUE,
1167
1300
      "Tree.selectionBackground", getTextHighlightColor(),
1168
1301
      "Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)),
1201
1334
    defaults.putDefaults(uiDefaults);
1202
1335
  }
1203
1336
 
 
1337
  /**
 
1338
   * Returns the current theme setting for the Metal L&amp;F.
 
1339
   *
 
1340
   * @return the current theme setting for the Metal L&amp;F
 
1341
   */
 
1342
  public static MetalTheme getCurrentTheme()
 
1343
  {
 
1344
    return theme;
 
1345
  }
 
1346
 
 
1347
  /**
 
1348
   * Returns <code>true</code> because the Metal look
 
1349
   * and feel supports window decorations for toplevel
 
1350
   * containers.
 
1351
   *
 
1352
   * @return <code>true</code>
 
1353
   */
 
1354
  public boolean getSupportsWindowDecorations()
 
1355
  {
 
1356
    return true;
 
1357
  }
1204
1358
}