aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/gui/lookandfeel/SIPCommDefaultTheme.java
blob: e270759738a0310ba0a6b6245d90c5860b6e34e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
/*
 * Jitsi, the OpenSource Java VoIP and Instant Messaging client.
 *
 * Distributable under LGPL license. See terms of license at gnu.org.
 */
package net.java.sip.communicator.impl.gui.lookandfeel;

import java.awt.*;
import java.util.*;
import java.util.List;

import javax.swing.*;
import javax.swing.plaf.*;
import javax.swing.plaf.metal.*;
import javax.swing.text.*;

import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.util.skin.*;

/**
 * SipCommunicator default theme.
 *
 * @author Yana Stamcheva
 * @author Adam Netocny
 */

public class SIPCommDefaultTheme
    extends DefaultMetalTheme
    implements Skinnable
{
    /**
     * Used for tooltip borders, progress bar selection background, scroll bar
     * thumb shadow, tabbed pane focus, toolbar docking foreground
     */
    private static ColorUIResource PRIMARY_CONTROL_DARK_SHADOW =
        new ColorUIResource(GuiActivator.getResources().
            getColor("service.gui.PRIMARY_CONTROL_DARK_SHADOW"));

    /**
     * Used for desktop color, menu selected background, focus color, slider
     * foreground, progress bar foreground, combo box selection background,
     * scroll bar thumb
     */
    private static ColorUIResource PRIMARY_CONTROL_SHADOW =
        new ColorUIResource(GuiActivator.getResources().
            getColor("service.gui.PRIMARY_CONTROL_SHADOW"));

    /**
     * Used for progress bar border, tooltip border inactive, tooltip foreground
     * inactive, scroll bar dark shadow.
     */
    private static ColorUIResource CONTROL_DARK_SHADOW =
        new ColorUIResource(GuiActivator.getResources().
            getColor("service.gui.CONTROL_DARK_SHADOW"));

    /**
     * Tabbed pane shadow.
     */
    private static ColorUIResource CONTROL_SHADOW =
        new ColorUIResource(GuiActivator.getResources().
            getColor("service.gui.CONTROL_SHADOW"));

    /**
     * Used for window title inactive background, menu background, tooltip
     * inactive background, combo box background, desktop icon background,
     * scroll bar background, tabbed pane tab area background.
     */
    private static ColorUIResource CONTROL_COLOR =
        new ColorUIResource(GuiActivator.getResources().
            getColor("service.gui.colors.CONTROL"));

    /**
     * Used for text hightlight color, window title background, scroll bar thumb
     * hightlight, split pane devider focus color, Tree.line, Tree.hash,
     * ToolBar.floatingForeground
     */
    private static ColorUIResource PRIMARY_CONTROL_COLOR
        = new ColorUIResource(GuiActivator.getResources().
            getColor("service.gui.PRIMARY_COLOR_CONTROL"));

    /**
     * Used to paint a gradient for a check box or a radio button.
     */
    private static ColorUIResource BUTTON_GRADIENT_DARK_COLOR
        = new ColorUIResource(GuiActivator.getResources().
            getColor("service.gui.BUTTON_GRADIENT_DARK"));

    /**
     * Used to paint a gradient for a check box or a radio button.
     */
    private static ColorUIResource BUTTON_GRADIENT_LIGHT_COLOR
        = new ColorUIResource(GuiActivator.getResources().
            getColor("service.gui.BUTTON_GRADIENT_LIGHT"));

    /**
     * Used to paint a gradient for sliders.
     */
    private static ColorUIResource SLIDER_GRADIENT_DARK_COLOR
        = new ColorUIResource(GuiActivator.getResources().
            getColor("service.gui.SLIDER_GRADIENT_DARK"));

    /**
     * Used to paint a gradient for sliders.
     */
    private static ColorUIResource SLIDER_GRADIENT_LIGHT_COLOR
        = new ColorUIResource(GuiActivator.getResources().
            getColor("service.gui.SLIDER_GRADIENT_LIGHT"));

    /**
     * Foreground color for selected components.
     */
    private static ColorUIResource SELECTION_FOREGROUND
        = new ColorUIResource(GuiActivator.getResources().
            getColor("service.gui.SELECTION_FOREGROUND"));

    /**
     * Background color for selected components.
     */
    private static ColorUIResource SELECTION_BACKGROUND
        = new ColorUIResource(GuiActivator.getResources().
            getColor("service.gui.SELECTION_BACKGROUND"));

    /**
     * Used to paint a focused split pane divider.
     */
    private static ColorUIResource SPLIT_PANE_DEVIDER_FOCUS_COLOR
        = new ColorUIResource(GuiActivator.getResources()
            .getColor("service.gui.SPLIT_PANE_DIVIDER_FOCUSED"));

    /**
     * Tabbed pane border highlight color.
     */
    private static ColorUIResource TABBED_PANE_HIGHLIGHT_COLOR
        = new ColorUIResource(GuiActivator.getResources()
            .getColor("service.gui.TABBED_PANE_BORDER_HIGHLIGHT"));

    /**
     * Table grid color.
     */
    private static ColorUIResource TABLE_GRID_COLOR
        = new ColorUIResource(GuiActivator.getResources().
            getColor("service.gui.TABLE_GRID"));

    /**
     * These two are not used for now.
     */
    private static ColorUIResource SCROLL_BAR_TRACK_HIGHLIGHT
        = new ColorUIResource(GuiActivator.getResources()
            .getColor("service.gui.SCROLLBAR_TRACK_LIGHT"));

    /**
     * Used to paint scroll bar dark shadow.
     */
    private static ColorUIResource SCROLL_BAR_DARK_SHADOW
        = new ColorUIResource(GuiActivator.getResources().
            getColor("service.gui.SCROLLBAR_DARK_SHADOW"));

    /**
     * Background color for all windows.
     */
    private static ColorUIResource DESKTOP_BACKGROUND_COLOR
        = new ColorUIResource(GuiActivator.getResources().
            getColor("service.gui.DESKTOP_BACKGROUND"));

    /**
     * Text color for all texts.
     */
    private static ColorUIResource CONTROL_TEXT_COLOR
        = new ColorUIResource(GuiActivator.getResources().
            getColor("service.gui.TEXT"));

    /**
     * Used for inactive labels, text areas, etc.
     */
    private static ColorUIResource INACTIVE_CONTROL_TEXT_COLOR
        = new ColorUIResource(GuiActivator.getResources().
            getColor("service.gui.INACTIVE_TEXT"));

    /**
     * Foreground color for disabled menus.
     */
    private static ColorUIResource MENU_DISABLED_FOREGROUND
        = new ColorUIResource(GuiActivator.getResources()
            .getColor("service.gui.MENU_DISABLED_FOREGROUND"));

    /**
     * Color used in tab title for non read incoming messages.
     */
    private static ColorUIResource TAB_TITLE_HIGHLIGHT
        = new ColorUIResource(GuiActivator.getResources()
            .getColor("service.gui.TAB_TITLE_HIGHLIGHT"));

    /**
     * Color used in tab title for non read incoming messages.
     */
    private static ColorUIResource TAB_TITLE
        = new ColorUIResource(GuiActivator.getResources()
            .getColor("service.gui.TAB_TITLE"));

    /**
     * The basic font.
     */
    private static final FontUIResource BASIC_FONT
        = new FontUIResource(Constants.FONT);

    /**
     * Default input map for this theme.
     */
    Object fieldInputMap = new UIDefaults.LazyInputMap(
        new Object[]
           {
            "meta C", DefaultEditorKit.copyAction,
            "ctrl C", DefaultEditorKit.copyAction,
            "meta V", DefaultEditorKit.pasteAction,
            "ctrl V", DefaultEditorKit.pasteAction,
            "meta X", DefaultEditorKit.cutAction,
            "ctrl X", DefaultEditorKit.cutAction,
            "COPY", DefaultEditorKit.copyAction,
            "PASTE", DefaultEditorKit.pasteAction,
            "CUT", DefaultEditorKit.cutAction,
            "shift LEFT", DefaultEditorKit.selectionBackwardAction,
            "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
            "shift RIGHT", DefaultEditorKit.selectionForwardAction,
            "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
            "ctrl LEFT", DefaultEditorKit.previousWordAction,
            "ctrl KP_LEFT", DefaultEditorKit.previousWordAction,
            "ctrl RIGHT", DefaultEditorKit.nextWordAction,
            "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction,
            "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
            "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
            "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction,
            "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
            "ctrl A", DefaultEditorKit.selectAllAction,
            "meta LEFT", DefaultEditorKit.previousWordAction,
            "meta KP_LEFT", DefaultEditorKit.previousWordAction,
            "meta RIGHT", DefaultEditorKit.nextWordAction,
            "meta KP_RIGHT", DefaultEditorKit.nextWordAction,
            "meta shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
            "meta shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
            "meta shift RIGHT", DefaultEditorKit.selectionNextWordAction,
            "meta shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
            "meta A", DefaultEditorKit.selectAllAction,
            "HOME", DefaultEditorKit.beginLineAction,
            "END", DefaultEditorKit.endLineAction,
            "shift HOME", DefaultEditorKit.selectionBeginLineAction,
            "shift END", DefaultEditorKit.selectionEndLineAction,
            "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
            "ctrl H", DefaultEditorKit.deletePrevCharAction,
            "meta H", DefaultEditorKit.deletePrevCharAction,
            "DELETE", DefaultEditorKit.deleteNextCharAction,
            "RIGHT", DefaultEditorKit.forwardAction,
            "LEFT", DefaultEditorKit.backwardAction,
            "KP_RIGHT", DefaultEditorKit.forwardAction,
            "KP_LEFT", DefaultEditorKit.backwardAction,
            "ENTER", JTextField.notifyAction,
            "ctrl BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
            "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
           });

    /**
     * The default password input map.
     */
    Object passwordInputMap = new UIDefaults.LazyInputMap(
        new Object[]
           {
            "meta C", DefaultEditorKit.copyAction,
            "ctrl C", DefaultEditorKit.copyAction,
            "meta V", DefaultEditorKit.pasteAction,
            "ctrl V", DefaultEditorKit.pasteAction,
            "meta X", DefaultEditorKit.cutAction,
            "ctrl X", DefaultEditorKit.cutAction,
            "COPY", DefaultEditorKit.copyAction,
            "PASTE", DefaultEditorKit.pasteAction,
            "CUT", DefaultEditorKit.cutAction,
            "shift LEFT", DefaultEditorKit.selectionBackwardAction,
            "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
            "shift RIGHT", DefaultEditorKit.selectionForwardAction,
            "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
            "ctrl LEFT", DefaultEditorKit.beginLineAction,
            "ctrl KP_LEFT", DefaultEditorKit.beginLineAction,
            "ctrl RIGHT", DefaultEditorKit.endLineAction,
            "ctrl KP_RIGHT", DefaultEditorKit.endLineAction,
            "ctrl shift LEFT", DefaultEditorKit.selectionBeginLineAction,
            "ctrl shift KP_LEFT", DefaultEditorKit.selectionBeginLineAction,
            "ctrl shift RIGHT", DefaultEditorKit.selectionEndLineAction,
            "ctrl shift KP_RIGHT", DefaultEditorKit.selectionEndLineAction,
            "ctrl A", DefaultEditorKit.selectAllAction,
            "meta LEFT", DefaultEditorKit.beginLineAction,
            "meta KP_LEFT", DefaultEditorKit.beginLineAction,
            "meta RIGHT", DefaultEditorKit.endLineAction,
            "meta KP_RIGHT", DefaultEditorKit.endLineAction,
            "meta shift LEFT", DefaultEditorKit.selectionBeginLineAction,
            "meta shift KP_LEFT", DefaultEditorKit.selectionBeginLineAction,
            "meta shift RIGHT", DefaultEditorKit.selectionEndLineAction,
            "meta shift KP_RIGHT", DefaultEditorKit.selectionEndLineAction,
            "meta A", DefaultEditorKit.selectAllAction,
            "HOME", DefaultEditorKit.beginLineAction,
            "END", DefaultEditorKit.endLineAction,
            "shift HOME", DefaultEditorKit.selectionBeginLineAction,
            "shift END", DefaultEditorKit.selectionEndLineAction,
            "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
            "ctrl H", DefaultEditorKit.deletePrevCharAction,
            "DELETE", DefaultEditorKit.deleteNextCharAction,
            "RIGHT", DefaultEditorKit.forwardAction,
            "LEFT", DefaultEditorKit.backwardAction,
            "KP_RIGHT", DefaultEditorKit.forwardAction,
            "KP_LEFT", DefaultEditorKit.backwardAction,
            "ENTER", JTextField.notifyAction,
            "ctrl BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
            "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
    });

    /**
     * The default multi-line text component input map.
     */
    Object multilineInputMap = new UIDefaults.LazyInputMap(
        new Object[]
           {
            "meta C", DefaultEditorKit.copyAction,
            "ctrl C", DefaultEditorKit.copyAction,
            "meta V", DefaultEditorKit.pasteAction,
            "ctrl V", DefaultEditorKit.pasteAction,
            "meta X", DefaultEditorKit.cutAction,
            "ctrl X", DefaultEditorKit.cutAction,
            "COPY", DefaultEditorKit.copyAction,
            "PASTE", DefaultEditorKit.pasteAction,
            "CUT", DefaultEditorKit.cutAction,
            "shift LEFT", DefaultEditorKit.selectionBackwardAction,
            "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
            "shift RIGHT", DefaultEditorKit.selectionForwardAction,
            "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
            "ctrl LEFT", DefaultEditorKit.previousWordAction,
            "ctrl KP_LEFT", DefaultEditorKit.previousWordAction,
            "ctrl RIGHT", DefaultEditorKit.nextWordAction,
            "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction,
            "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
            "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
            "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction,
            "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
            "ctrl A", DefaultEditorKit.selectAllAction,
            "meta LEFT", DefaultEditorKit.previousWordAction,
            "meta KP_LEFT", DefaultEditorKit.previousWordAction,
            "meta RIGHT", DefaultEditorKit.nextWordAction,
            "meta KP_RIGHT", DefaultEditorKit.nextWordAction,
            "meta shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
            "meta shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
            "meta shift RIGHT", DefaultEditorKit.selectionNextWordAction,
            "meta shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
            "meta A", DefaultEditorKit.selectAllAction,
            "HOME", DefaultEditorKit.beginLineAction,
            "END", DefaultEditorKit.endLineAction,
            "shift HOME", DefaultEditorKit.selectionBeginLineAction,
            "shift END", DefaultEditorKit.selectionEndLineAction,

            "UP", DefaultEditorKit.upAction,
            "KP_UP", DefaultEditorKit.upAction,
            "DOWN", DefaultEditorKit.downAction,
            "KP_DOWN", DefaultEditorKit.downAction,
            "PAGE_UP", DefaultEditorKit.pageUpAction,
            "PAGE_DOWN", DefaultEditorKit.pageDownAction,
            "shift PAGE_UP", "selection-page-up",
            "shift PAGE_DOWN", "selection-page-down",
            "ctrl shift PAGE_UP", "selection-page-left",
            "ctrl shift PAGE_DOWN", "selection-page-right",
            "shift UP", DefaultEditorKit.selectionUpAction,
            "shift KP_UP", DefaultEditorKit.selectionUpAction,
            "shift DOWN", DefaultEditorKit.selectionDownAction,
            "shift KP_DOWN", DefaultEditorKit.selectionDownAction,
            "ENTER", DefaultEditorKit.insertBreakAction,
            "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
            "ctrl H", DefaultEditorKit.deletePrevCharAction,
            "DELETE", DefaultEditorKit.deleteNextCharAction,
            "RIGHT", DefaultEditorKit.forwardAction,
            "LEFT", DefaultEditorKit.backwardAction,
            "KP_RIGHT", DefaultEditorKit.forwardAction,
            "KP_LEFT", DefaultEditorKit.backwardAction,
            "TAB", DefaultEditorKit.insertTabAction,
            "ctrl BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
            "ctrl HOME", DefaultEditorKit.beginAction,
            "ctrl END", DefaultEditorKit.endAction,
            "ctrl shift HOME", DefaultEditorKit.selectionBeginAction,
            "ctrl shift END", DefaultEditorKit.selectionEndAction,
            "ctrl T", "next-link-action",
            "ctrl shift T", "previous-link-action",
            "ctrl SPACE", "activate-link-action",
            "meta BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
            "meta HOME", DefaultEditorKit.beginAction,
            "meta END", DefaultEditorKit.endAction,
            "meta shift HOME", DefaultEditorKit.selectionBeginAction,
            "meta shift END", DefaultEditorKit.selectionEndAction,
            "meta T", "next-link-action",
            "meta shift T", "previous-link-action",
            "meta SPACE", "activate-link-action",
            "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
           });

    /**
     * Adds a list of entries in the given defaults <tt>table</tt>.
     *
     * @param table the table of user interface defaults
     */
    @Override
    public void addCustomEntriesToTable(UIDefaults table)
    {
        List<Object> buttonGradient
            = Arrays.asList(new Object[]
               { new Float(.3f), new Float(0f), BUTTON_GRADIENT_DARK_COLOR,
                getWhite(), BUTTON_GRADIENT_LIGHT_COLOR });

        List<Object> sliderGradient
            = Arrays.asList(new Object[]
               { new Float(.3f), new Float(.2f), SLIDER_GRADIENT_DARK_COLOR,
                getWhite(), SLIDER_GRADIENT_LIGHT_COLOR });

        Object textFieldBorder = SIPCommBorders.getTextFieldBorder();

        Object[] defaults =
            new Object[]
            {
                "Button.rollover", Boolean.TRUE,

                "CheckBox.rollover", Boolean.TRUE,
                "CheckBox.gradient", buttonGradient,

                "CheckBoxMenuItem.gradient", buttonGradient,

                "Menu.opaque", Boolean.FALSE,

                "MenuBar.border", null,

                "Menu.borderPainted", Boolean.FALSE,
                "Menu.border", textFieldBorder,
                "Menu.selectionBackground", SELECTION_BACKGROUND,
                "Menu.selectionForeground", SELECTION_FOREGROUND,
                "Menu.margin", new InsetsUIResource(0, 0, 0, 0),

                "MenuItem.borderPainted", Boolean.FALSE,
                "MenuItem.border", textFieldBorder,
                "MenuItem.selectionBackground", SELECTION_BACKGROUND,
                "MenuItem.selectionForeground", SELECTION_FOREGROUND,

                "CheckBoxMenuItem.borderPainted", Boolean.FALSE,
                "CheckBoxMenuItem.border", textFieldBorder,
                "CheckBoxMenuItem.selectionBackground", SELECTION_BACKGROUND,
                "CheckBoxMenuItem.selectionForeground", SELECTION_FOREGROUND,

                "InternalFrame.activeTitleGradient", buttonGradient,

                "OptionPane.warningIcon",
                new ImageIcon(ImageLoader.getImage(ImageLoader.WARNING_ICON)),

                "OptionPane.errorIcon",
                new ImageIcon(ImageLoader.getImage(ImageLoader.ERROR_ICON)),

                "OptionPane.infoIcon",
                new ImageIcon(ImageLoader.getImage(ImageLoader.INFO_ICON)),

                "RadioButton.gradient", buttonGradient,
                "RadioButton.rollover", Boolean.TRUE,

                "RadioButtonMenuItem.gradient", buttonGradient,

                "Spinner.arrowButtonBorder", SIPCommBorders.getTextFieldBorder(),

                "Slider.altTrackColor", SLIDER_GRADIENT_LIGHT_COLOR,
                "Slider.gradient", sliderGradient,
                "Slider.focusGradient", sliderGradient,

                "SplitPane.oneTouchButtonsOpaque", Boolean.FALSE,
                "SplitPane.dividerFocusColor", SPLIT_PANE_DEVIDER_FOCUS_COLOR,
                "SplitPane.dividerSize", Integer.valueOf(5),

                "ScrollBar.width", Integer.valueOf(12),
                "ScrollBar.horizontalThumbIcon",
                ImageLoader.getImage(ImageLoader.SCROLLBAR_THUMB_HORIZONTAL),
                "ScrollBar.verticalThumbIcon",
                ImageLoader.getImage(ImageLoader.SCROLLBAR_THUMB_VERTICAL),
                "ScrollBar.horizontalThumbHandleIcon",
                ImageLoader
                    .getImage(ImageLoader.SCROLLBAR_THUMB_HANDLE_HORIZONTAL),
                "ScrollBar.verticalThumbHandleIcon",
                ImageLoader
                    .getImage(ImageLoader.SCROLLBAR_THUMB_HANDLE_VERTICAL),
                "ScrollBar.trackHighlight", SCROLL_BAR_TRACK_HIGHLIGHT,
                "ScrollBar.highlight", SELECTION_BACKGROUND,
                "ScrollBar.darkShadow", SCROLL_BAR_DARK_SHADOW,

                "TabbedPane.borderHightlightColor", TABBED_PANE_HIGHLIGHT_COLOR,
                "TabbedPane.contentBorderInsets", new Insets(2, 2, 3, 3),
                "TabbedPane.selected", SELECTION_BACKGROUND,
                "TabbedPane.tabAreaInsets", new Insets(2, 2, 0, 6),
                "TabbedPane.unselectedBackground", SELECTION_BACKGROUND,
                "TabbedPane.shadow", CONTROL_SHADOW,
                "TabbedPane.darkShadow", CONTROL_DARK_SHADOW,
                "TabbedPane.tabTitleHighlight", TAB_TITLE_HIGHLIGHT,
                "TabbedPane.foreground", TAB_TITLE,

                "TextField.border", textFieldBorder,
                "TextField.margin", new InsetsUIResource(3, 3, 3, 3),

                "TextField.focusInputMap", fieldInputMap,
                "TextArea.focusInputMap", multilineInputMap,
                "TextPane.focusInputMap", multilineInputMap,
                "EditorPane.focusInputMap", multilineInputMap,

                "PasswordField.border", textFieldBorder,
                "PasswordField.margin", new InsetsUIResource(3, 3, 3, 3),
                "PasswordField.focusInputMap", passwordInputMap,

                "FormattedTextField.border", textFieldBorder,
                "FormattedTextField.margin", new InsetsUIResource(3, 3, 3, 3),

                "Table.gridColor", TABLE_GRID_COLOR,
                "Table.background", getDesktopColor(),

                "ToggleButton.gradient", buttonGradient,

                "ToolBar.isRollover", Boolean.TRUE,
                "ToolBar.separatorColor", PRIMARY_CONTROL_COLOR,
                "ToolBar.separatorSize", new DimensionUIResource(8, 22),

                "ToolTip.background", SELECTION_BACKGROUND,
                "ToolTip.backgroundInactive", SELECTION_BACKGROUND,
                "ToolTip.hideAccelerator", Boolean.FALSE,

                "TitledBorder.border", SIPCommBorders.getBoldRoundBorder()
            };

        table.putDefaults(defaults);
    }

    /**
     * Returns the name of this theme.
     *
     * @return the name of this theme
     */
    @Override
    public String getName()
    {
        return "SipCommunicator";
    }

    /**
     * Returns the primary control dark shadow color resource.
     *
     * @return the primary control dark shadow color resource
     */
    @Override
    protected ColorUIResource getPrimary1()
    {
        return PRIMARY_CONTROL_DARK_SHADOW;
    }

    /**
     * Returns the primary control shadow color resource.
     *
     * @return the primary control shadow color resource
     */
    @Override
    protected ColorUIResource getPrimary2()
    {
        return PRIMARY_CONTROL_SHADOW;
    }

    /**
     * Returns the primary control color resource.
     *
     * @return the primary control color resource
     */
    @Override
    protected ColorUIResource getPrimary3()
    {
        return PRIMARY_CONTROL_COLOR;
    }

    /**
     * Returns the control dark shadow color resource.
     *
     * @return the control dark shadow color resource
     */
    @Override
    protected ColorUIResource getSecondary1()
    {
        return CONTROL_DARK_SHADOW;
    }

    /**
     * Returns the control shadow color resource.
     *
     * @return the control shadow color resource
     */
    @Override
    protected ColorUIResource getSecondary2()
    {
        return CONTROL_SHADOW;
    }

    /**
     * Returns the control color resource.
     *
     * @return the control color resource
     */
    @Override
    protected ColorUIResource getSecondary3()
    {
        return CONTROL_COLOR;
    }

    /**
     * Returns the control text color resource.
     *
     * @return the control text color resource
     */
    @Override
    protected ColorUIResource getBlack()
    {
        return CONTROL_TEXT_COLOR;
    }

    /**
     * Returns the desktop color resource.
     *
     * @return the desktop color resource
     */
    @Override
    public ColorUIResource getDesktopColor()
    {
        return DESKTOP_BACKGROUND_COLOR;
    }

    /**
     * Returns the window background color resource.
     *
     * @return the window background color resource
     */
    @Override
    public ColorUIResource getWindowBackground()
    {
        return getWhite();
    }

    /**
     * Returns the desktop background color resource.
     *
     * @return the desktop background color resource
     */
    @Override
    public ColorUIResource getControl()
    {
        return DESKTOP_BACKGROUND_COLOR;
    }

    /**
     * Returns the window background color resource.
     *
     * @return the window background color resource
     */
    @Override
    public ColorUIResource getMenuBackground()
    {
        return DESKTOP_BACKGROUND_COLOR;
    }

    /**
     * Returns the inactive control text color resource.
     *
     * @return the inactive control text color resource
     */
    @Override
    public ColorUIResource getInactiveControlTextColor()
    {
        return INACTIVE_CONTROL_TEXT_COLOR;
    }

    /**
     * Returns the menu disabled foreground color resource.
     *
     * @return the menu disabled foreground color resource
     */
    @Override
    public ColorUIResource getMenuDisabledForeground()
    {
        return MENU_DISABLED_FOREGROUND;
    }

    /**
     * Returns the control text font color resource.
     *
     * @return the control text font color resource
     */
    @Override
    public FontUIResource getControlTextFont()
    {
        return BASIC_FONT;
    }

    /**
     * Returns the system text font color resource.
     *
     * @return the system text font color resource
     */
    @Override
    public FontUIResource getSystemTextFont()
    {
        return BASIC_FONT;
    }

    /**
     * Returns the user text font color resource.
     *
     * @return the user text font color resource
     */
    @Override
    public FontUIResource getUserTextFont()
    {
        return BASIC_FONT;
    }

    /**
     * Returns the menu text font color resource.
     *
     * @return the menu text font color resource
     */
    @Override
    public FontUIResource getMenuTextFont()
    {
        return BASIC_FONT;
    }

    /**
     * Returns the window title font color resource.
     *
     * @return the window title font color resource
     */
    @Override
    public FontUIResource getWindowTitleFont()
    {
        return BASIC_FONT;
    }

    /**
     * Returns the window title font color resource.
     *
     * @return the window title font color resource
     */
    @Override
    public FontUIResource getSubTextFont()
    {
        return BASIC_FONT;
    }

    /**
     * Reloads defaults.
     */
    public void loadSkin()
    {
        PRIMARY_CONTROL_DARK_SHADOW =
            new ColorUIResource(GuiActivator.getResources().
                getColor("service.gui.PRIMARY_CONTROL_DARK_SHADOW"));

        PRIMARY_CONTROL_SHADOW =
            new ColorUIResource(GuiActivator.getResources().
                getColor("service.gui.PRIMARY_CONTROL_SHADOW"));

        CONTROL_DARK_SHADOW =
            new ColorUIResource(GuiActivator.getResources().
                getColor("service.gui.CONTROL_DARK_SHADOW"));

        CONTROL_SHADOW =
            new ColorUIResource(GuiActivator.getResources().
                getColor("service.gui.CONTROL_SHADOW"));

        CONTROL_COLOR =
            new ColorUIResource(GuiActivator.getResources().
                getColor("service.gui.colors.CONTROL"));


        PRIMARY_CONTROL_COLOR
            = new ColorUIResource(GuiActivator.getResources().
                getColor("service.gui.PRIMARY_COLOR_CONTROL"));

        BUTTON_GRADIENT_DARK_COLOR
            = new ColorUIResource(GuiActivator.getResources().
                getColor("service.gui.BUTTON_GRADIENT_DARK"));

        BUTTON_GRADIENT_LIGHT_COLOR
            = new ColorUIResource(GuiActivator.getResources().
                getColor("service.gui.BUTTON_GRADIENT_LIGHT"));

        SLIDER_GRADIENT_DARK_COLOR
            = new ColorUIResource(GuiActivator.getResources().
                getColor("service.gui.SLIDER_GRADIENT_DARK"));

        SLIDER_GRADIENT_LIGHT_COLOR
            = new ColorUIResource(GuiActivator.getResources().
                getColor("service.gui.SLIDER_GRADIENT_LIGHT"));

        SELECTION_FOREGROUND
            = new ColorUIResource(GuiActivator.getResources().
                getColor("service.gui.SELECTION_FOREGROUND"));

        SELECTION_BACKGROUND
            = new ColorUIResource(GuiActivator.getResources().
                getColor("service.gui.SELECTION_BACKGROUND"));

        SPLIT_PANE_DEVIDER_FOCUS_COLOR
            = new ColorUIResource(GuiActivator.getResources()
                .getColor("service.gui.SPLIT_PANE_DIVIDER_FOCUSED"));

        TABBED_PANE_HIGHLIGHT_COLOR
            = new ColorUIResource(GuiActivator.getResources()
                .getColor("service.gui.TABBED_PANE_BORDER_HIGHLIGHT"));

        TABLE_GRID_COLOR
            = new ColorUIResource(GuiActivator.getResources().
                getColor("service.gui.TABLE_GRID"));

        SCROLL_BAR_TRACK_HIGHLIGHT
            = new ColorUIResource(GuiActivator.getResources()
                .getColor("service.gui.SCROLLBAR_TRACK_LIGHT"));

        SCROLL_BAR_DARK_SHADOW
            = new ColorUIResource(GuiActivator.getResources().
                getColor("service.gui.SCROLLBAR_DARK_SHADOW"));

        DESKTOP_BACKGROUND_COLOR
            = new ColorUIResource(GuiActivator.getResources().
                getColor("service.gui.DESKTOP_BACKGROUND"));

        CONTROL_TEXT_COLOR
            = new ColorUIResource(GuiActivator.getResources().
                getColor("service.gui.TEXT"));

        INACTIVE_CONTROL_TEXT_COLOR
            = new ColorUIResource(GuiActivator.getResources().
                getColor("service.gui.INACTIVE_TEXT"));

        MENU_DISABLED_FOREGROUND
            = new ColorUIResource(GuiActivator.getResources()
                .getColor("service.gui.MENU_DISABLED_FOREGROUND"));

        TAB_TITLE_HIGHLIGHT
            = new ColorUIResource(GuiActivator.getResources()
                .getColor("service.gui.TAB_TITLE_HIGHLIGHT"));

        TAB_TITLE
            = new ColorUIResource(GuiActivator.getResources()
                .getColor("service.gui.TAB_TITLE"));
    }
}