001: /*
002: * @(#)VsnetMetalUtils.java
003: *
004: * Copyright 2002 JIDE Software Inc. All rights reserved.
005: */
006: package com.jidesoft.plaf.vsnet;
007:
008: import com.jidesoft.icons.IconsFactory;
009: import com.jidesoft.icons.JideIconsFactory;
010: import com.jidesoft.plaf.LookAndFeelFactory;
011: import com.jidesoft.plaf.basic.BasicRangeSliderUI;
012: import com.jidesoft.plaf.basic.Painter;
013: import com.jidesoft.plaf.metal.MetalPainter;
014: import com.jidesoft.swing.JideSwingUtilities;
015: import com.jidesoft.swing.JideTabbedPane;
016:
017: import javax.swing.*;
018: import javax.swing.plaf.BorderUIResource;
019: import javax.swing.plaf.ColorUIResource;
020: import javax.swing.plaf.DimensionUIResource;
021: import javax.swing.plaf.InsetsUIResource;
022: import javax.swing.plaf.basic.BasicBorders;
023: import java.awt.*;
024: import java.beans.Beans;
025:
026: /**
027: * Initialize the uiClassID to BasicComponentUI mapping for JIDE components using Vsnet style for MetalLookAndFeel.
028: */
029: public class VsnetMetalUtils extends VsnetLookAndFeelExtension {
030:
031: /**
032: * Initializes class defaults.
033: *
034: * @param table
035: */
036: public static void initClassDefaultsWithMenu(UIDefaults table) {
037: if (!Beans.isDesignTime()) {
038: table.put("MenuUI", "com.jidesoft.plaf.metal.MetalMenuUI");
039: }
040: initClassDefaults(table);
041: }
042:
043: public static void initClassDefaults(UIDefaults table) {
044: VsnetLookAndFeelExtension.initClassDefaults(table);
045:
046: final String metalPackageName = "com.jidesoft.plaf.metal.";
047:
048: // common
049: table.put("JideTabbedPaneUI", metalPackageName
050: + "MetalJideTabbedPaneUI");
051: table.put("JideSplitButtonUI", metalPackageName
052: + "MetalJideSplitButtonUI");
053:
054: int products = LookAndFeelFactory.getProductsUsed();
055:
056: if ((products & PRODUCT_DOCK) != 0) {
057: // dock
058: table.put("DockableFrameUI", metalPackageName
059: + "MetalDockableFrameUI");
060: }
061:
062: if ((products & PRODUCT_ACTION) != 0) {
063: // action
064: table.put("CommandBarTitleBarUI", metalPackageName
065: + "MetalCommandBarTitleBarUI");
066: }
067: }
068:
069: /**
070: * Initializes components defaults.
071: *
072: * @param table
073: */
074: public static void initComponentDefaults(UIDefaults table) {
075: Toolkit toolkit = Toolkit.getDefaultToolkit();
076:
077: Object defaultTextColor = table.get("controlText");
078: Object defaultBackgroundColor = table.get("control");
079: Object defaultHighlightColor = table.get("controlHighlight");
080: Object defaultLtHighlightColor = table
081: .get("controlLtHighlight");
082: Object defaultShadowColor = table.get("controlShadow");
083: Object defaultDarkShadowColor = table.get("controlDkShadow");
084: Object activeTitleTextColor = table.get("activeCaptionText");
085: Object activeTitleBackgroundColor = table.get("activeCaption");
086: Object activeTitleBorderColor = table.get("controlDkShadow");
087: Object inactiveTitleTextColor = table.get("controlText");
088: Object inactiveTitleBackgroundColor = table.get("control");
089: Object mdiBackgroundColor = table.get("controlShadow");
090:
091: Object controlFont = JideSwingUtilities.getControlFont(toolkit,
092: table);
093: Object toolbarFont = JideSwingUtilities.getMenuFont(toolkit,
094: table);
095: Object boldFont = JideSwingUtilities
096: .getBoldFont(toolkit, table);
097:
098: Object singleLineBorder = new BorderUIResource(BorderFactory
099: .createLineBorder(table.getColor("controlShadow")));
100:
101: Object slidingEastFrameBorder = new ResizeFrameBorder(table
102: .getColor("control"), table
103: .getColor("controlLtHighlight"), table
104: .getColor("controlShadow"), table
105: .getColor("controlDkShadow"), new Insets(0, 4, 0, 0));
106:
107: Object slidingWestFrameBorder = new ResizeFrameBorder(table
108: .getColor("control"), table
109: .getColor("controlLtHighlight"), table
110: .getColor("controlShadow"), table
111: .getColor("controlDkShadow"), new Insets(0, 0, 0, 4));
112:
113: Object slidingNorthFrameBorder = new ResizeFrameBorder(table
114: .getColor("control"), table
115: .getColor("controlLtHighlight"), table
116: .getColor("controlShadow"), table
117: .getColor("controlDkShadow"), new Insets(0, 0, 4, 0));
118:
119: Object slidingSouthFrameBorder = new ResizeFrameBorder(table
120: .getColor("control"), table
121: .getColor("controlLtHighlight"), table
122: .getColor("controlShadow"), table
123: .getColor("controlDkShadow"), new Insets(4, 0, 0, 0));
124:
125: Object resizeBorder = new ResizeFrameBorder(table
126: .getColor("control"), table
127: .getColor("controlLtHighlight"), table
128: .getColor("controlShadow"), table
129: .getColor("controlDkShadow"), new Insets(4, 4, 4, 4));
130:
131: Object defaultFormBackgroundColor = VsnetUtils
132: .getLighterColor((Color) activeTitleBackgroundColor);
133:
134: Color highlightColor = table.getColor("textHighlight");
135:
136: Object focusedButtonColor = new ColorUIResource(VsnetUtils
137: .getRolloverButtonColor(highlightColor));
138:
139: Object selectedAndFocusedButtonColor = new ColorUIResource(
140: VsnetUtils
141: .getSelectedAndRolloverButtonColor(highlightColor));
142:
143: Object selectedButtonColor = new ColorUIResource(VsnetUtils
144: .getSelectedButtonColor(highlightColor));
145:
146: Painter gripperPainter = new Painter() {
147: public void paint(JComponent c, Graphics g, Rectangle rect,
148: int orientation, int state) {
149: MetalPainter.getInstance().paintGripper(c, g, rect,
150: orientation, state);
151: }
152: };
153:
154: Object buttonBorder = new BasicBorders.MarginBorder();
155:
156: ImageIcon sliderHorizontalImage = IconsFactory
157: .getImageIcon(BasicRangeSliderUI.class,
158: "icons/slider_horizontal.gif");
159: ImageIcon sliderVerticalalImage = IconsFactory.getImageIcon(
160: BasicRangeSliderUI.class, "icons/slider_vertical.gif");
161:
162: Object uiDefaults[] = {
163: "JideButton.selectedAndFocusedBackground",
164: selectedAndFocusedButtonColor,
165: "JideButton.focusedBackground",
166: focusedButtonColor,
167: "JideButton.selectedBackground",
168: selectedButtonColor,
169: "JideButton.borderColor",
170: Color.black,
171:
172: "JideButton.font",
173: controlFont,
174: "JideButton.background",
175: defaultBackgroundColor,
176: "JideButton.foreground",
177: defaultTextColor,
178: "JideButton.shadow",
179: defaultShadowColor,
180: "JideButton.darkShadow",
181: defaultDarkShadowColor,
182: "JideButton.light",
183: defaultHighlightColor,
184: "JideButton.highlight",
185: defaultLtHighlightColor,
186: "JideButton.border",
187: buttonBorder,
188: "JideButton.margin",
189: new InsetsUIResource(3, 3, 3, 3),
190: "JideButton.textIconGap",
191: 2,
192: "JideButton.textShiftOffset",
193: 0,
194: "JideButton.focusInputMap",
195: new UIDefaults.LazyInputMap(new Object[] { "SPACE",
196: "pressed", "released SPACE", "released" }),
197:
198: "JideScrollPane.border",
199: singleLineBorder,
200:
201: "JideSplitPane.dividerSize",
202: 3,
203: "JideSplitPaneDivider.border",
204: new BorderUIResource(BorderFactory.createEmptyBorder(0,
205: 0, 0, 0)),
206: "JideSplitPaneDivider.background",
207: defaultBackgroundColor,
208: "JideSplitPaneDivider.gripperPainter",
209: gripperPainter,
210:
211: "JideTabbedPane.defaultTabShape",
212: JideTabbedPane.SHAPE_VSNET,
213: "JideTabbedPane.defaultResizeMode",
214: JideTabbedPane.RESIZE_MODE_NONE,
215: "JideTabbedPane.defaultTabColorTheme",
216: JideTabbedPane.COLOR_THEME_VSNET,
217:
218: "JideTabbedPane.tabRectPadding",
219: 2,
220: "JideTabbedPane.closeButtonMarginHorizonal",
221: 3,
222: "JideTabbedPane.closeButtonMarginVertical",
223: 3,
224: "JideTabbedPane.textMarginVertical",
225: 4,
226: "JideTabbedPane.noIconMargin",
227: 2,
228: "JideTabbedPane.iconMargin",
229: 5,
230: "JideTabbedPane.textPadding",
231: 6,
232: "JideTabbedPane.buttonSize",
233: 18,
234: "JideTabbedPane.buttonMargin",
235: 5,
236: "JideTabbedPane.fitStyleBoundSize",
237: 8,
238: "JideTabbedPane.fitStyleFirstTabMargin",
239: 4,
240: "JideTabbedPane.fitStyleIconMinWidth",
241: 24,
242: "JideTabbedPane.fitStyleTextMinWidth",
243: 16,
244: "JideTabbedPane.compressedStyleNoIconRectSize",
245: 24,
246: "JideTabbedPane.compressedStyleIconMargin",
247: 12,
248: "JideTabbedPane.compressedStyleCloseButtonMarginHorizontal",
249: 0,
250: "JideTabbedPane.compressedStyleCloseButtonMarginVertical",
251: 0,
252: "JideTabbedPane.fixedStyleRectSize",
253: 60,
254: "JideTabbedPane.closeButtonMargin",
255: 2,
256: "JideTabbedPane.gripLeftMargin",
257: 4,
258: "JideTabbedPane.closeButtonMarginSize",
259: 6,
260: "JideTabbedPane.closeButtonLeftMargin",
261: 2,
262: "JideTabbedPane.closeButtonRightMargin",
263: 2,
264:
265: "JideTabbedPane.defaultTabBorderShadowColor",
266: new ColorUIResource(115, 109, 99),
267:
268: "JideTabbedPane.gripperPainter",
269: gripperPainter,
270: "JideTabbedPane.border",
271: new BorderUIResource(BorderFactory.createEmptyBorder(0,
272: 0, 0, 0)),
273: "JideTabbedPane.background",
274: defaultFormBackgroundColor,
275: "JideTabbedPane.foreground",
276: defaultTextColor,
277: "JideTabbedPane.light",
278: defaultHighlightColor,
279: "JideTabbedPane.highlight",
280: defaultLtHighlightColor,
281: "JideTabbedPane.shadow",
282: defaultShadowColor,
283: "JideTabbedPane.darkShadow",
284: defaultTextColor,
285: "JideTabbedPane.tabInsets",
286: new InsetsUIResource(1, 4, 1, 4),
287: "JideTabbedPane.contentBorderInsets",
288: new InsetsUIResource(3, 0, 0, 0),
289: "JideTabbedPane.ignoreContentBorderInsetsIfNoTabs",
290: Boolean.FALSE,
291: "JideTabbedPane.tabAreaInsets",
292: new InsetsUIResource(2, 4, 0, 4),
293: "JideTabbedPane.tabAreaBackground",
294: defaultFormBackgroundColor,
295: "JideTabbedPane.tabRunOverlay",
296: 2,
297: "JideTabbedPane.font",
298: controlFont,
299: "JideTabbedPane.selectedTabFont",
300: controlFont,
301: "JideTabbedPane.selectedTabTextForeground",
302: defaultDarkShadowColor,
303: "JideTabbedPane.unselectedTabTextForeground",
304: defaultDarkShadowColor,
305: "JideTabbedPane.selectedTabBackground",
306: defaultBackgroundColor,
307: "JideTabbedPane.textIconGap",
308: 4,
309: "JideTabbedPane.showIconOnTab",
310: Boolean.TRUE,
311: "JideTabbedPane.showCloseButtonOnTab",
312: Boolean.FALSE,
313: "JideTabbedPane.closeButtonAlignment",
314: SwingConstants.TRAILING,
315: "JideTabbedPane.focusInputMap",
316: new UIDefaults.LazyInputMap(new Object[] { "RIGHT",
317: "navigateRight", "KP_RIGHT", "navigateRight",
318: "LEFT", "navigateLeft", "KP_LEFT",
319: "navigateLeft", "UP", "navigateUp", "KP_UP",
320: "navigateUp", "DOWN", "navigateDown",
321: "KP_DOWN", "navigateDown", "ctrl DOWN",
322: "requestFocusForVisibleComponent",
323: "ctrl KP_DOWN",
324: "requestFocusForVisibleComponent", }),
325: "JideTabbedPane.ancestorInputMap",
326: new UIDefaults.LazyInputMap(new Object[] {
327: "ctrl PAGE_DOWN", "navigatePageDown",
328: "ctrl PAGE_UP", "navigatePageUp", "ctrl UP",
329: "requestFocus", "ctrl KP_UP", "requestFocus", }),
330:
331: "Resizable.resizeBorder",
332: resizeBorder,
333:
334: "Gripper.size",
335: 8,
336: "Gripper.foreground",
337: defaultBackgroundColor,
338: "Gripper.painter",
339: gripperPainter,
340:
341: "MenuBar.border",
342: new BorderUIResource(BorderFactory.createEmptyBorder(1,
343: 0, 1, 0)),
344: "Icon.floating",
345: Boolean.FALSE,
346:
347: "JideSplitButton.font",
348: controlFont,
349: "JideSplitButton.margin",
350: new InsetsUIResource(3, 3, 3, 7),
351: "JideSplitButton.border",
352: buttonBorder,
353: "JideSplitButton.borderPainted",
354: Boolean.FALSE,
355: "JideSplitButton.textIconGap",
356: 3,
357: "JideSplitButton.selectionBackground",
358: table.getColor("MenuItem.selectionBackground"),
359: "JideSplitButton.focusInputMap",
360: new UIDefaults.LazyInputMap(new Object[] { "SPACE",
361: "pressed", "released SPACE", "released",
362: "DOWN", "downPressed", "released DOWN",
363: "downReleased" }),
364:
365: "RangeSlider.lowerIcon",
366: IconsFactory.getIcon(null, sliderHorizontalImage, 0, 0,
367: 9, 8),
368: "RangeSlider.upperIcon",
369: IconsFactory.getIcon(null, sliderHorizontalImage, 0, 8,
370: 9, 8),
371: "RangeSlider.middleIcon",
372: IconsFactory.getIcon(null, sliderHorizontalImage, 0,
373: 16, 9, 6),
374: "RangeSlider.lowerVIcon",
375: IconsFactory.getIcon(null, sliderVerticalalImage, 0, 0,
376: 8, 9),
377: "RangeSlider.upperVIcon",
378: IconsFactory.getIcon(null, sliderVerticalalImage, 8, 0,
379: 8, 9),
380: "RangeSlider.middleVIcon",
381: IconsFactory.getIcon(null, sliderVerticalalImage, 16,
382: 0, 6, 9),
383:
384: "ButtonPanel.order",
385: "ACO",
386: "ButtonPanel.oppositeOrder",
387: "H",
388: "ButtonPanel.buttonGap",
389: 5,
390: "ButtonPanel.groupGap",
391: 5,
392: "ButtonPanel.minButtonWidth",
393: 57,
394:
395: "Cursor.hsplit",
396: JideIconsFactory
397: .getImageIcon(JideIconsFactory.Cursor.HSPLIT),
398: "Cursor.vsplit",
399: JideIconsFactory
400: .getImageIcon(JideIconsFactory.Cursor.VSPLIT),
401:
402: "Cursor.north",
403: JideIconsFactory
404: .getImageIcon(JideIconsFactory.Cursor.NORTH),
405: "Cursor.south",
406: JideIconsFactory
407: .getImageIcon(JideIconsFactory.Cursor.SOUTH),
408: "Cursor.east",
409: JideIconsFactory
410: .getImageIcon(JideIconsFactory.Cursor.EAST),
411: "Cursor.west",
412: JideIconsFactory
413: .getImageIcon(JideIconsFactory.Cursor.WEST),
414: "Cursor.tab",
415: JideIconsFactory
416: .getImageIcon(JideIconsFactory.Cursor.TAB),
417: "Cursor.float",
418: JideIconsFactory
419: .getImageIcon(JideIconsFactory.Cursor.FLOAT),
420: "Cursor.vertical",
421: JideIconsFactory
422: .getImageIcon(JideIconsFactory.Cursor.VERTICAL),
423: "Cursor.horizontal",
424: JideIconsFactory
425: .getImageIcon(JideIconsFactory.Cursor.HORIZONTAL),
426: "Cursor.delete",
427: JideIconsFactory
428: .getImageIcon(JideIconsFactory.Cursor.DELETE),
429: "Cursor.drag",
430: JideIconsFactory
431: .getImageIcon(JideIconsFactory.Cursor.DROP),
432: "Cursor.dragStop",
433: JideIconsFactory
434: .getImageIcon(JideIconsFactory.Cursor.NODROP),
435: "Cursor.dragText",
436: JideIconsFactory
437: .getImageIcon(JideIconsFactory.Cursor.DROP_TEXT),
438: "Cursor.dragTextStop",
439: JideIconsFactory
440: .getImageIcon(JideIconsFactory.Cursor.NODROP_TEXT),
441:
442: };
443: table.putDefaults(uiDefaults);
444:
445: int products = LookAndFeelFactory.getProductsUsed();
446:
447: if ((products & PRODUCT_DOCK) != 0) {
448:
449: ImageIcon titleButtonImage = IconsFactory.getImageIcon(
450: VsnetMetalUtils.class,
451: "icons/title_buttons_metal.gif"); // 16 x 16
452: final int titleButtonSize = 16;
453:
454: uiDefaults = new Object[] {
455: // dock
456: "Workspace.background",
457: mdiBackgroundColor,
458:
459: "SidePane.margin",
460: new InsetsUIResource(2, 2, 2, 0),
461: "SidePane.iconTextGap",
462: 2,
463: "SidePane.textBorderGap",
464: 13,
465: "SidePane.itemGap",
466: 5,
467: "SidePane.groupGap",
468: 13,
469: "SidePane.foreground",
470: defaultTextColor,
471: "SidePane.background",
472: defaultFormBackgroundColor,
473: "SidePane.lineColor",
474: defaultDarkShadowColor,
475: "SidePane.buttonBackground",
476: defaultBackgroundColor,
477: "SidePane.font",
478: controlFont,
479: "SidePane.orientation",
480: 1,
481: "SidePane.showSelectedTabText",
482: Boolean.TRUE,
483: "SidePane.alwaysShowTabText",
484: Boolean.FALSE,
485:
486: "DockableFrame.defaultIcon",
487: JideIconsFactory
488: .getImageIcon(JideIconsFactory.DockableFrame.BLANK),
489: "DockableFrame.background",
490: defaultBackgroundColor,
491: "DockableFrame.border",
492: new BorderUIResource(BorderFactory
493: .createEmptyBorder(0, 0, 0, 0)),
494: "DockableFrame.floatingBorder",
495: new BorderUIResource(BorderFactory
496: .createEmptyBorder(0, 0, 0, 0)),
497: "DockableFrame.slidingEastBorder",
498: slidingEastFrameBorder,
499: "DockableFrame.slidingWestBorder",
500: slidingWestFrameBorder,
501: "DockableFrame.slidingNorthBorder",
502: slidingNorthFrameBorder,
503: "DockableFrame.slidingSouthBorder",
504: slidingSouthFrameBorder,
505:
506: "DockableFrame.activeTitleBackground",
507: activeTitleBackgroundColor,
508: "DockableFrame.activeTitleForeground",
509: activeTitleTextColor,
510: "DockableFrame.inactiveTitleBackground",
511: inactiveTitleBackgroundColor,
512: "DockableFrame.inactiveTitleForeground",
513: inactiveTitleTextColor,
514: "DockableFrame.titleBorder",
515: new BorderUIResource(BorderFactory
516: .createEmptyBorder(1, 0, 3, 0)),
517: "DockableFrame.inactiveTitleBorderColor",
518: activeTitleBorderColor,
519: "DockableFrame.activeTitleBorderColor",
520: activeTitleBorderColor,
521: "DockableFrame.font",
522: controlFont,
523:
524: "DockableFrameTitlePane.gripperPainter",
525: gripperPainter,
526: "DockableFrameTitlePane.font",
527: controlFont,
528: "DockableFrameTitlePane.hideIcon",
529: IconsFactory.getIcon(null, titleButtonImage, 0, 0,
530: titleButtonSize, titleButtonSize),
531: "DockableFrameTitlePane.unfloatIcon",
532: IconsFactory.getIcon(null, titleButtonImage, 0,
533: titleButtonSize, titleButtonSize,
534: titleButtonSize),
535: "DockableFrameTitlePane.floatIcon",
536: IconsFactory.getIcon(null, titleButtonImage, 0,
537: 2 * titleButtonSize, titleButtonSize,
538: titleButtonSize),
539: "DockableFrameTitlePane.autohideIcon",
540: IconsFactory.getIcon(null, titleButtonImage, 0,
541: 3 * titleButtonSize, titleButtonSize,
542: titleButtonSize),
543: "DockableFrameTitlePane.stopAutohideIcon",
544: IconsFactory.getIcon(null, titleButtonImage, 0,
545: 4 * titleButtonSize, titleButtonSize,
546: titleButtonSize),
547: "DockableFrameTitlePane.hideAutohideIcon",
548: IconsFactory.getIcon(null, titleButtonImage, 0,
549: 5 * titleButtonSize, titleButtonSize,
550: titleButtonSize),
551: "DockableFrameTitlePane.maximizeIcon",
552: IconsFactory.getIcon(null, titleButtonImage, 0,
553: 6 * titleButtonSize, titleButtonSize,
554: titleButtonSize),
555: "DockableFrameTitlePane.restoreIcon",
556: IconsFactory.getIcon(null, titleButtonImage, 0,
557: 7 * titleButtonSize, titleButtonSize,
558: titleButtonSize),
559: "DockableFrameTitlePane.titleBarComponent",
560: Boolean.FALSE,
561:
562: "DockableFrameTitlePane.alwaysShowAllButtons",
563: Boolean.FALSE, // true if show all three buttons no matter if the buttons is available. false if only show buttons which is available
564: "DockableFrameTitlePane.buttonsAlignment",
565: SwingConstants.TRAILING, // trailing or leading
566: "DockableFrameTitlePane.titleAlignment",
567: SwingConstants.LEADING, // trailing or leading or center
568: "DockableFrameTitlePane.buttonGap",
569: 2, // gap between buttons
570: "DockableFrameTitlePane.showIcon",
571: Boolean.FALSE, // show icon or not, the alignment is the same as titleAlignment
572: "DockableFrameTitlePane.margin",
573: new InsetsUIResource(0, 6, 0, 6), // gap
574:
575: "ContentContainer.background",
576: defaultFormBackgroundColor,
577: "ContentContainer.vgap",
578: 1,
579: "ContentContainer.hgap",
580: 1,
581: "MainContainer.border",
582: new BorderUIResource(BorderFactory
583: .createEmptyBorder(0, 0, 0, 0)),
584:
585: "DockingFramework.changeCursor", Boolean.FALSE,
586:
587: "Contour.color",
588: new ColorUIResource(136, 136, 136),
589: "Contour.thickness", 4, };
590: table.putDefaults(uiDefaults);
591: }
592:
593: if ((products & PRODUCT_COMPONENTS) != 0) {
594: ImageIcon collapsiblePaneImage = IconsFactory.getImageIcon(
595: VsnetMetalUtils.class,
596: "icons/collapsible_pane_metal.gif"); // 12 x 12 x 2
597: final int collapsiblePaneSize = 12;
598:
599: uiDefaults = new Object[] {
600: // components
601: "CollapsiblePanes.border",
602: new BorderUIResource(BorderFactory
603: .createEmptyBorder(12, 12, 0, 12)),
604: "CollapsiblePanes.gap",
605: 15,
606:
607: "CollapsiblePane.background",
608: defaultBackgroundColor,
609: "CollapsiblePane.contentBackground",
610: defaultHighlightColor,
611: "CollapsiblePane.foreground",
612: defaultTextColor,
613: "CollapsiblePane.emphasizedBackground",
614: activeTitleBackgroundColor,
615: "CollapsiblePane.emphasizedForeground",
616: activeTitleTextColor,
617: "CollapsiblePane.border",
618: new BorderUIResource(BorderFactory
619: .createEmptyBorder(1, 1, 1, 1)),
620: "CollapsiblePane.font",
621: controlFont,
622:
623: "CollapsiblePane.contentBorder",
624: new BorderUIResource(BorderFactory
625: .createEmptyBorder(8, 10, 8, 10)),
626:
627: "CollapsiblePane.titleBorder",
628: new BorderUIResource(BorderFactory
629: .createEmptyBorder(3, 3, 3, 3)),
630: "CollapsiblePane.titleFont",
631: controlFont,
632: "CollapsiblePane.downIcon",
633: IconsFactory
634: .getIcon(null, collapsiblePaneImage, 0, 0,
635: collapsiblePaneSize,
636: collapsiblePaneSize),
637: "CollapsiblePane.upIcon",
638: IconsFactory.getIcon(null, collapsiblePaneImage, 0,
639: collapsiblePaneSize, collapsiblePaneSize,
640: collapsiblePaneSize),
641:
642: "StatusBarItem.border",
643: BorderFactory.createEtchedBorder(),
644:
645: "StatusBar.border",
646: new BorderUIResource(BorderFactory
647: .createEmptyBorder(2, 0, 0, 0)),
648: "StatusBar.gap",
649: 5,
650: "StatusBar.background",
651: defaultBackgroundColor,
652: "StatusBar.font",
653: controlFont,
654:
655: "DocumentPane.groupBorder",
656: new BorderUIResource(BorderFactory
657: .createLineBorder(Color.gray)),
658: "DocumentPane.newHorizontalGroupIcon",
659: JideIconsFactory
660: .getImageIcon(JideIconsFactory.WindowMenu.NEW_HORIZONTAL_TAB),
661: "DocumentPane.newVerticalGroupIcon",
662: JideIconsFactory
663: .getImageIcon(JideIconsFactory.WindowMenu.NEW_VERTICAL_TAB),
664: "DocumentPane.boldActiveTab", Boolean.TRUE, };
665: table.putDefaults(uiDefaults);
666: }
667:
668: if ((products & PRODUCT_ACTION) != 0) {
669: uiDefaults = new Object[] {
670: // action
671: "CommandBar.font",
672: toolbarFont,
673: "CommandBar.background",
674: defaultBackgroundColor,
675: "CommandBar.foreground",
676: defaultTextColor,
677: "CommandBar.shadow",
678: defaultShadowColor,
679: "CommandBar.darkShadow",
680: defaultDarkShadowColor,
681: "CommandBar.light",
682: defaultHighlightColor,
683: "CommandBar.highlight",
684: defaultLtHighlightColor,
685: "CommandBar.border",
686: new BorderUIResource(BorderFactory
687: .createEmptyBorder(1, 1, 1, 1)),
688: "CommandBar.borderVert",
689: new BorderUIResource(BorderFactory
690: .createEmptyBorder(1, 1, 1, 1)),
691: "CommandBar.borderFloating",
692: new BorderUIResource(
693: BorderFactory
694: .createCompoundBorder(
695: BorderFactory
696: .createLineBorder(
697: (Color) activeTitleBackgroundColor,
698: 2),
699: BorderFactory
700: .createEmptyBorder(
701: 1, 1, 1, 1))),
702: "CommandBar.ancestorInputMap",
703: new UIDefaults.LazyInputMap(new Object[] { "UP",
704: "navigateUp", "KP_UP", "navigateUp",
705: "DOWN", "navigateDown", "KP_DOWN",
706: "navigateDown", "LEFT", "navigateLeft",
707: "KP_LEFT", "navigateLeft", "RIGHT",
708: "navigateRight", "KP_RIGHT",
709: "navigateRight" }),
710: "CommandBar.titleBarSize", 17,
711: "CommandBar.titleBarButtonGap", 1,
712: "CommandBar.titleBarBackground",
713: activeTitleBackgroundColor,
714: "CommandBar.titleBarForeground",
715: activeTitleTextColor, "CommandBar.titleBarFont",
716: controlFont,
717: "CommandBar.minimumSize",
718: new DimensionUIResource(16, 16),
719:
720: "CommandBar.separatorSize",
721: 5,
722:
723: // *** Separator
724: "CommandBarSeparator.background",
725: new Color(219, 216, 209),
726: "CommandBarSeparator.foreground",
727: new Color(166, 166, 166),
728:
729: "Chevron.size", 11, "Chevron.alwaysVisible",
730: Boolean.FALSE,
731:
732: };
733: table.putDefaults(uiDefaults);
734: }
735:
736: if ((products & PRODUCT_GRIDS) != 0) {
737: uiDefaults = new Object[] { "AbstractComboBox.useJButton",
738: Boolean.TRUE, "NestedTableHeader.cellBorder",
739: table.getBorder("TableHeader.cellBorder"), };
740: table.putDefaults(uiDefaults);
741: }
742:
743: // make the spinner has the same font as text field
744: table.put("Spinner.font", table.get("TextField.font"));
745: table.put("Spinner.margin", table.get("TextField.margin"));
746: table.put("FormattedTextField.font", table
747: .get("TextField.font"));
748:
749: table.put("Theme.painter", MetalPainter.getInstance());
750: }
751: }
|