~ubuntu-branches/debian/stretch/insubstantial/stretch

« back to all changes in this revision

Viewing changes to substance/src/main/java/org/pushingpixels/substance/internal/utils/SkinUtilities.java

  • Committer: Package Import Robot
  • Author(s): Felix Natter
  • Date: 2016-01-18 20:58:45 UTC
  • Revision ID: package-import@ubuntu.com-20160118205845-crbmrkda61qsi5qa
Tags: upstream-7.3+dfsg2
ImportĀ upstreamĀ versionĀ 7.3+dfsg2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.pushingpixels.substance.internal.utils;
 
2
 
 
3
import java.awt.*;
 
4
import java.util.Locale;
 
5
 
 
6
import javax.swing.Icon;
 
7
import javax.swing.UIDefaults;
 
8
import javax.swing.UIManager;
 
9
import javax.swing.border.EmptyBorder;
 
10
import javax.swing.plaf.*;
 
11
import javax.swing.plaf.basic.BasicBorders;
 
12
import javax.swing.plaf.basic.BasicBorders.MarginBorder;
 
13
 
 
14
import org.pushingpixels.substance.api.*;
 
15
import org.pushingpixels.substance.api.inputmaps.InputMapSet;
 
16
import org.pushingpixels.substance.api.inputmaps.SubstanceInputMapUtilities;
 
17
import org.pushingpixels.substance.api.renderers.SubstanceDefaultListCellRenderer;
 
18
import org.pushingpixels.substance.internal.utils.border.*;
 
19
import org.pushingpixels.substance.internal.utils.icon.*;
 
20
import org.pushingpixels.substance.internal.utils.scroll.SubstanceScrollPaneBorder;
 
21
 
 
22
public class SkinUtilities {
 
23
        /**
 
24
         * Adds skin-specific entries to the UI defaults table.
 
25
         * 
 
26
         * @param table
 
27
         *            UI defaults table.
 
28
         */
 
29
        public static void addCustomEntriesToTable(UIDefaults table,
 
30
                        SubstanceSkin skin) {
 
31
                Object menuArrowIcon = new UIDefaults.LazyValue() {
 
32
                        @Override
 
33
            public Object createValue(UIDefaults table) {
 
34
                                return new MenuArrowIcon(null);
 
35
                        }
 
36
                };
 
37
 
 
38
                Object listCellRendererActiveValue = new UIDefaults.ActiveValue() {
 
39
                        @Override
 
40
            public Object createValue(UIDefaults table) {
 
41
                                return new SubstanceDefaultListCellRenderer.SubstanceUIResource();
 
42
                        }
 
43
                };
 
44
 
 
45
                SubstanceColorScheme mainActiveScheme = skin
 
46
                                .getActiveColorScheme(DecorationAreaType.NONE);
 
47
                SubstanceColorScheme mainEnabledScheme = skin
 
48
                                .getEnabledColorScheme(DecorationAreaType.NONE);
 
49
                SubstanceColorScheme mainDisabledScheme = skin
 
50
                                .getDisabledColorScheme(DecorationAreaType.NONE);
 
51
                Color control = new ColorUIResource(
 
52
                                mainActiveScheme.getLightColor());
 
53
                Color foregroundColor = SubstanceColorUtilities
 
54
                                .getForegroundColor(mainEnabledScheme);
 
55
                Color backgroundActiveColor = new ColorUIResource(
 
56
                                mainActiveScheme.getBackgroundFillColor());
 
57
                Color backgroundDefaultColor = new ColorUIResource(
 
58
                                mainEnabledScheme.getBackgroundFillColor());
 
59
                Color textBackgroundColor = new ColorUIResource(
 
60
                                mainActiveScheme.getTextBackgroundFillColor());
 
61
 
 
62
                Color disabledForegroundColor = SubstanceColorUtilities
 
63
                                .getForegroundColor(mainDisabledScheme);
 
64
                Color disabledTextComponentForegroundColor = disabledForegroundColor;
 
65
                float alpha = skin.getAlpha(null, ComponentState.DISABLED_UNSELECTED);
 
66
                if (alpha < 1.0f) {
 
67
                        ColorUIResource defaultTextBackgroundColor = SubstanceColorUtilities
 
68
                                        .getDefaultBackgroundColor(true, skin, false);
 
69
                        disabledTextComponentForegroundColor = new ColorUIResource(
 
70
                                        SubstanceColorUtilities.getInterpolatedColor(
 
71
                                                        disabledTextComponentForegroundColor,
 
72
                                                        defaultTextBackgroundColor, alpha));
 
73
                }
 
74
 
 
75
                Color lineColor = new ColorUIResource(mainActiveScheme.getLineColor());
 
76
 
 
77
                Color lineColorDefault = new ColorUIResource(
 
78
                                mainEnabledScheme.getLineColor());
 
79
 
 
80
                int lcb = SubstanceColorUtilities
 
81
                                .getColorBrightness(lineColor.getRGB());
 
82
                Color lineBwColor = new ColorUIResource(new Color(lcb, lcb, lcb));
 
83
 
 
84
                SubstanceColorScheme textHighlightColorScheme = skin.getColorScheme(
 
85
                                (Component) null, ColorSchemeAssociationKind.TEXT_HIGHLIGHT,
 
86
                                ComponentState.SELECTED);
 
87
                if (textHighlightColorScheme == null) {
 
88
                        textHighlightColorScheme = skin.getColorScheme(null,
 
89
                                        ComponentState.ROLLOVER_SELECTED);
 
90
                }
 
91
                Color selectionTextBackgroundColor = new ColorUIResource(
 
92
                                textHighlightColorScheme.getSelectionBackgroundColor());
 
93
                Color selectionTextForegroundColor = new ColorUIResource(
 
94
                                textHighlightColorScheme.getSelectionForegroundColor());
 
95
 
 
96
                Color selectionCellForegroundColor = new ColorUIResource(
 
97
                                textHighlightColorScheme.getForegroundColor());
 
98
                Color selectionCellBackgroundColor = new ColorUIResource(
 
99
                                textHighlightColorScheme.getBackgroundFillColor());
 
100
 
 
101
                Object regularMarginBorder = new UIDefaults.LazyValue() {
 
102
                        @Override
 
103
                        public Object createValue(UIDefaults table) {
 
104
                                return new BorderUIResource.CompoundBorderUIResource(
 
105
                                                new SubstanceBorder(), new BasicBorders.MarginBorder());
 
106
                        }
 
107
                };
 
108
 
 
109
                Object textBorder = new UIDefaults.LazyValue() {
 
110
                        @Override
 
111
                        public Object createValue(UIDefaults table) {
 
112
                                return new BorderUIResource.CompoundBorderUIResource(
 
113
                                                new SubstanceTextComponentBorder(
 
114
                                                                SubstanceSizeUtils
 
115
                                                                                .getTextBorderInsets(SubstanceSizeUtils
 
116
                                                                                                .getControlFontSize())),
 
117
                                                new BasicBorders.MarginBorder());
 
118
                        }
 
119
                };
 
120
 
 
121
                Object textMarginBorder = new UIDefaults.LazyValue() {
 
122
                        @Override
 
123
                        public Object createValue(UIDefaults table) {
 
124
                                return new BasicBorders.MarginBorder();
 
125
                        }
 
126
                };
 
127
 
 
128
                Object tooltipBorder = new UIDefaults.LazyValue() {
 
129
                        @Override
 
130
                        public Object createValue(UIDefaults table) {
 
131
                                return new SubstanceBorder(
 
132
                                                SubstanceSizeUtils
 
133
                                                                .getToolTipBorderInsets(SubstanceSizeUtils
 
134
                                                                                .getControlFontSize()));
 
135
                        }
 
136
                };
 
137
 
 
138
                Object comboBorder = new UIDefaults.LazyValue() {
 
139
                        @Override
 
140
                        public Object createValue(UIDefaults table) {
 
141
                                return new SubstanceBorder(
 
142
                                                SubstanceSizeUtils
 
143
                                                                .getComboBorderInsets(SubstanceSizeUtils
 
144
                                                                                .getControlFontSize()));
 
145
                        }
 
146
                };
 
147
 
 
148
                Object spinnerBorder = new UIDefaults.LazyValue() {
 
149
                        @Override
 
150
                        public Object createValue(UIDefaults table) {
 
151
                                return new BorderUIResource.CompoundBorderUIResource(
 
152
                                                new SubstanceTextComponentBorder(
 
153
                                                                SubstanceSizeUtils
 
154
                                                                                .getSpinnerBorderInsets(SubstanceSizeUtils
 
155
                                                                                                .getControlFontSize())),
 
156
                                                new BasicBorders.MarginBorder());
 
157
                        }
 
158
                };
 
159
 
 
160
                // SubstanceColorSchemeBundle titlePaneBundle =
 
161
                // skin.colorSchemeBundleMap
 
162
                // .containsKey(DecorationAreaType.PRIMARY_TITLE_PANE) ?
 
163
                // skin.colorSchemeBundleMap
 
164
                // .get(DecorationAreaType.PRIMARY_TITLE_PANE)
 
165
                // : skin.colorSchemeBundleMap.get(DecorationAreaType.NONE);
 
166
                final SubstanceColorScheme titlePaneScheme = skin
 
167
                                .getBackgroundColorScheme(DecorationAreaType.PRIMARY_TITLE_PANE);
 
168
                // /skin.getColorScheme(
 
169
                // DecorationAreaType.PRIMARY_TITLE_PANE,
 
170
                // ColorSchemeAssociationKind.FILL, ComponentState.ACTIVE);
 
171
                //
 
172
                // titlePaneBundle.getActiveColorScheme();
 
173
 
 
174
                Object menuItemInsets = new UIDefaults.LazyValue() {
 
175
                        @Override
 
176
                        public Object createValue(UIDefaults table) {
 
177
                                int menuItemMargin = SubstanceSizeUtils
 
178
                                                .getMenuItemMargin(SubstanceSizeUtils
 
179
                                                                .getComponentFontSize(null));
 
180
                                return new InsetsUIResource(menuItemMargin, menuItemMargin,
 
181
                                                menuItemMargin, menuItemMargin);
 
182
                        }
 
183
                };
 
184
 
 
185
                Object emptyIcon = new UIDefaults.LazyValue() {
 
186
                        @Override
 
187
                        public Object createValue(UIDefaults table) {
 
188
                                return new IconUIResource(new Icon() {
 
189
                                        @Override
 
190
                    public int getIconHeight() {
 
191
                                                // return the value that matches the core height, so
 
192
                                                // that the DefaultTreeCellEditor.EditorContainer
 
193
                                                // returns the correct value in its getPreferredSize
 
194
                                                // when it consults the "editingIcon" height.
 
195
                                                return 16;
 
196
                                        }
 
197
 
 
198
                                        @Override
 
199
                    public int getIconWidth() {
 
200
                                                return 2;
 
201
                                        }
 
202
 
 
203
                                        @Override
 
204
                    public void paintIcon(Component c, Graphics g, int x, int y) {
 
205
                                        }
 
206
                                });
 
207
                        }
 
208
                };
 
209
 
 
210
                Object[] defaults = new Object[] {
 
211
                "activeCaption",
 
212
                new ColorUIResource(skin.getBackgroundColorScheme(DecorationAreaType.PRIMARY_TITLE_PANE).getBackgroundFillColor()),
 
213
 
 
214
                "activeCaptionBorder",
 
215
                new ColorUIResource(skin.getColorScheme(DecorationAreaType.PRIMARY_TITLE_PANE, ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED).getBackgroundFillColor()),
 
216
 
 
217
                "activeCaptionText",
 
218
                SubstanceColorUtilities.getForegroundColor(skin.getBackgroundColorScheme(
 
219
                                                                DecorationAreaType.PRIMARY_TITLE_PANE)),
 
220
 
 
221
                                "control",
 
222
                new ColorUIResource(mainEnabledScheme.getBackgroundFillColor()),
 
223
 
 
224
                "controlDkShadow",
 
225
                new ColorUIResource(mainEnabledScheme.getUltraDarkColor()),
 
226
 
 
227
                "controlHighlight",
 
228
                new ColorUIResource(mainEnabledScheme.getLightColor()),
 
229
 
 
230
                "controlLtHighlight",
 
231
                new ColorUIResource(mainEnabledScheme.getExtraLightColor()),
 
232
 
 
233
                "controlShadow",
 
234
                new ColorUIResource(mainEnabledScheme.getDarkColor()),
 
235
 
 
236
                "controlText",
 
237
                new ColorUIResource(mainEnabledScheme.getForegroundColor()),
 
238
 
 
239
                "desktop",
 
240
                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
241
                                                false),
 
242
 
 
243
                "inactiveCaption",
 
244
                new ColorUIResource(skin.getBackgroundColorScheme(
 
245
                        UIManager.getBoolean(SubstanceLookAndFeel.WINDOW_AUTO_DEACTIVATE)
 
246
                                ? DecorationAreaType.PRIMARY_TITLE_PANE
 
247
                                : DecorationAreaType.PRIMARY_TITLE_PANE_INACTIVE
 
248
                        ).getBackgroundFillColor()),
 
249
 
 
250
                "inactiveCaptionBorder",
 
251
                new ColorUIResource(skin.getColorScheme(
 
252
                        UIManager.getBoolean(SubstanceLookAndFeel.WINDOW_AUTO_DEACTIVATE)
 
253
                                ? DecorationAreaType.PRIMARY_TITLE_PANE
 
254
                                : DecorationAreaType.PRIMARY_TITLE_PANE_INACTIVE,
 
255
                        ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED).getBackgroundFillColor()),
 
256
 
 
257
                "inactiveCaptionText",
 
258
                SubstanceColorUtilities.getForegroundColor(skin.getBackgroundColorScheme(
 
259
                        UIManager.getBoolean(SubstanceLookAndFeel.WINDOW_AUTO_DEACTIVATE)
 
260
                                ? DecorationAreaType.PRIMARY_TITLE_PANE
 
261
                                : DecorationAreaType.PRIMARY_TITLE_PANE_INACTIVE)),
 
262
 
 
263
                "info", // tooltip
 
264
                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
265
                        false),
 
266
 
 
267
                "infoText",
 
268
                foregroundColor,
 
269
 
 
270
                "menu",
 
271
                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
272
                        false),
 
273
 
 
274
                "menuText",
 
275
                foregroundColor,
 
276
 
 
277
                "scrollbar",
 
278
                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
279
                                                false),
 
280
 
 
281
                "text",
 
282
                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
283
                        false),
 
284
 
 
285
                "textHighlight",
 
286
                selectionTextBackgroundColor,
 
287
 
 
288
                "textHighlightText",
 
289
                selectionTextForegroundColor,
 
290
 
 
291
                "textInactiveText",
 
292
                disabledTextComponentForegroundColor,
 
293
 
 
294
                "textText",
 
295
                foregroundColor,
 
296
 
 
297
                "window",
 
298
                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
299
                                                false),
 
300
 
 
301
                "windowBorder",
 
302
                control,
 
303
 
 
304
                "windowText",
 
305
                foregroundColor,
 
306
 
 
307
 
 
308
                                "Button.defaultButtonFollowsFocus",
 
309
                                Boolean.FALSE,
 
310
 
 
311
                                "Button.disabledText",
 
312
                                disabledForegroundColor,
 
313
 
 
314
                                "Button.foreground",
 
315
                                foregroundColor,
 
316
 
 
317
                                "Button.margin",
 
318
                                new InsetsUIResource(0, 0, 0, 0),
 
319
 
 
320
                                "CheckBox.background",
 
321
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
322
                                                false),
 
323
 
 
324
                                "CheckBox.border",
 
325
                                new BorderUIResource.CompoundBorderUIResource(
 
326
                                                SubstanceSizeUtils.getCheckBoxBorder(
 
327
                                                                SubstanceSizeUtils.getControlFontSize(),
 
328
                                                                ComponentOrientation.getOrientation(
 
329
                                                                                Locale.getDefault()).isLeftToRight()),
 
330
                                                new MarginBorder()),
 
331
 
 
332
                                "CheckBox.disabledText",
 
333
                                disabledForegroundColor,
 
334
 
 
335
                                "CheckBox.foreground",
 
336
                                foregroundColor,
 
337
 
 
338
                                "CheckBoxMenuItem.acceleratorForeground",
 
339
                                foregroundColor,
 
340
 
 
341
                                "CheckBoxMenuItem.acceleratorSelectionForeground",
 
342
                                foregroundColor,
 
343
 
 
344
                                "CheckBoxMenuItem.background",
 
345
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
346
                                                false),
 
347
 
 
348
                                "CheckBoxMenuItem.borderPainted",
 
349
                                Boolean.FALSE,
 
350
 
 
351
                                "CheckBoxMenuItem.checkIcon",
 
352
                                new CheckBoxMenuItemIcon(null,
 
353
                                                1 + SubstanceSizeUtils
 
354
                                                                .getMenuCheckMarkSize(SubstanceSizeUtils
 
355
                                                                                .getControlFontSize())),
 
356
 
 
357
                                "CheckBoxMenuItem.disabledForeground",
 
358
                                disabledForegroundColor,
 
359
 
 
360
                                "CheckBoxMenuItem.foreground",
 
361
                                foregroundColor,
 
362
 
 
363
                                "CheckBoxMenuItem.margin",
 
364
                                menuItemInsets,
 
365
 
 
366
                                "CheckBoxMenuItem.selectionForeground",
 
367
                                selectionCellForegroundColor,
 
368
 
 
369
                                "ColorChooser.background",
 
370
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
371
                                                false),
 
372
 
 
373
                                "ColorChooser.foreground",
 
374
                                foregroundColor,
 
375
 
 
376
                                "ComboBox.background",
 
377
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
378
                                                false),
 
379
 
 
380
                                "ComboBox.border",
 
381
                                comboBorder,
 
382
 
 
383
                                "ComboBox.disabledBackground",
 
384
                                textBackgroundColor,
 
385
 
 
386
                                "ComboBox.disabledForeground",
 
387
                                disabledForegroundColor,
 
388
 
 
389
                                "ComboBox.foreground",
 
390
                                foregroundColor,
 
391
 
 
392
                                "ComboBox.selectionBackground",
 
393
                                selectionCellBackgroundColor,
 
394
 
 
395
                                "ComboBox.selectionForeground",
 
396
                                selectionCellForegroundColor,
 
397
 
 
398
                                "DesktopIcon.border",
 
399
                                regularMarginBorder,
 
400
 
 
401
                                "DesktopIcon.width",
 
402
                140,
 
403
 
 
404
                                "Desktop.background",
 
405
                                new ColorUIResource(new Color(0x0, true)),
 
406
 
 
407
                                "Desktop.foreground",
 
408
                                foregroundColor,
 
409
 
 
410
                                "Dialog.background",
 
411
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
412
                                                false),
 
413
 
 
414
                                "EditorPane.background",
 
415
                                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
416
                                                false),
 
417
 
 
418
                                "EditorPane.border",
 
419
                                textMarginBorder,
 
420
 
 
421
                                "EditorPane.foreground",
 
422
                                foregroundColor,
 
423
 
 
424
                                "EditorPane.caretForeground",
 
425
                                foregroundColor,
 
426
 
 
427
                                "EditorPane.disabledBackground",
 
428
                                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
429
                                                true),
 
430
 
 
431
                                "EditorPane.inactiveBackground",
 
432
                                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
433
                                                true),
 
434
 
 
435
                                "EditorPane.inactiveForeground",
 
436
                                disabledTextComponentForegroundColor,
 
437
 
 
438
                                "EditorPane.selectionBackground",
 
439
                                selectionTextBackgroundColor,
 
440
 
 
441
                                "EditorPane.selectionForeground",
 
442
                                selectionTextForegroundColor,
 
443
 
 
444
                                "FileChooser.upFolderIcon",
 
445
                                new UIDefaults.LazyValue() {
 
446
                                        @Override
 
447
                    public Object createValue(UIDefaults table) {
 
448
                                                return SubstanceCoreUtilities
 
449
                                                                .getIcon("resource/go-up.png");
 
450
                                        }
 
451
                                },
 
452
 
 
453
                                "FileChooser.newFolderIcon",
 
454
                                new UIDefaults.LazyValue() {
 
455
                                        @Override
 
456
                    public Object createValue(UIDefaults table) {
 
457
                                                return SubstanceCoreUtilities
 
458
                                                                .getIcon("resource/folder-new.png");
 
459
                                        }
 
460
                                },
 
461
 
 
462
                                "FileChooser.homeFolderIcon",
 
463
                                new UIDefaults.LazyValue() {
 
464
                                        @Override
 
465
                    public Object createValue(UIDefaults table) {
 
466
                                                return SubstanceCoreUtilities
 
467
                                                                .getIcon("resource/user-home.png");
 
468
                                        }
 
469
                                },
 
470
 
 
471
                                "FileChooser.listViewIcon",
 
472
                                new UIDefaults.LazyValue() {
 
473
                                        @Override
 
474
                    public Object createValue(UIDefaults table) {
 
475
                                                return SubstanceCoreUtilities
 
476
                                                                .getIcon("resource/application_view_list.png");
 
477
                                        }
 
478
                                },
 
479
 
 
480
                                "FileChooser.detailsViewIcon",
 
481
                                new UIDefaults.LazyValue() {
 
482
                                        @Override
 
483
                    public Object createValue(UIDefaults table) {
 
484
                                                return SubstanceCoreUtilities
 
485
                                                                .getIcon("resource/application_view_detail.png");
 
486
                                        }
 
487
                                },
 
488
 
 
489
                                "FileChooser.usesSingleFilePane",
 
490
                                Boolean.TRUE,
 
491
 
 
492
                                "FileView.computerIcon",
 
493
                                new UIDefaults.LazyValue() {
 
494
                                        @Override
 
495
                    public Object createValue(UIDefaults table) {
 
496
                                                return SubstanceCoreUtilities
 
497
                                                                .getIcon("resource/computer.png");
 
498
                                        }
 
499
                                },
 
500
 
 
501
                                "FileView.directoryIcon",
 
502
                                new UIDefaults.LazyValue() {
 
503
                                        @Override
 
504
                    public Object createValue(UIDefaults table) {
 
505
                                                return SubstanceCoreUtilities
 
506
                                                                .getIcon("resource/folder.png");
 
507
                                        }
 
508
                                },
 
509
 
 
510
                                "FileView.fileIcon",
 
511
                                new UIDefaults.LazyValue() {
 
512
                                        @Override
 
513
                    public Object createValue(UIDefaults table) {
 
514
                                                return SubstanceCoreUtilities
 
515
                                                                .getIcon("resource/text-x-generic.png");
 
516
                                        }
 
517
                                },
 
518
 
 
519
                                "FileView.floppyDriveIcon",
 
520
                                new UIDefaults.LazyValue() {
 
521
                                        @Override
 
522
                    public Object createValue(UIDefaults table) {
 
523
                                                return SubstanceCoreUtilities
 
524
                                                                .getIcon("resource/media-floppy.png");
 
525
                                        }
 
526
                                },
 
527
 
 
528
                                "FileView.hardDriveIcon",
 
529
                                new UIDefaults.LazyValue() {
 
530
                                        @Override
 
531
                    public Object createValue(UIDefaults table) {
 
532
                                                return SubstanceCoreUtilities
 
533
                                                                .getIcon("resource/drive-harddisk.png");
 
534
                                        }
 
535
                                },
 
536
 
 
537
                                "FormattedTextField.background",
 
538
                                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
539
                                                false),
 
540
 
 
541
                                "FormattedTextField.border",
 
542
                                textBorder,
 
543
 
 
544
                                "FormattedTextField.caretForeground",
 
545
                                foregroundColor,
 
546
 
 
547
                                "FormattedTextField.disabledBackground",
 
548
                                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
549
                                                true),
 
550
 
 
551
                                "FormattedTextField.foreground",
 
552
                                foregroundColor,
 
553
 
 
554
                                "FormattedTextField.inactiveBackground",
 
555
                                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
556
                                                true),
 
557
 
 
558
                                "FormattedTextField.inactiveForeground",
 
559
                                disabledTextComponentForegroundColor,
 
560
 
 
561
                                "FormattedTextField.selectionBackground",
 
562
                                selectionTextBackgroundColor,
 
563
 
 
564
                                "FormattedTextField.selectionForeground",
 
565
                                selectionTextForegroundColor,
 
566
 
 
567
                                "InternalFrame.activeTitleBackground",
 
568
                new ColorUIResource(skin.getBackgroundColorScheme(DecorationAreaType.PRIMARY_TITLE_PANE).getBackgroundFillColor()),
 
569
 
 
570
                "InternalFrame.activeTitleForeground",
 
571
                SubstanceColorUtilities.getForegroundColor(skin.getBackgroundColorScheme(
 
572
                                DecorationAreaType.PRIMARY_TITLE_PANE)),
 
573
 
 
574
                                "InternalFrame.inactiveTitleBackground",
 
575
                                new ColorUIResource(skin.getBackgroundColorScheme(DecorationAreaType.PRIMARY_TITLE_PANE_INACTIVE).getBackgroundFillColor()),
 
576
 
 
577
                                "InternalFrame.inactiveTitleForeground",
 
578
                                SubstanceColorUtilities.getForegroundColor(skin.getBackgroundColorScheme(
 
579
                                                                DecorationAreaType.PRIMARY_TITLE_PANE_INACTIVE)),
 
580
 
 
581
                                "InternalFrame.border",
 
582
                                new BorderUIResource(new SubstancePaneBorder()),
 
583
 
 
584
                                "InternalFrame.closeIcon",
 
585
                                new UIDefaults.LazyValue() {
 
586
                                        @Override
 
587
                    public Object createValue(UIDefaults table) {
 
588
                                                return SubstanceImageCreator.getCloseIcon(
 
589
                                                                titlePaneScheme, titlePaneScheme);
 
590
                                        }
 
591
                                },
 
592
 
 
593
                                "InternalFrame.iconifyIcon",
 
594
                                new UIDefaults.LazyValue() {
 
595
                                        @Override
 
596
                    public Object createValue(UIDefaults table) {
 
597
                                                return SubstanceImageCreator.getMinimizeIcon(
 
598
                                                                titlePaneScheme, titlePaneScheme);
 
599
                                        }
 
600
                                },
 
601
 
 
602
                                "InternalFrame.maximizeIcon",
 
603
                                new UIDefaults.LazyValue() {
 
604
                                        @Override
 
605
                    public Object createValue(UIDefaults table) {
 
606
                                                return SubstanceImageCreator.getMaximizeIcon(
 
607
                                                                titlePaneScheme, titlePaneScheme);
 
608
                                        }
 
609
                                },
 
610
 
 
611
                                "InternalFrame.minimizeIcon",
 
612
                                new UIDefaults.LazyValue() {
 
613
                                        @Override
 
614
                    public Object createValue(UIDefaults table) {
 
615
                                                return SubstanceImageCreator.getRestoreIcon(
 
616
                                                                titlePaneScheme, titlePaneScheme);
 
617
                                        }
 
618
                                },
 
619
 
 
620
                                "InternalFrame.paletteCloseIcon",
 
621
                                new UIDefaults.LazyValue() {
 
622
                                        @Override
 
623
                    public Object createValue(UIDefaults table) {
 
624
                                                return SubstanceImageCreator.getCloseIcon(
 
625
                                                                titlePaneScheme, titlePaneScheme);
 
626
                                        }
 
627
                                },
 
628
 
 
629
                                "Label.background",
 
630
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
631
                                                false),
 
632
 
 
633
                                "Label.foreground",
 
634
                                foregroundColor,
 
635
 
 
636
                                "Label.disabledText",
 
637
                                disabledForegroundColor,
 
638
 
 
639
                                "Label.disabledForeground",
 
640
                                disabledForegroundColor,
 
641
 
 
642
                                "List.background",
 
643
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
644
                                                false),
 
645
 
 
646
                                "List.cellRenderer",
 
647
                                listCellRendererActiveValue,
 
648
 
 
649
                                "List.focusCellHighlightBorder",
 
650
                                new SubstanceBorder(new Insets(1, 1, 1, 1)),
 
651
 
 
652
                                "List.focusSelectedCellHighlightBorder",
 
653
                                new BorderUIResource.EmptyBorderUIResource(1, 1, 1, 1),
 
654
 
 
655
                                "List.foreground",
 
656
                                foregroundColor,
 
657
 
 
658
                                "List.selectionBackground",
 
659
                                selectionCellBackgroundColor,
 
660
 
 
661
                                "List.selectionForeground",
 
662
                                selectionCellForegroundColor,
 
663
 
 
664
                                "Menu.arrowIcon",
 
665
                                menuArrowIcon,
 
666
 
 
667
                                "Menu.background",
 
668
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
669
                                                false),
 
670
 
 
671
                                "Menu.borderPainted",
 
672
                                Boolean.FALSE,
 
673
 
 
674
                                "Menu.checkIcon",
 
675
                                null,
 
676
 
 
677
                                "Menu.disabledForeground",
 
678
                                disabledForegroundColor,
 
679
 
 
680
                                "Menu.foreground",
 
681
                                foregroundColor,
 
682
 
 
683
                                "Menu.margin",
 
684
                                menuItemInsets,
 
685
 
 
686
                                "Menu.selectionForeground",
 
687
                                selectionCellForegroundColor,
 
688
 
 
689
                                "MenuBar.background",
 
690
                                skin.isRegisteredAsDecorationArea(DecorationAreaType.HEADER) ? new ColorUIResource(
 
691
                                                skin.getActiveColorScheme(DecorationAreaType.HEADER)
 
692
                                                                .getMidColor()) : SubstanceColorUtilities
 
693
                                                .getDefaultBackgroundColor(false, skin, false),
 
694
 
 
695
                                "MenuBar.foreground",
 
696
                                new ColorUIResource(skin.getActiveColorScheme(
 
697
                                                DecorationAreaType.HEADER).getForegroundColor()),
 
698
 
 
699
                                "MenuBar.border",
 
700
                                null,
 
701
 
 
702
                                "MenuItem.acceleratorForeground",
 
703
                                foregroundColor,
 
704
 
 
705
                                "MenuItem.acceleratorSelectionForeground",
 
706
                                foregroundColor,
 
707
 
 
708
                                "MenuItem.background",
 
709
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
710
                                                false),
 
711
 
 
712
                                "MenuItem.borderPainted",
 
713
                                Boolean.FALSE,
 
714
 
 
715
                                "MenuItem.checkIcon",
 
716
                                null,
 
717
 
 
718
                                "MenuItem.disabledForeground",
 
719
                                disabledForegroundColor,
 
720
 
 
721
                                "MenuItem.foreground",
 
722
                                foregroundColor,
 
723
 
 
724
                                "MenuItem.margin",
 
725
                                menuItemInsets,
 
726
 
 
727
                                "MenuItem.selectionForeground",
 
728
                                selectionCellForegroundColor,
 
729
 
 
730
                                "OptionPane.background",
 
731
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
732
                                                false),
 
733
 
 
734
                                "OptionPane.errorIcon",
 
735
                                new UIDefaults.LazyValue() {
 
736
                                        @Override
 
737
                    public Object createValue(UIDefaults table) {
 
738
                                                return SubstanceCoreUtilities
 
739
                                                                .getIcon("resource/32/dialog-error.png");
 
740
                                        }
 
741
                                },
 
742
 
 
743
                                "OptionPane.foreground",
 
744
                                foregroundColor,
 
745
 
 
746
                                "OptionPane.informationIcon",
 
747
                                new UIDefaults.LazyValue() {
 
748
                                        @Override
 
749
                    public Object createValue(UIDefaults table) {
 
750
                                                return SubstanceCoreUtilities
 
751
                                                                .getIcon("resource/32/dialog-information.png");
 
752
                                        }
 
753
                                },
 
754
 
 
755
                                "OptionPane.messageForeground",
 
756
                                foregroundColor,
 
757
 
 
758
                                "OptionPane.questionIcon",
 
759
                                new UIDefaults.LazyValue() {
 
760
                                        @Override
 
761
                    public Object createValue(UIDefaults table) {
 
762
                                                return SubstanceCoreUtilities
 
763
                                                                .getIcon("resource/32/help-browser.png");
 
764
                                        }
 
765
                                },
 
766
 
 
767
                                "OptionPane.warningIcon",
 
768
                                new UIDefaults.LazyValue() {
 
769
                                        @Override
 
770
                    public Object createValue(UIDefaults table) {
 
771
                                                return SubstanceCoreUtilities
 
772
                                                                .getIcon("resource/32/dialog-warning.png");
 
773
                                        }
 
774
                                },
 
775
 
 
776
                                "Panel.background",
 
777
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
778
                                                false),
 
779
 
 
780
                                "Panel.foreground",
 
781
                                foregroundColor,
 
782
 
 
783
                                "PasswordField.background",
 
784
                                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
785
                                                false),
 
786
 
 
787
                                "PasswordField.border",
 
788
                                textBorder,
 
789
 
 
790
                                "PasswordField.caretForeground",
 
791
                                foregroundColor,
 
792
 
 
793
                                "PasswordField.disabledBackground",
 
794
                                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
795
                                                true),
 
796
 
 
797
                                "PasswordField.foreground",
 
798
                                foregroundColor,
 
799
 
 
800
                                "PasswordField.inactiveBackground",
 
801
                                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
802
                                                true),
 
803
 
 
804
                                "PasswordField.inactiveForeground",
 
805
                                disabledTextComponentForegroundColor,
 
806
 
 
807
                                "PasswordField.selectionBackground",
 
808
                                selectionTextBackgroundColor,
 
809
 
 
810
                                "PasswordField.selectionForeground",
 
811
                                selectionTextForegroundColor,
 
812
 
 
813
                                "PopupMenu.background",
 
814
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
815
                                                false),
 
816
 
 
817
                                "PopupMenu.border",
 
818
                                regularMarginBorder,
 
819
 
 
820
                                "ProgressBar.border",
 
821
                                new BorderUIResource(new SubstanceBorder()),
 
822
 
 
823
                                "ProgressBar.cycleTime",
 
824
                1000,
 
825
 
 
826
                                "ProgressBar.repaintInterval",
 
827
                50,
 
828
 
 
829
                                "ProgressBar.horizontalSize",
 
830
                                new DimensionUIResource(146,
 
831
                                                SubstanceSizeUtils.getControlFontSize()),
 
832
 
 
833
                                "ProgressBar.verticalSize",
 
834
                                new DimensionUIResource(
 
835
                                                SubstanceSizeUtils.getControlFontSize(), 146),
 
836
 
 
837
                                "ProgressBar.selectionBackground",
 
838
                                foregroundColor,
 
839
 
 
840
                                "ProgressBar.selectionForeground",
 
841
                                foregroundColor,
 
842
 
 
843
                                "RadioButton.background",
 
844
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
845
                                                false),
 
846
 
 
847
                                "RadioButton.border",
 
848
                                new BorderUIResource.CompoundBorderUIResource(
 
849
                                                SubstanceSizeUtils.getRadioButtonBorder(
 
850
                                                                SubstanceSizeUtils.getControlFontSize(),
 
851
                                                                ComponentOrientation.getOrientation(
 
852
                                                                                Locale.getDefault()).isLeftToRight()),
 
853
                                                new MarginBorder()),
 
854
 
 
855
                                "RadioButton.foreground",
 
856
                                foregroundColor,
 
857
 
 
858
                                "RadioButton.disabledText",
 
859
                                disabledForegroundColor,
 
860
 
 
861
                                "RadioButtonMenuItem.acceleratorForeground",
 
862
                                foregroundColor,
 
863
 
 
864
                                "RadioButtonMenuItem.acceleratorSelectionForeground",
 
865
                                foregroundColor,
 
866
 
 
867
                                "RadioButtonMenuItem.background",
 
868
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
869
                                                false),
 
870
 
 
871
                                "RadioButtonMenuItem.borderPainted",
 
872
                                Boolean.FALSE,
 
873
 
 
874
                                "RadioButtonMenuItem.checkIcon",
 
875
                                new RadioButtonMenuItemIcon(null,
 
876
                                                SubstanceSizeUtils
 
877
                                                                .getMenuCheckMarkSize(SubstanceSizeUtils
 
878
                                                                                .getControlFontSize())),
 
879
 
 
880
                                "RadioButtonMenuItem.disabledForeground",
 
881
                                disabledForegroundColor,
 
882
 
 
883
                                "RadioButtonMenuItem.foreground",
 
884
                                foregroundColor,
 
885
 
 
886
                                "RadioButtonMenuItem.margin",
 
887
                                menuItemInsets,
 
888
 
 
889
                                "RadioButtonMenuItem.selectionForeground",
 
890
                                selectionCellForegroundColor,
 
891
 
 
892
                                "RootPane.background",
 
893
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
894
                                                false),
 
895
 
 
896
                                "RootPane.border",
 
897
                                new SubstancePaneBorder(),
 
898
 
 
899
                                "ScrollBar.background",
 
900
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
901
                                                false),
 
902
 
 
903
                                "ScrollBar.width",
 
904
                SubstanceSizeUtils.getScrollBarWidth(SubstanceSizeUtils
 
905
                        .getControlFontSize()),
 
906
 
 
907
                                "ScrollBar.minimumThumbSize",
 
908
                                new DimensionUIResource(
 
909
                                                SubstanceSizeUtils.getScrollBarWidth(SubstanceSizeUtils
 
910
                                                                .getControlFontSize()) - 2,
 
911
                                                SubstanceSizeUtils.getScrollBarWidth(SubstanceSizeUtils
 
912
                                                                .getControlFontSize()) - 2),
 
913
 
 
914
                                "ScrollPane.background",
 
915
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
916
                                                false),
 
917
 
 
918
                                "ScrollPane.foreground",
 
919
                                foregroundColor,
 
920
 
 
921
                                "ScrollPane.border",
 
922
                                new SubstanceScrollPaneBorder(),
 
923
 
 
924
                                "Separator.background",
 
925
                                backgroundDefaultColor,
 
926
 
 
927
                                "Separator.foreground",
 
928
                                lineBwColor,
 
929
 
 
930
                                "Slider.altTrackColor",
 
931
                                lineColor,
 
932
 
 
933
                                "Slider.background",
 
934
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
935
                                                false),
 
936
 
 
937
                                "Slider.darkShadow",
 
938
                                lineColor,
 
939
 
 
940
                                "Slider.focus",
 
941
                                lineColor,
 
942
 
 
943
                                "Slider.focusInsets",
 
944
                                new InsetsUIResource(2, 2, 0, 2),
 
945
 
 
946
                                "Slider.foreground",
 
947
                                lineColor,
 
948
 
 
949
                                "Slider.highlight",
 
950
                                textBackgroundColor,
 
951
 
 
952
                                "Slider.shadow",
 
953
                                lineColor,
 
954
 
 
955
                                "Slider.tickColor",
 
956
                                foregroundColor,
 
957
 
 
958
                                "Spinner.arrowButtonInsets",
 
959
                                SubstanceSizeUtils
 
960
                                                .getSpinnerArrowButtonInsets(SubstanceSizeUtils
 
961
                                                                .getControlFontSize()),
 
962
 
 
963
                                "Spinner.background",
 
964
                                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
965
                                                false),
 
966
 
 
967
                                "Spinner.border",
 
968
                                spinnerBorder,
 
969
 
 
970
                                "Spinner.disableOnBoundaryValues",
 
971
                                Boolean.TRUE,
 
972
 
 
973
                                "Spinner.foreground",
 
974
                                foregroundColor,
 
975
 
 
976
                                "Spinner.editorBorderPainted",
 
977
                                Boolean.TRUE,
 
978
 
 
979
                                "SplitPane.background",
 
980
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
981
                                                false),
 
982
 
 
983
                                "SplitPane.foreground",
 
984
                                foregroundColor,
 
985
 
 
986
                                "SplitPane.dividerFocusColor",
 
987
                                backgroundDefaultColor,
 
988
 
 
989
                                "SplitPaneDivider.draggingColor",
 
990
                                backgroundActiveColor,
 
991
 
 
992
                                "SplitPane.border",
 
993
                                new BorderUIResource(new EmptyBorder(0, 0, 0, 0)),
 
994
 
 
995
                                "SplitPane.dividerSize",
 
996
                                (int) (SubstanceSizeUtils.getArrowIconWidth(SubstanceSizeUtils
 
997
                                                .getControlFontSize()) + SubstanceSizeUtils
 
998
                                                .getAdjustedSize(
 
999
                                                                SubstanceSizeUtils.getControlFontSize(), -1, 6,
 
1000
                                                                -1, true)),
 
1001
 
 
1002
                                "SplitPaneDivider.border",
 
1003
                                new BorderUIResource(new EmptyBorder(1, 1, 1, 1)),
 
1004
 
 
1005
                                "TabbedPane.tabAreaBackground",
 
1006
                                backgroundDefaultColor,
 
1007
 
 
1008
                                "TabbedPane.unselectedBackground",
 
1009
                                backgroundDefaultColor,
 
1010
 
 
1011
                                "TabbedPane.background",
 
1012
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
1013
                                                false),
 
1014
 
 
1015
                                "TabbedPane.borderHightlightColor",
 
1016
                                new ColorUIResource(mainActiveScheme.getMidColor()),
 
1017
 
 
1018
                                "TabbedPane.contentAreaColor",
 
1019
                                null,
 
1020
 
 
1021
                                "TabbedPane.contentBorderInsets",
 
1022
                                new InsetsUIResource(4, 4, 4, 4),
 
1023
 
 
1024
                                "TabbedPane.contentOpaque",
 
1025
                                Boolean.FALSE,
 
1026
 
 
1027
                                "TabbedPane.darkShadow",
 
1028
                                new ColorUIResource(skin.getColorScheme((Component) null,
 
1029
                                                ColorSchemeAssociationKind.BORDER,
 
1030
                                                ComponentState.SELECTED).getLineColor()),
 
1031
 
 
1032
                                "TabbedPane.focus",
 
1033
                                foregroundColor,
 
1034
 
 
1035
                                "TabbedPane.foreground",
 
1036
                                foregroundColor,
 
1037
 
 
1038
                                "TabbedPane.highlight",
 
1039
                                new ColorUIResource(mainActiveScheme.getLightColor()),
 
1040
 
 
1041
                                "TabbedPane.light",
 
1042
                                mainEnabledScheme.isDark() ? new ColorUIResource(
 
1043
                                                SubstanceColorUtilities.getAlphaColor(
 
1044
                                                                mainEnabledScheme.getUltraDarkColor(), 100))
 
1045
                                                : new ColorUIResource(mainEnabledScheme.getLightColor()),
 
1046
 
 
1047
                                "TabbedPane.selected",
 
1048
                                new ColorUIResource(mainActiveScheme.getExtraLightColor()),
 
1049
 
 
1050
                                "TabbedPane.selectedForeground",
 
1051
                                foregroundColor,
 
1052
 
 
1053
                                "TabbedPane.selectHighlight",
 
1054
                                new ColorUIResource(mainActiveScheme.getMidColor()),
 
1055
 
 
1056
                                "TabbedPane.shadow",
 
1057
                                new ColorUIResource(
 
1058
                                                SubstanceColorUtilities.getInterpolatedColor(
 
1059
                                                                mainEnabledScheme.getExtraLightColor(),
 
1060
                                                                mainEnabledScheme.getLightColor(), 0.5)),
 
1061
 
 
1062
                                "TabbedPane.tabRunOverlay",
 
1063
                0,
 
1064
 
 
1065
                                "Table.background",
 
1066
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
1067
                                                false),
 
1068
 
 
1069
                                "Table.cellNoFocusBorder",
 
1070
                                new BorderUIResource.EmptyBorderUIResource(
 
1071
                                                SubstanceSizeUtils
 
1072
                                                                .getDefaultBorderInsets(SubstanceSizeUtils
 
1073
                                                                                .getComponentFontSize(null))),
 
1074
 
 
1075
                                "Table.focusCellBackground",
 
1076
                                backgroundActiveColor,
 
1077
 
 
1078
                                "Table.focusCellForeground",
 
1079
                                foregroundColor,
 
1080
 
 
1081
                                "Table.focusCellHighlightBorder",
 
1082
                                new SubstanceBorder(),
 
1083
 
 
1084
                                "Table.foreground",
 
1085
                                foregroundColor,
 
1086
 
 
1087
                                "Table.gridColor",
 
1088
                                lineColorDefault,
 
1089
 
 
1090
                                "Table.scrollPaneBorder",
 
1091
                                new SubstanceScrollPaneBorder(),
 
1092
 
 
1093
                                "Table.selectionBackground",
 
1094
                                selectionCellBackgroundColor,
 
1095
 
 
1096
                                "Table.selectionForeground",
 
1097
                                selectionCellForegroundColor,
 
1098
 
 
1099
                                "TableHeader.cellBorder",
 
1100
                                null,
 
1101
 
 
1102
                                "TableHeader.foreground",
 
1103
                                foregroundColor,
 
1104
 
 
1105
                                "TableHeader.background",
 
1106
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
1107
                                                false),
 
1108
 
 
1109
                                "TextArea.background",
 
1110
                                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
1111
                                                false),
 
1112
 
 
1113
                                "TextArea.border",
 
1114
                                textMarginBorder,
 
1115
 
 
1116
                                "TextArea.caretForeground",
 
1117
                                foregroundColor,
 
1118
 
 
1119
                                "TextArea.disabledBackground",
 
1120
                                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
1121
                                                true),
 
1122
 
 
1123
                                "TextArea.foreground",
 
1124
                                foregroundColor,
 
1125
 
 
1126
                                "TextArea.inactiveBackground",
 
1127
                                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
1128
                                                true),
 
1129
 
 
1130
                                "TextArea.inactiveForeground",
 
1131
                                disabledTextComponentForegroundColor,
 
1132
 
 
1133
                                "TextArea.selectionBackground",
 
1134
                                selectionTextBackgroundColor,
 
1135
 
 
1136
                                "TextArea.selectionForeground",
 
1137
                                selectionTextForegroundColor,
 
1138
 
 
1139
                                "TextField.background",
 
1140
                                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
1141
                                                false),
 
1142
 
 
1143
                                "TextField.border",
 
1144
                                textBorder,
 
1145
 
 
1146
                                "TextField.caretForeground",
 
1147
                                foregroundColor,
 
1148
 
 
1149
                                "TextField.disabledBackground",
 
1150
                                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
1151
                                                true),
 
1152
 
 
1153
                                "TextField.foreground",
 
1154
                                foregroundColor,
 
1155
 
 
1156
                                "TextField.inactiveBackground",
 
1157
                                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
1158
                                                true),
 
1159
 
 
1160
                                "TextField.inactiveForeground",
 
1161
                                disabledTextComponentForegroundColor,
 
1162
 
 
1163
                                "TextField.selectionBackground",
 
1164
                                selectionTextBackgroundColor,
 
1165
 
 
1166
                                "TextField.selectionForeground",
 
1167
                                selectionTextForegroundColor,
 
1168
 
 
1169
                                "TextPane.background",
 
1170
                                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
1171
                                                false),
 
1172
 
 
1173
                                "TextPane.border",
 
1174
                                textMarginBorder,
 
1175
 
 
1176
                                "TextPane.disabledBackground",
 
1177
                                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
1178
                                                true),
 
1179
 
 
1180
                                "TextPane.foreground",
 
1181
                                foregroundColor,
 
1182
 
 
1183
                                "TextPane.caretForeground",
 
1184
                                foregroundColor,
 
1185
 
 
1186
                                "TextPane.inactiveBackground",
 
1187
                                SubstanceColorUtilities.getDefaultBackgroundColor(true, skin,
 
1188
                                                true),
 
1189
 
 
1190
                                "TextPane.inactiveForeground",
 
1191
                                disabledTextComponentForegroundColor,
 
1192
 
 
1193
                                "TextPane.selectionBackground",
 
1194
                                selectionTextBackgroundColor,
 
1195
 
 
1196
                                "TextPane.selectionForeground",
 
1197
                                selectionTextForegroundColor,
 
1198
 
 
1199
                                "TitledBorder.titleColor",
 
1200
                                foregroundColor,
 
1201
 
 
1202
                                "TitledBorder.border",
 
1203
                                new SubstanceEtchedBorder(),
 
1204
 
 
1205
                                "ToggleButton.foreground",
 
1206
                                foregroundColor,
 
1207
 
 
1208
                                "ToggleButton.disabledText",
 
1209
                                disabledForegroundColor,
 
1210
 
 
1211
                                "ToggleButton.margin",
 
1212
                                new InsetsUIResource(0, 0, 0, 0),
 
1213
 
 
1214
                                "ToolBar.background",
 
1215
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
1216
                                                false),
 
1217
 
 
1218
                                "ToolBar.border",
 
1219
                                new BorderUIResource(new SubstanceToolBarBorder()),
 
1220
 
 
1221
                                "ToolBar.isRollover",
 
1222
                                Boolean.TRUE,
 
1223
 
 
1224
                                "ToolBar.foreground",
 
1225
                                foregroundColor,
 
1226
 
 
1227
                                "ToolBarSeparator.background",
 
1228
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
1229
                                                false),
 
1230
 
 
1231
                                "ToolBarSeparator.foreground",
 
1232
                                lineBwColor,
 
1233
 
 
1234
                                "ToolBar.separatorSize",
 
1235
                                null,
 
1236
 
 
1237
                                "ToolTip.border",
 
1238
                                tooltipBorder,
 
1239
 
 
1240
                                "ToolTip.borderInactive",
 
1241
                                tooltipBorder,
 
1242
 
 
1243
                                "ToolTip.background",
 
1244
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
1245
                                                false),
 
1246
 
 
1247
                                "ToolTip.backgroundInactive",
 
1248
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
1249
                                                true),
 
1250
 
 
1251
                                "ToolTip.foreground",
 
1252
                                foregroundColor,
 
1253
 
 
1254
                                "ToolTip.foregroundInactive",
 
1255
                                disabledForegroundColor,
 
1256
 
 
1257
                                "Tree.closedIcon",
 
1258
                                emptyIcon,
 
1259
 
 
1260
                                "Tree.collapsedIcon",
 
1261
                                new UIDefaults.LazyValue() {
 
1262
                                        @Override
 
1263
                    public Object createValue(UIDefaults table) {
 
1264
                                                return new IconUIResource(
 
1265
                                                                SubstanceIconFactory.getTreeIcon(null, true));
 
1266
                                        }
 
1267
                                },
 
1268
 
 
1269
                                "Tree.expandedIcon",
 
1270
                                new UIDefaults.LazyValue() {
 
1271
                                        @Override
 
1272
                    public Object createValue(UIDefaults table) {
 
1273
                                                return new IconUIResource(
 
1274
                                                                SubstanceIconFactory.getTreeIcon(null, false));
 
1275
                                        }
 
1276
                                },
 
1277
 
 
1278
                                "Tree.leafIcon",
 
1279
                                emptyIcon,
 
1280
 
 
1281
                                "Tree.openIcon",
 
1282
                                emptyIcon,
 
1283
 
 
1284
                                "Tree.background",
 
1285
                                SubstanceColorUtilities.getDefaultBackgroundColor(false, skin,
 
1286
                                                false),
 
1287
 
 
1288
                                "Tree.selectionBackground", selectionCellBackgroundColor,
 
1289
 
 
1290
                                "Tree.foreground", foregroundColor,
 
1291
 
 
1292
                                "Tree.hash", lineColorDefault,
 
1293
 
 
1294
                                "Tree.rowHeight", 0,
 
1295
 
 
1296
                                "Tree.selectionBorderColor", lineColor,
 
1297
 
 
1298
                                "Tree.selectionForeground", selectionCellForegroundColor,
 
1299
 
 
1300
                                "Tree.textBackground", backgroundDefaultColor,
 
1301
 
 
1302
                                "Tree.textForeground", foregroundColor,
 
1303
 
 
1304
                                "Viewport.background", backgroundDefaultColor,
 
1305
 
 
1306
                                "Viewport.foreground", foregroundColor,
 
1307
 
 
1308
                SubstanceLookAndFeel.WINDOW_AUTO_DEACTIVATE,
 
1309
                skin.isRegisteredAsDecorationArea(DecorationAreaType.PRIMARY_TITLE_PANE_INACTIVE),
 
1310
 
 
1311
                };
 
1312
                table.putDefaults(defaults);
 
1313
 
 
1314
                // input maps
 
1315
                InputMapSet inputMapSet = SubstanceInputMapUtilities
 
1316
                                .getSystemInputMapSet();
 
1317
                if (inputMapSet == null) {
 
1318
                        throw new IllegalStateException("Input map set is null!");
 
1319
                }
 
1320
 
 
1321
                table.put("Button.focusInputMap", inputMapSet.getButtonFocusInputMap()
 
1322
                                .getUiMap());
 
1323
                table.put("CheckBox.focusInputMap", inputMapSet
 
1324
                                .getCheckBoxFocusInputMap().getUiMap());
 
1325
                table.put("ComboBox.ancestorInputMap", inputMapSet
 
1326
                                .getComboBoxAncestorInputMap().getUiMap());
 
1327
                table.put("Desktop.ancestorInputMap", inputMapSet
 
1328
                                .getDesktopAncestorInputMap().getUiMap());
 
1329
                table.put("EditorPane.focusInputMap", inputMapSet
 
1330
                                .getEditorPaneFocusInputMap().getUiMap());
 
1331
                table.put("FileChooser.ancestorInputMap", inputMapSet
 
1332
                                .getFileChooserAncestorInputMap().getUiMap());
 
1333
                table.put("FormattedTextField.focusInputMap", inputMapSet
 
1334
                                .getFormattedTextFieldFocusInputMap().getUiMap());
 
1335
                table.put("List.focusInputMap", inputMapSet.getListFocusInputMap()
 
1336
                                .getUiMap());
 
1337
                table.put("PasswordField.focusInputMap", inputMapSet
 
1338
                                .getPasswordFieldFocusInputMap().getUiMap());
 
1339
                table.put("RadioButton.focusInputMap", inputMapSet
 
1340
                                .getRadioButtonFocusInputMap().getUiMap());
 
1341
                table.put("RootPane.ancestorInputMap", inputMapSet
 
1342
                                .getRootPaneAncestorInputMap().getUiMap());
 
1343
                table.put("ScrollBar.ancestorInputMap", inputMapSet
 
1344
                                .getScrollBarAncestorInputMap().getUiMap());
 
1345
                table.put("ScrollPane.ancestorInputMap", inputMapSet
 
1346
                                .getScrollPaneAncestorInputMap().getUiMap());
 
1347
                table.put("Slider.focusInputMap", inputMapSet.getSliderFocusInputMap()
 
1348
                                .getUiMap());
 
1349
                table.put("Spinner.ancestorInputMap", inputMapSet
 
1350
                                .getSpinnerAncestorInputMap().getUiMap());
 
1351
                table.put("SplitPane.ancestorInputMap", inputMapSet
 
1352
                                .getSplitPaneAncestorInputMap().getUiMap());
 
1353
                table.put("TabbedPane.ancestorInputMap", inputMapSet
 
1354
                                .getTabbedPaneAncestorInputMap().getUiMap());
 
1355
                table.put("TabbedPane.focusInputMap", inputMapSet
 
1356
                                .getTabbedPaneFocusInputMap().getUiMap());
 
1357
                table.put("Table.ancestorInputMap", inputMapSet
 
1358
                                .getTableAncestorInputMap().getUiMap());
 
1359
                table.put("TableHeader.ancestorInputMap", inputMapSet
 
1360
                                .getTableHeaderAncestorInputMap().getUiMap());
 
1361
                table.put("TextArea.focusInputMap", inputMapSet
 
1362
                                .getTextAreaFocusInputMap().getUiMap());
 
1363
                table.put("TextField.focusInputMap", inputMapSet
 
1364
                                .getTextFieldFocusInputMap().getUiMap());
 
1365
                table.put("TextPane.focusInputMap", inputMapSet
 
1366
                                .getTextPaneFocusInputMap().getUiMap());
 
1367
                table.put("ToggleButton.focusInputMap", inputMapSet
 
1368
                                .getToggleButtonFocusInputMap().getUiMap());
 
1369
                table.put("ToolBar.ancestorInputMap", inputMapSet
 
1370
                                .getToolBarAncestorInputMap().getUiMap());
 
1371
                table.put("Tree.ancestorInputMap", inputMapSet
 
1372
                                .getTreeAncestorInputMap().getUiMap());
 
1373
                table.put("Tree.focusInputMap", inputMapSet.getTreeFocusInputMap()
 
1374
                                .getUiMap());
 
1375
        }
 
1376
}