Debian Codegraph @

src/com/jidesoft/plaf/vsnet/VsnetMetalUtils.java

raw
1 /*
2 * @(#)VsnetMetalUtils.java
3 *
4 * Copyright 2002 JIDE Software Inc. All rights reserved.
5 */
6 package com.jidesoft.plaf.vsnet;
7
8 import com.jidesoft.icons.IconsFactory;
9 import com.jidesoft.icons.JideIconsFactory;
10 import com.jidesoft.plaf.LookAndFeelFactory;
11 import com.jidesoft.plaf.UIDefaultsLookup;
12 import com.jidesoft.plaf.basic.Painter;
13 import com.jidesoft.plaf.basic.ThemePainter;
14 import com.jidesoft.plaf.metal.MetalIconFactory;
15 import com.jidesoft.plaf.metal.MetalPainter;
16 import com.jidesoft.swing.JideButton;
17 import com.jidesoft.swing.JideSwingUtilities;
18 import com.jidesoft.swing.JideTabbedPane;
19 import com.jidesoft.utils.ColorUtils;
20
21 import javax.swing.*;
22 import javax.swing.plaf.BorderUIResource;
23 import javax.swing.plaf.ColorUIResource;
24 import javax.swing.plaf.DimensionUIResource;
25 import javax.swing.plaf.InsetsUIResource;
26 import javax.swing.plaf.basic.BasicBorders;
27 import java.awt.*;
28 import java.beans.Beans;
29
30 /**
31 * Initialize the uiClassID to BasicComponentUI mapping for JIDE components using Vsnet style for MetalLookAndFeel.
32 */
33 public class VsnetMetalUtils extends VsnetLookAndFeelExtension {
34
35 /**
36 * Initializes class defaults.
37 *
38 * @param table the UI defaults
39 */
40 public static void initClassDefaultsWithMenu(UIDefaults table) {
41 if (!Beans.isDesignTime()) {
42 table.put("MenuUI", "com.jidesoft.plaf.metal.MetalMenuUI");
43 }
44 initClassDefaults(table);
45 }
46
47 public static void initClassDefaults(UIDefaults table) {
48 VsnetLookAndFeelExtension.initClassDefaults(table);
49
50 final String metalPackageName = "com.jidesoft.plaf.metal.";
51
52 int products = LookAndFeelFactory.getProductsUsed();
53
54 // common
55 table.put("JideSplitButtonUI", metalPackageName + "MetalJideSplitButtonUI");
56 table.put("RangeSliderUI", metalPackageName + "MetalRangeSliderUI");
57
58 if ((products & PRODUCT_GRIDS) != 0) {
59 table.put("ExComboBoxUI", metalPackageName + "MetalExComboBoxUI");
60 }
61 }
62
63 /**
64 * Initializes components defaults.
65 *
66 * @param table the UI defaults
67 */
68 public static void initComponentDefaults(UIDefaults table) {
69 Toolkit toolkit = Toolkit.getDefaultToolkit();
70
71 Object defaultTextColor = UIDefaultsLookup.get("controlText");
72 Object defaultBackgroundColor = UIDefaultsLookup.get("control");
73 Object defaultHighlightColor = UIDefaultsLookup.get("controlHighlight");
74 Object defaultLtHighlightColor = UIDefaultsLookup.get("controlLtHighlight");
75 Object defaultShadowColor = UIDefaultsLookup.get("controlShadow");
76 Object defaultDarkShadowColor = UIDefaultsLookup.get("controlDkShadow");
77 Object activeTitleTextColor = UIDefaultsLookup.get("activeCaptionText");
78 Object activeTitleBackgroundColor = UIDefaultsLookup.get("activeCaption");
79 Object activeTitleBorderColor = UIDefaultsLookup.get("controlDkShadow");
80 Object inactiveTitleTextColor = UIDefaultsLookup.get("controlText");
81 Object inactiveTitleBackgroundColor = UIDefaultsLookup.get("control");
82 Object mdiBackgroundColor = UIDefaultsLookup.get("controlShadow");
83
84 Object controlFont = JideSwingUtilities.getControlFont(toolkit, table);
85 Object toolbarFont = JideSwingUtilities.getMenuFont(toolkit, table);
86
87 Object singleLineBorder = new BorderUIResource(BorderFactory.createLineBorder(UIDefaultsLookup.getColor("controlShadow")));
88
89 Object slidingEastFrameBorder = new ResizeFrameBorder(UIDefaultsLookup.getColor("control"), UIDefaultsLookup.getColor("controlLtHighlight"), UIDefaultsLookup.getColor("controlShadow"), UIDefaultsLookup.getColor("controlDkShadow"),
90 new Insets(0, 4, 0, 0));
91
92 Object slidingWestFrameBorder = new ResizeFrameBorder(UIDefaultsLookup.getColor("control"), UIDefaultsLookup.getColor("controlLtHighlight"), UIDefaultsLookup.getColor("controlShadow"), UIDefaultsLookup.getColor("controlDkShadow"),
93 new Insets(0, 0, 0, 4));
94
95 Object slidingNorthFrameBorder = new ResizeFrameBorder(UIDefaultsLookup.getColor("control"), UIDefaultsLookup.getColor("controlLtHighlight"), UIDefaultsLookup.getColor("controlShadow"), UIDefaultsLookup.getColor("controlDkShadow"),
96 new Insets(0, 0, 4, 0));
97
98 Object slidingSouthFrameBorder = new ResizeFrameBorder(UIDefaultsLookup.getColor("control"), UIDefaultsLookup.getColor("controlLtHighlight"), UIDefaultsLookup.getColor("controlShadow"), UIDefaultsLookup.getColor("controlDkShadow"),
99 new Insets(4, 0, 0, 0));
100
101 Object resizeBorder = new ResizeFrameBorder(UIDefaultsLookup.getColor("control"), UIDefaultsLookup.getColor("controlLtHighlight"), UIDefaultsLookup.getColor("controlShadow"), UIDefaultsLookup.getColor("controlDkShadow"),
102 new Insets(4, 4, 4, 4));
103
104 Object defaultFormBackgroundColor = VsnetUtils.getLighterColor((Color) activeTitleBackgroundColor);
105
106 Color highlightColor = UIDefaultsLookup.getColor("textHighlight");
107
108 Object focusedButtonColor =
109 new ColorUIResource(VsnetUtils.getRolloverButtonColor(highlightColor));
110
111 Object selectedAndFocusedButtonColor =
112 new ColorUIResource(VsnetUtils.getSelectedAndRolloverButtonColor(highlightColor));
113
114 Object selectedButtonColor =
115 new ColorUIResource(VsnetUtils.getSelectedButtonColor(highlightColor));
116
117 Painter gripperPainter = new Painter() {
118 public void paint(JComponent c, Graphics g, Rectangle rect, int orientation, int state) {
119 Object p = UIDefaultsLookup.get("Theme.painter");
120 if (p instanceof ThemePainter) {
121 ((ThemePainter) p).paintGripper(c, g, rect, orientation, state);
122 }
123 else {
124 MetalPainter.getInstance().paintGripper(c, g, rect, orientation, state);
125 }
126 }
127 };
128
129 Object buttonBorder = new BasicBorders.MarginBorder();
130
131 Object uiDefaults[] = {
132 // common
133 "JideLabel.font", controlFont,
134 "JideLabel.background", defaultBackgroundColor,
135 "JideLabel.foreground", defaultTextColor,
136
137 "JideButton.selectedAndFocusedBackground", selectedAndFocusedButtonColor,
138 "JideButton.focusedBackground", focusedButtonColor,
139 "JideButton.selectedBackground", selectedButtonColor,
140 "JideButton.borderColor", Color.black,
141
142 "JideButton.font", controlFont,
143 "JideButton.background", defaultBackgroundColor,
144 "JideButton.foreground", defaultTextColor,
145 "JideButton.shadow", defaultShadowColor,
146 "JideButton.darkShadow", defaultDarkShadowColor,
147 "JideButton.light", defaultHighlightColor,
148 "JideButton.highlight", defaultLtHighlightColor,
149 "JideButton.border", buttonBorder,
150 "JideButton.margin", new InsetsUIResource(3, 3, 3, 3),
151 "JideButton.textIconGap", 4,
152 "JideButton.textShiftOffset", 0,
153 "JideButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[]{
154 "SPACE", "pressed",
155 "released SPACE", "released"
156 }),
157
158 "TristateCheckBox.icon", MetalIconFactory.getCheckBoxIcon(),
159
160 "JideScrollPane.border", singleLineBorder,
161
162 "JideSplitPane.dividerSize", 3,
163 "JideSplitPaneDivider.border", new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0)),
164 "JideSplitPaneDivider.background", defaultBackgroundColor,
165 "JideSplitPaneDivider.gripperPainter", gripperPainter,
166
167 "JideTabbedPane.defaultTabShape", JideTabbedPane.SHAPE_VSNET,
168 "JideTabbedPane.defaultResizeMode", JideTabbedPane.RESIZE_MODE_NONE,
169 "JideTabbedPane.defaultTabColorTheme", JideTabbedPane.COLOR_THEME_VSNET,
170
171 "JideTabbedPane.tabRectPadding", 2,
172 "JideTabbedPane.closeButtonMarginHorizonal", 3,
173 "JideTabbedPane.closeButtonMarginVertical", 3,
174 "JideTabbedPane.textMarginVertical", 4,
175 "JideTabbedPane.noIconMargin", 2,
176 "JideTabbedPane.iconMargin", 5,
177 "JideTabbedPane.textPadding", 6,
178 "JideTabbedPane.buttonSize", 18,
179 "JideTabbedPane.buttonMargin", 5,
180 "JideTabbedPane.fitStyleBoundSize", 8,
181 "JideTabbedPane.fitStyleFirstTabMargin", 4,
182 "JideTabbedPane.fitStyleIconMinWidth", 24,
183 "JideTabbedPane.fitStyleTextMinWidth", 16,
184 "JideTabbedPane.compressedStyleNoIconRectSize", 24,
185 "JideTabbedPane.compressedStyleIconMargin", 12,
186 "JideTabbedPane.compressedStyleCloseButtonMarginHorizontal", 0,
187 "JideTabbedPane.compressedStyleCloseButtonMarginVertical", 0,
188 "JideTabbedPane.fixedStyleRectSize", 60,
189 "JideTabbedPane.closeButtonMargin", 2,
190 "JideTabbedPane.gripLeftMargin", 4,
191 "JideTabbedPane.closeButtonMarginSize", 6,
192 "JideTabbedPane.closeButtonLeftMargin", 2,
193 "JideTabbedPane.closeButtonRightMargin", 2,
194
195 "JideTabbedPane.defaultTabBorderShadowColor", new ColorUIResource(115, 109, 99),
196
197 "JideTabbedPane.gripperPainter", gripperPainter,
198 "JideTabbedPane.border", new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0)),
199 "JideTabbedPane.background", defaultFormBackgroundColor,
200 "JideTabbedPane.foreground", defaultTextColor,
201 "JideTabbedPane.light", defaultHighlightColor,
202 "JideTabbedPane.highlight", defaultLtHighlightColor,
203 "JideTabbedPane.shadow", defaultShadowColor,
204 "JideTabbedPane.darkShadow", defaultTextColor,
205 "JideTabbedPane.tabInsets", new InsetsUIResource(1, 4, 1, 4),
206 "JideTabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 2, 2),
207 "JideTabbedPane.ignoreContentBorderInsetsIfNoTabs", Boolean.FALSE,
208 "JideTabbedPane.tabAreaInsets", new InsetsUIResource(2, 4, 0, 4),
209 "JideTabbedPane.tabAreaBackground", defaultFormBackgroundColor,
210 "JideTabbedPane.tabAreaBackgroundLt", defaultLtHighlightColor,
211 "JideTabbedPane.tabAreaBackgroundDk", defaultBackgroundColor,
212 "JideTabbedPane.tabRunOverlay", 2,
213 "JideTabbedPane.font", controlFont,
214 "JideTabbedPane.selectedTabFont", controlFont,
215 "JideTabbedPane.selectedTabTextForeground", defaultDarkShadowColor,
216 "JideTabbedPane.unselectedTabTextForeground", defaultDarkShadowColor,
217 "JideTabbedPane.selectedTabBackground", defaultBackgroundColor,
218 "JideTabbedPane.selectedTabBackgroundLt", new ColorUIResource(230, 139, 44),
219 "JideTabbedPane.selectedTabBackgroundDk", new ColorUIResource(255, 199, 60),
220 "JideTabbedPane.tabListBackground", UIDefaultsLookup.getColor("List.background"),
221 "JideTabbedPane.textIconGap", 4,
222 "JideTabbedPane.showIconOnTab", Boolean.TRUE,
223 "JideTabbedPane.showCloseButtonOnTab", Boolean.FALSE,
224 "JideTabbedPane.closeButtonAlignment", SwingConstants.TRAILING,
225 "JideTabbedPane.focusInputMap",
226 new UIDefaults.LazyInputMap(new Object[]{
227 "RIGHT", "navigateRight",
228 "KP_RIGHT", "navigateRight",
229 "LEFT", "navigateLeft",
230 "KP_LEFT", "navigateLeft",
231 "UP", "navigateUp",
232 "KP_UP", "navigateUp",
233 "DOWN", "navigateDown",
234 "KP_DOWN", "navigateDown",
235 "ctrl DOWN", "requestFocusForVisibleComponent",
236 "ctrl KP_DOWN", "requestFocusForVisibleComponent",
237 }),
238 "JideTabbedPane.ancestorInputMap",
239 new UIDefaults.LazyInputMap(new Object[]{
240 "ctrl PAGE_DOWN", "navigatePageDown",
241 "ctrl PAGE_UP", "navigatePageUp",
242 "ctrl UP", "requestFocus",
243 "ctrl KP_UP", "requestFocus",
244 }),
245
246 "Resizable.resizeBorder", resizeBorder,
247
248 "Gripper.size", 8,
249 "Gripper.foreground", defaultBackgroundColor,
250 "Gripper.painter", gripperPainter,
251
252 "MenuBar.border", new BorderUIResource(BorderFactory.createEmptyBorder(1, 0, 1, 0)),
253 "Icon.floating", Boolean.FALSE,
254
255 "JideSplitButton.font", controlFont,
256 "JideSplitButton.margin", new InsetsUIResource(3, 3, 3, 7),
257 "JideSplitButton.border", buttonBorder,
258 "JideSplitButton.borderPainted", Boolean.FALSE,
259 "JideSplitButton.textIconGap", 4,
260 "JideSplitButton.selectionBackground", UIDefaultsLookup.getColor("MenuItem.selectionBackground"),
261 "JideSplitButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[]{
262 "SPACE", "pressed",
263 "released SPACE", "released",
264 "DOWN", "downPressed",
265 "released DOWN", "downReleased"
266 }),
267
268 "ButtonPanel.order", "ACO",
269 "ButtonPanel.oppositeOrder", "H",
270 "ButtonPanel.buttonGap", 5,
271 "ButtonPanel.groupGap", 5,
272 "ButtonPanel.minButtonWidth", 57,
273
274 "MeterProgressBar.border", new BorderUIResource(BorderFactory.createLineBorder(Color.BLACK)),
275 "MeterProgressBar.background", new ColorUIResource(Color.BLACK),
276 "MeterProgressBar.foreground", new ColorUIResource(Color.GREEN),
277 "MeterProgressBar.cellForeground", new ColorUIResource(Color.GREEN),
278 "MeterProgressBar.cellBackground", new ColorUIResource(0x008000),
279 "MeterProgressBar.cellLength", 2,
280 "MeterProgressBar.cellSpacing", 2,
281
282 "HeaderBox.background", defaultBackgroundColor,
283
284 "Cursor.hsplit", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.HSPLIT),
285 "Cursor.vsplit", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.VSPLIT),
286
287 "Cursor.north", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.NORTH),
288 "Cursor.south", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.SOUTH),
289 "Cursor.east", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.EAST),
290 "Cursor.west", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.WEST),
291 "Cursor.tab", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.TAB),
292 "Cursor.float", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.FLOAT),
293 "Cursor.vertical", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.VERTICAL),
294 "Cursor.horizontal", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.HORIZONTAL),
295 "Cursor.delete", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.DELETE),
296 "Cursor.drag", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.DROP),
297 "Cursor.dragStop", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.NODROP),
298 "Cursor.dragText", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.DROP_TEXT),
299 "Cursor.dragTextStop", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.NODROP_TEXT),
300 "Cursor.percentage", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.PERCENTAGE),
301 "Cursor.moveEast", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.MOVE_EAST),
302 "Cursor.moveWest", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.MOVE_WEST),
303 };
304 table.putDefaults(uiDefaults);
305
306 int products = LookAndFeelFactory.getProductsUsed();
307
308 if ((products & PRODUCT_DOCK) != 0) {
309
310 ImageIcon titleButtonImage = IconsFactory.getImageIcon(VsnetMetalUtils.class, "icons/title_buttons_metal.gif"); // 16 x 16
311 final int titleButtonSize = 16;
312
313 uiDefaults = new Object[]{
314 // dock
315 "Workspace.background", mdiBackgroundColor,
316
317 "SidePane.margin", new InsetsUIResource(1, 1, 1, 1),
318 "SidePane.iconTextGap", 2,
319 "SidePane.textBorderGap", 13,
320 "SidePane.itemGap", 5,
321 "SidePane.groupGap", 13,
322 "SidePane.foreground", defaultTextColor,
323 "SidePane.background", defaultFormBackgroundColor,
324 "SidePane.lineColor", defaultDarkShadowColor,
325 "SidePane.buttonBackground", defaultBackgroundColor,
326 "SidePane.font", controlFont,
327 "SidePane.orientation", 1,
328 "SidePane.showSelectedTabText", Boolean.TRUE,
329 "SidePane.alwaysShowTabText", Boolean.FALSE,
330
331 "DockableFrame.defaultIcon", JideIconsFactory.getImageIcon(JideIconsFactory.DockableFrame.BLANK),
332 "DockableFrame.background", defaultBackgroundColor,
333 "DockableFrame.border", new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0)),
334 "DockableFrame.floatingBorder", new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0)),
335 "DockableFrame.slidingEastBorder", slidingEastFrameBorder,
336 "DockableFrame.slidingWestBorder", slidingWestFrameBorder,
337 "DockableFrame.slidingNorthBorder", slidingNorthFrameBorder,
338 "DockableFrame.slidingSouthBorder", slidingSouthFrameBorder,
339
340 "DockableFrame.activeTitleBackground", activeTitleBackgroundColor,
341 "DockableFrame.activeTitleForeground", activeTitleTextColor,
342 "DockableFrame.inactiveTitleBackground", inactiveTitleBackgroundColor,
343 "DockableFrame.inactiveTitleForeground", inactiveTitleTextColor,
344 "DockableFrame.titleBorder", new BorderUIResource(BorderFactory.createEmptyBorder(1, 0, 3, 0)),
345 "DockableFrame.inactiveTitleBorderColor", activeTitleBorderColor,
346 "DockableFrame.activeTitleBorderColor", activeTitleBorderColor,
347 "DockableFrame.font", controlFont,
348
349 "DockableFrameTitlePane.gripperPainter", gripperPainter,
350 "DockableFrameTitlePane.font", controlFont,
351 "DockableFrameTitlePane.hideIcon", IconsFactory.getIcon(null, titleButtonImage, 0, 0, titleButtonSize, titleButtonSize),
352 "DockableFrameTitlePane.unfloatIcon", IconsFactory.getIcon(null, titleButtonImage, 0, titleButtonSize, titleButtonSize, titleButtonSize),
353 "DockableFrameTitlePane.floatIcon", IconsFactory.getIcon(null, titleButtonImage, 0, 2 * titleButtonSize, titleButtonSize, titleButtonSize),
354 "DockableFrameTitlePane.autohideIcon", IconsFactory.getIcon(null, titleButtonImage, 0, 3 * titleButtonSize, titleButtonSize, titleButtonSize),
355 "DockableFrameTitlePane.stopAutohideIcon", IconsFactory.getIcon(null, titleButtonImage, 0, 4 * titleButtonSize, titleButtonSize, titleButtonSize),
356 "DockableFrameTitlePane.hideAutohideIcon", IconsFactory.getIcon(null, titleButtonImage, 0, 5 * titleButtonSize, titleButtonSize, titleButtonSize),
357 "DockableFrameTitlePane.maximizeIcon", IconsFactory.getIcon(null, titleButtonImage, 0, 6 * titleButtonSize, titleButtonSize, titleButtonSize),
358 "DockableFrameTitlePane.restoreIcon", IconsFactory.getIcon(null, titleButtonImage, 0, 7 * titleButtonSize, titleButtonSize, titleButtonSize),
359 "DockableFrameTitlePane.titleBarComponent", Boolean.FALSE,
360
361 "DockableFrameTitlePane.alwaysShowAllButtons", Boolean.FALSE, // true if show all three buttons no matter if the buttons is available. false if only show buttons which is available
362 "DockableFrameTitlePane.buttonsAlignment", SwingConstants.TRAILING, // trailing or leading
363 "DockableFrameTitlePane.titleAlignment", SwingConstants.LEADING, // trailing or leading or center
364 "DockableFrameTitlePane.buttonGap", 2, // gap between buttons
365 "DockableFrameTitlePane.showIcon", Boolean.FALSE, // show icon or not, the alignment is the same as titleAlignment
366 "DockableFrameTitlePane.margin", new InsetsUIResource(0, 6, 0, 6), // gap
367 "DockableFrameTitlePane.use3dButtons", Boolean.TRUE,
368
369 "ContentContainer.background", defaultFormBackgroundColor,
370 "ContentContainer.vgap", 1,
371 "ContentContainer.hgap", 1,
372 "MainContainer.border", new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0)),
373
374 "Contour.color", new ColorUIResource(136, 136, 136),
375 "Contour.thickness", 4,
376
377 "DockingFramework.changeCursor", Boolean.FALSE,
378
379 "FrameContainer.contentBorderInsets", new InsetsUIResource(2, 0, 0, 0),
380
381 };
382 table.putDefaults(uiDefaults);
383 }
384
385 if ((products & PRODUCT_COMPONENTS) != 0) {
386 ImageIcon collapsiblePaneImage = IconsFactory.getImageIcon(VsnetMetalUtils.class, "icons/collapsible_pane_metal.gif"); // 12 x 12 x 2
387 final int collapsiblePaneSize = 12;
388
389 uiDefaults = new Object[]{
390 // components
391 "CollapsiblePanes.border", new BorderUIResource(BorderFactory.createEmptyBorder(12, 12, 12, 12)),
392 "CollapsiblePanes.gap", 15,
393
394 "CollapsiblePane.background", defaultBackgroundColor instanceof Color ? (ColorUtils.getDerivedColor((Color) defaultBackgroundColor, 0.45f)) : defaultBackgroundColor,
395 "CollapsiblePane.contentBackground", defaultHighlightColor,
396 "CollapsiblePane.foreground", defaultTextColor,
397 "CollapsiblePane.emphasizedBackground", activeTitleBackgroundColor,
398 "CollapsiblePane.emphasizedForeground", activeTitleTextColor,
399 "CollapsiblePane.border", new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0)),
400 "CollapsiblePane.font", controlFont,
401
402 "CollapsiblePane.contentBorder", new BorderUIResource(BorderFactory.createEmptyBorder(8, 10, 8, 10)),
403
404 "CollapsiblePane.titleBorder", new BorderUIResource(BorderFactory.createEmptyBorder(3, 3, 3, 3)),
405 "CollapsiblePane.titleFont", controlFont,
406 "CollapsiblePane.downIcon", IconsFactory.getIcon(null, collapsiblePaneImage, 0, 0, collapsiblePaneSize, collapsiblePaneSize),
407 "CollapsiblePane.upIcon", IconsFactory.getIcon(null, collapsiblePaneImage, 0, collapsiblePaneSize, collapsiblePaneSize, collapsiblePaneSize),
408
409 "StatusBarItem.border", BorderFactory.createEtchedBorder(),
410
411 "StatusBar.border", new BorderUIResource(BorderFactory.createEmptyBorder(2, 0, 0, 0)),
412 "StatusBar.gap", 5,
413 "StatusBar.background", defaultBackgroundColor,
414 "StatusBar.font", controlFont,
415 "MemoryStatusBarItem.fillColor", new ColorUIResource(236, 233, 176),
416
417 "DocumentPane.groupBorder", new BorderUIResource(BorderFactory.createLineBorder(Color.gray)),
418 "DocumentPane.newHorizontalGroupIcon", JideIconsFactory.getImageIcon(JideIconsFactory.WindowMenu.NEW_HORIZONTAL_TAB),
419 "DocumentPane.newVerticalGroupIcon", JideIconsFactory.getImageIcon(JideIconsFactory.WindowMenu.NEW_VERTICAL_TAB),
420 "DocumentPane.boldActiveTab", Boolean.TRUE,
421
422 "OutlookTabbedPane.buttonStyle", JideButton.TOOLBOX_STYLE,
423 "FloorTabbedPane.buttonStyle", JideButton.TOOLBOX_STYLE,
424 };
425 table.putDefaults(uiDefaults);
426 }
427
428 if ((products & PRODUCT_ACTION) != 0) {
429 uiDefaults = new Object[]{
430 // action
431 "CommandBar.font", toolbarFont,
432 "CommandBar.background", defaultBackgroundColor,
433 "CommandBar.foreground", defaultTextColor,
434 "CommandBar.shadow", defaultShadowColor,
435 "CommandBar.darkShadow", defaultDarkShadowColor,
436 "CommandBar.light", defaultHighlightColor,
437 "CommandBar.highlight", defaultLtHighlightColor,
438 "CommandBar.border", new BorderUIResource(BorderFactory.createEmptyBorder(1, 1, 1, 1)),
439 "CommandBar.borderVert", new BorderUIResource(BorderFactory.createEmptyBorder(1, 1, 1, 1)),
440 "CommandBar.borderFloating", new BorderUIResource(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder((Color) activeTitleBackgroundColor, 2),
441 BorderFactory.createEmptyBorder(1, 1, 1, 1))),
442 "CommandBar.ancestorInputMap",
443 new UIDefaults.LazyInputMap(new Object[]{
444 "UP", "navigateUp",
445 "KP_UP", "navigateUp",
446 "DOWN", "navigateDown",
447 "KP_DOWN", "navigateDown",
448 "LEFT", "navigateLeft",
449 "KP_LEFT", "navigateLeft",
450 "RIGHT", "navigateRight",
451 "KP_RIGHT", "navigateRight"
452 }),
453 "CommandBar.titleBarSize", 17,
454 "CommandBar.titleBarButtonGap", 1,
455 "CommandBar.titleBarBackground", activeTitleBackgroundColor,
456 "CommandBar.titleBarForeground", activeTitleTextColor,
457 "CommandBar.titleBarFont", controlFont,
458 "CommandBar.minimumSize", new DimensionUIResource(16, 16),
459
460 "CommandBar.separatorSize", 5,
461
462 // *** Separator
463 "CommandBarSeparator.background", new Color(219, 216, 209),
464 "CommandBarSeparator.foreground", new Color(166, 166, 166),
465
466 "Chevron.size", 11,
467 "Chevron.alwaysVisible", Boolean.FALSE,
468
469 };
470 table.putDefaults(uiDefaults);
471 }
472
473 if ((products & PRODUCT_GRIDS) != 0) {
474 uiDefaults = new Object[]{
475 "AbstractComboBox.useJButton", Boolean.TRUE,
476 "NestedTableHeader.cellBorder", UIDefaultsLookup.getBorder("TableHeader.cellBorder"),
477
478 "GroupList.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[]{
479 "TAB", "selectNextGroup",
480 "shift TAB", "selectPreviousGroup",
481 }),
482 };
483 table.putDefaults(uiDefaults);
484 }
485
486 if ((products & PRODUCT_DIFF) != 0) {
487 uiDefaults = new Object[]{
488 "DiffMerge.changed", new ColorUIResource(196, 196, 255),
489 "DiffMerge.deleted", new ColorUIResource(200, 200, 200),
490 "DiffMerge.inserted", new ColorUIResource(196, 255, 196),
491 "DiffMerge.conflicted", new ColorUIResource(255, 153, 153),
492 };
493 table.putDefaults(uiDefaults);
494 }
495
496 // make the spinner has the same font as text field
497 table.put("Spinner.font", UIDefaultsLookup.get("TextField.font"));
498 table.put("FormattedTextField.font", UIDefaultsLookup.get("TextField.font"));
499
500 UIDefaultsLookup.put(table, "Theme.painter", MetalPainter.getInstance());
501 }
502 }