0001: /*
0002: * @(#)XertoWindowsUtils.java 6/13/2005
0003: *
0004: * Copyright 2002 - 2005 JIDE Software Inc. All rights reserved.
0005: */
0006: package com.jidesoft.plaf.xerto;
0007:
0008: import com.jidesoft.icons.IconsFactory;
0009: import com.jidesoft.icons.JideIconsFactory;
0010: import com.jidesoft.plaf.ExtWindowsDesktopProperty;
0011: import com.jidesoft.plaf.LookAndFeelFactory;
0012: import com.jidesoft.plaf.WindowsDesktopProperty;
0013: import com.jidesoft.plaf.basic.BasicPainter;
0014: import com.jidesoft.plaf.basic.Painter;
0015: import com.jidesoft.plaf.office2003.Office2003WindowsUtils;
0016: import com.jidesoft.plaf.vsnet.ConvertListener;
0017: import com.jidesoft.plaf.vsnet.HeaderCellBorder;
0018: import com.jidesoft.plaf.vsnet.ResizeFrameBorder;
0019: import com.jidesoft.plaf.vsnet.VsnetLookAndFeelExtension;
0020: import com.jidesoft.swing.JideSwingUtilities;
0021: import com.jidesoft.swing.JideTabbedPane;
0022: import com.jidesoft.utils.SecurityUtils;
0023:
0024: import javax.swing.*;
0025: import javax.swing.plaf.BorderUIResource;
0026: import javax.swing.plaf.ColorUIResource;
0027: import javax.swing.plaf.InsetsUIResource;
0028: import javax.swing.plaf.basic.BasicBorders;
0029: import java.awt.*;
0030:
0031: /**
0032: * Initialize the uiClassID to BasicComponentUI mapping for JIDE components using Xerto style for WindowsLookAndFeel.
0033: * Xerto Style is designed by Xerto at http://www.xerto.com.
0034: */
0035: public class XertoWindowsUtils extends Office2003WindowsUtils {
0036:
0037: /**
0038: * Initializes class defaults with menu components UIDefaults.
0039: *
0040: * @param table
0041: */
0042: public static void initClassDefaultsWithMenu(UIDefaults table) {
0043: VsnetLookAndFeelExtension.initClassDefaultsWithMenu(table);
0044: initClassDefaults(table);
0045: }
0046:
0047: /**
0048: * Initializes class defaults with menu components UIDefaults.
0049: *
0050: * @param table
0051: */
0052: public static void initClassDefaults(UIDefaults table) {
0053: Office2003WindowsUtils.initClassDefaults(table, false);
0054: initClassDefaultsForXerto(table);
0055: }
0056:
0057: private static void initClassDefaultsForXerto(UIDefaults table) {
0058: int products = LookAndFeelFactory.getProductsUsed();
0059:
0060: final String xertoPackageName = "com.jidesoft.plaf.xerto.";
0061:
0062: if ((products & PRODUCT_COMPONENTS) != 0) {
0063: table.put("CollapsiblePaneUI", xertoPackageName
0064: + "XertoCollapsiblePaneUI");
0065: }
0066:
0067: if ((products & PRODUCT_DOCK) != 0) {
0068: table.put("SidePaneUI", xertoPackageName
0069: + "XertoSidePaneUI");
0070: table.put("DockableFrameUI", xertoPackageName
0071: + "XertoDockableFrameUI");
0072: }
0073: }
0074:
0075: /**
0076: * Initializes components defaults.
0077: *
0078: * @param table
0079: */
0080: public static void initComponentDefaultsWithMenu(UIDefaults table) {
0081: /// always want shading
0082: System.setProperty("shadingtheme", "true");
0083:
0084: Toolkit toolkit = Toolkit.getDefaultToolkit();
0085:
0086: WindowsDesktopProperty defaultHighlightColor = new WindowsDesktopProperty(
0087: "win.3d.lightColor", table.get("controlHighlight"),
0088: toolkit);
0089: WindowsDesktopProperty selectionBackgroundColor = new WindowsDesktopProperty(
0090: "win.item.highlightColor", table.get("controlShadow"),
0091: toolkit);
0092: WindowsDesktopProperty menuTextColor = new WindowsDesktopProperty(
0093: "win.menu.textColor", table.get("control"), toolkit);
0094:
0095: Object menuFont = JideSwingUtilities
0096: .getMenuFont(toolkit, table);
0097:
0098: Object menuSelectionBackground = new ExtWindowsDesktopProperty(
0099: //Actual color 182, 189, 210
0100: new String[] { "win.item.highlightColor" },
0101: new Object[] { table.get("controlShadow") }, toolkit,
0102: new ConvertListener() {
0103: public Object convert(Object[] obj) {
0104: return new ColorUIResource(XertoUtils
0105: .getMenuSelectionColor((Color) obj[0]));
0106: }
0107: });
0108:
0109: Object menuBackground = new ExtWindowsDesktopProperty(
0110: //Actual color 249, 248, 247
0111: new String[] { "win.3d.backgroundColor" },
0112: new Object[] { table.get("control") }, toolkit,
0113: new ConvertListener() {
0114: public Object convert(Object[] obj) {
0115: return new ColorUIResource(XertoUtils
0116: .getMenuBackgroundColor((Color) obj[0]));
0117: }
0118: });
0119:
0120: Object separatorColor = new ExtWindowsDesktopProperty(
0121: // Not exactly right
0122: new String[] { "win.3d.shadowColor" },
0123: new Object[] { table.get("controlShadow") }, toolkit,
0124: new ConvertListener() {
0125: public Object convert(Object[] obj) {
0126: return new ColorUIResource(((Color) obj[0])
0127: .brighter());
0128: }
0129: });
0130:
0131: Object[] uiDefaults = {
0132: "PopupMenuSeparator.foreground",
0133: separatorColor,
0134: "PopupMenuSeparator.background",
0135: menuBackground,
0136:
0137: "CheckBoxMenuItem.checkIcon",
0138: JideIconsFactory
0139: .getImageIcon(JideIconsFactory.MENU_CHECKBOX_VSNET),
0140: "CheckBoxMenuItem.selectionBackground",
0141: menuSelectionBackground,
0142: "CheckBoxMenuItem.selectionForeground",
0143: menuTextColor,
0144: "CheckBoxMenuItem.acceleratorSelectionForeground",
0145: menuTextColor,
0146: "CheckBoxMenuItem.mouseHoverBackground",
0147: menuSelectionBackground,
0148: "CheckBoxMenuItem.mouseHoverBorder",
0149: new BorderUIResource(BorderFactory
0150: .createLineBorder(new Color(10, 36, 106))),
0151: "CheckBoxMenuItem.margin",
0152: new InsetsUIResource(3, 0, 3, 0),
0153: "CheckBoxMenuItem.font",
0154: menuFont,
0155: "CheckBoxMenuItem.acceleratorFont",
0156: menuFont,
0157: "CheckBoxMenuItem.textIconGap",
0158: 8,
0159:
0160: "RadioButtonMenuItem.checkIcon",
0161: JideIconsFactory
0162: .getImageIcon(JideIconsFactory.MENU_CHECKBOX_VSNET),
0163: "RadioButtonMenuItem.selectionBackground",
0164: menuSelectionBackground,
0165: "RadioButtonMenuItem.selectionForeground",
0166: menuTextColor,
0167: "RadioButtonMenuItem.acceleratorSelectionForeground",
0168: menuTextColor,
0169: "RadioButtonMenuItem.mouseHoverBackground",
0170: menuSelectionBackground,
0171: "RadioButtonMenuItem.mouseHoverBorder",
0172: new BorderUIResource(BorderFactory
0173: .createLineBorder(new Color(10, 36, 106))),
0174: "RadioButtonMenuItem.margin",
0175: new InsetsUIResource(3, 0, 3, 0),
0176: "RadioButtonMenuItem.font",
0177: menuFont,
0178: "RadioButtonMenuItem.acceleratorFont",
0179: menuFont,
0180: "RadioButtonMenuItem.textIconGap",
0181: 8,
0182:
0183: "MenuBar.border",
0184: new BorderUIResource(BorderFactory.createEmptyBorder(2,
0185: 2, 2, 2)),
0186: // "MenuBar.border", new BorderUIResource(BorderFactory.createCompoundBorder(
0187: // new PartialEtchedBorder(PartialEtchedBorder.LOWERED, PartialSide.SOUTH),
0188: // BorderFactory.createEmptyBorder(2, 2, 2, 2))),
0189:
0190: "Menu.selectionBackground",
0191: menuSelectionBackground,
0192: "Menu.selectionForeground",
0193: menuTextColor,
0194: "Menu.mouseHoverBackground",
0195: menuSelectionBackground,
0196: "Menu.mouseHoverBorder",
0197: new BorderUIResource(BorderFactory
0198: .createLineBorder(new Color(10, 36, 106))),
0199: "Menu.margin",
0200: new InsetsUIResource(2, 7, 1, 7),
0201: "Menu.checkIcon",
0202: JideIconsFactory
0203: .getImageIcon(JideIconsFactory.MENU_CHECKBOX_VSNET),
0204: "Menu.textIconGap",
0205: 2,
0206: "Menu.font",
0207: menuFont,
0208: "Menu.acceleratorFont",
0209: menuFont,
0210: "Menu.submenuPopupOffsetX",
0211: 0,
0212: "Menu.submenuPopupOffsetY",
0213: 0,
0214:
0215: "PopupMenu.border",
0216: new BorderUIResource(BorderFactory
0217: .createCompoundBorder(BorderFactory
0218: .createLineBorder(new Color(102, 102,
0219: 102)), BorderFactory
0220: .createEmptyBorder(1, 1, 1, 1))),
0221:
0222: "MenuItem.checkIcon",
0223: JideIconsFactory
0224: .getImageIcon(JideIconsFactory.MENU_CHECKBOX_VSNET),
0225: "MenuItem.selectionBackground",
0226: menuSelectionBackground,
0227: "MenuItem.selectionForeground", menuTextColor,
0228: "MenuItem.acceleratorSelectionForeground",
0229: menuTextColor, "MenuItem.background", menuBackground,
0230: "MenuItem.selectionBorderColor",
0231: selectionBackgroundColor,
0232: "MenuItem.shadowWidth",
0233: 24,
0234: "MenuItem.shadowColor",
0235: defaultHighlightColor, // TODO: not exactly. The actual one a little bit brighter than it
0236: "MenuItem.textIconGap", 8, "MenuItem.accelEndGap", 18,
0237: "MenuItem.margin", new InsetsUIResource(4, 0, 3, 0),
0238: "MenuItem.font", menuFont, "MenuItem.acceleratorFont",
0239: menuFont };
0240: table.putDefaults(uiDefaults);
0241: initComponentDefaults(table);
0242:
0243: table.put("Theme.painter", XertoPainter.getInstance());
0244:
0245: // since it used BasicPainter, make sure it is after Theme.Painter is set first.
0246: Object popupMenuBorder = new ExtWindowsDesktopProperty(
0247: new String[] { "null" },
0248: new Object[] { ((BasicPainter) table
0249: .get("Theme.painter")).getMenuItemBorderColor() },
0250: toolkit, new ConvertListener() {
0251: public Object convert(Object[] obj) {
0252: return new BorderUIResource(
0253: BorderFactory
0254: .createCompoundBorder(
0255: BorderFactory
0256: .createLineBorder((Color) obj[0]),
0257: BorderFactory
0258: .createEmptyBorder(
0259: 1, 1,
0260: 1, 1)));
0261: }
0262: });
0263: table.put("PopupMenu.border", popupMenuBorder);
0264: }
0265:
0266: /**
0267: * Initializes components defaults with menu components UIDefaults.
0268: *
0269: * @param table
0270: */
0271: public static void initComponentDefaults(UIDefaults table) {
0272: /// always want shading
0273: System.setProperty("shadingtheme", "true");
0274:
0275: Toolkit toolkit = Toolkit.getDefaultToolkit();
0276:
0277: WindowsDesktopProperty defaultHighlightColor = new WindowsDesktopProperty(
0278: "win.3d.lightColor", table.get("controlHighlight"),
0279: toolkit);
0280: WindowsDesktopProperty defaultLtHighlightColor = new WindowsDesktopProperty(
0281: "win.3d.highlightColor", table
0282: .get("controlLtHighlight"), toolkit);
0283: WindowsDesktopProperty selectionBackgroundColor = new WindowsDesktopProperty(
0284: "win.item.highlightColor", table.get("controlShadow"),
0285: toolkit);
0286: WindowsDesktopProperty mdiBackgroundColor = new WindowsDesktopProperty(
0287: "win.mdi.backgroundColor", table.get("controlShadow"),
0288: toolkit);
0289: WindowsDesktopProperty menuTextColor = new WindowsDesktopProperty(
0290: "win.menu.textColor", table.get("controlText"), toolkit);
0291: WindowsDesktopProperty defaultTextColor = new WindowsDesktopProperty(
0292: "win.button.textColor", table.get("controlText"),
0293: toolkit);
0294: WindowsDesktopProperty defaultBackgroundColor = new WindowsDesktopProperty(
0295: "win.3d.backgroundColor", table.get("control"), toolkit);
0296: WindowsDesktopProperty defaultShadowColor = new WindowsDesktopProperty(
0297: "win.3d.shadowColor", table.get("controlShadow"),
0298: toolkit);
0299: WindowsDesktopProperty defaultDarkShadowColor = new WindowsDesktopProperty(
0300: "win.3d.darkShadowColor", table.get("controlDkShadow"),
0301: toolkit);
0302: WindowsDesktopProperty activeTitleBackgroundColor = new WindowsDesktopProperty(
0303: "win.frame.activeCaptionColor", table
0304: .get("activeCaption"), toolkit);
0305: WindowsDesktopProperty activeTitleTextColor = new WindowsDesktopProperty(
0306: "win.frame.captionTextColor", table
0307: .get("activeCaptionText"), toolkit);
0308:
0309: Object singleLineBorder = new ExtWindowsDesktopProperty(
0310: new String[] { "win.3d.shadowColor" },
0311: new Object[] { table.get("controlShadow") }, toolkit,
0312: new ConvertListener() {
0313: public Object convert(Object[] obj) {
0314: return new BorderUIResource(BorderFactory
0315: .createLineBorder((Color) obj[0]));
0316: }
0317: });
0318:
0319: Object controlFont = JideSwingUtilities.getControlFont(toolkit,
0320: table);
0321: Object toolbarFont = JideSwingUtilities.getMenuFont(toolkit,
0322: table);
0323: Object boldFont = JideSwingUtilities
0324: .getBoldFont(toolkit, table);
0325:
0326: Object resizeBorder = new ExtWindowsDesktopProperty(
0327: new String[] { "win.3d.lightColor",
0328: "win.3d.highlightColor", "win.3d.shadowColor",
0329: "win.3d.darkShadowColor" }, new Object[] {
0330: table.get("control"),
0331: table.get("controlLtHighlight"),
0332: table.get("controlShadow"),
0333: table.get("controlDkShadow") }, toolkit,
0334: new ConvertListener() {
0335: public Object convert(Object[] obj) {
0336: return new XertoFrameBorder(new Insets(4, 4, 4,
0337: 4));
0338: }
0339: });
0340:
0341: Object defaultFormBackground = new ExtWindowsDesktopProperty(
0342: new String[] { "win.3d.backgroundColor" },
0343: new Object[] { table.get("control") }, toolkit,
0344: new ConvertListener() {
0345: public Object convert(Object[] obj) {
0346: return new ColorUIResource(
0347: XertoUtils
0348: .getDefaultBackgroundColor((Color) obj[0]));
0349: }
0350: });
0351:
0352: Object inactiveTabForground = new ExtWindowsDesktopProperty(
0353: // Not exactly right
0354: new String[] { "win.3d.shadowColor" },
0355: new Object[] { table.get("controlShadow") }, toolkit,
0356: new ConvertListener() {
0357: public Object convert(Object[] obj) {
0358: return new ColorUIResource(((Color) obj[0])
0359: .darker());
0360: }
0361: });
0362:
0363: Object focusedButtonColor = new ExtWindowsDesktopProperty(
0364: new String[] { "win.item.highlightColor" },
0365: new Object[] { table.get("textHighlight") }, toolkit,
0366: new ConvertListener() {
0367: public Object convert(Object[] obj) {
0368: return new ColorUIResource(XertoUtils
0369: .getFocusedButtonColor((Color) obj[0]));
0370: }
0371: });
0372:
0373: Object selectedAndFocusedButtonColor = new ExtWindowsDesktopProperty(
0374: new String[] { "win.item.highlightColor" },
0375: new Object[] { table.get("textHighlight") }, toolkit,
0376: new ConvertListener() {
0377: public Object convert(Object[] obj) {
0378: return new ColorUIResource(
0379: XertoUtils
0380: .getSelectedAndFocusedButtonColor((Color) obj[0]));
0381: }
0382: });
0383:
0384: Object selectedButtonColor = new ExtWindowsDesktopProperty(
0385: new String[] { "win.item.highlightColor" },
0386: new Object[] { table.get("textHighlight") }, toolkit,
0387: new ConvertListener() {
0388: public Object convert(Object[] obj) {
0389: return new ColorUIResource(XertoUtils
0390: .getSelectedButtonColor((Color) obj[0]));
0391: }
0392: });
0393:
0394: Object gripperForeground = new ExtWindowsDesktopProperty(
0395: new String[] { "win.3d.backgroundColor" },
0396: new Object[] { table.get("control") }, toolkit,
0397: new ConvertListener() {
0398: public Object convert(Object[] obj) {
0399: return new ColorUIResource(
0400: XertoUtils
0401: .getGripperForegroundColor((Color) obj[0]));
0402: }
0403: });
0404:
0405: Object commandBarBackground = new ExtWindowsDesktopProperty(
0406: new String[] { "win.3d.backgroundColor" },
0407: new Object[] { table.get("control") }, toolkit,
0408: new ConvertListener() {
0409: public Object convert(Object[] obj) {
0410: return new ColorUIResource(
0411: XertoUtils
0412: .getToolBarBackgroundColor((Color) obj[0]));
0413: }
0414: });
0415:
0416: Painter gripperPainter = new Painter() {
0417: public void paint(JComponent c, Graphics g, Rectangle rect,
0418: int orientation, int state) {
0419: XertoPainter.getInstance().paintGripper(c, g, rect,
0420: orientation, state);
0421: }
0422: };
0423:
0424: Object buttonBorder = new BasicBorders.MarginBorder();
0425:
0426: ImageIcon sliderHorizontalImage = IconsFactory.getImageIcon(
0427: Office2003WindowsUtils.class,
0428: "icons/slider_horizontal.gif");
0429: ImageIcon sliderVerticalalImage = IconsFactory.getImageIcon(
0430: Office2003WindowsUtils.class,
0431: "icons/slider_vertical.gif");
0432:
0433: Object[] uiDefaults = new Object[] {
0434: "JideScrollPane.border",
0435: singleLineBorder,
0436:
0437: "JideButton.selectedAndFocusedBackground",
0438: selectedAndFocusedButtonColor,
0439: "JideButton.focusedBackground",
0440: focusedButtonColor,
0441: "JideButton.selectedBackground",
0442: selectedButtonColor,
0443: "JideButton.borderColor",
0444: selectionBackgroundColor,
0445:
0446: "JideButton.font",
0447: controlFont,
0448: "JideButton.background",
0449: defaultBackgroundColor,
0450: "JideButton.foreground",
0451: defaultTextColor,
0452: "JideButton.shadow",
0453: defaultShadowColor,
0454: "JideButton.darkShadow",
0455: defaultDarkShadowColor,
0456: "JideButton.light",
0457: defaultHighlightColor,
0458: "JideButton.highlight",
0459: defaultLtHighlightColor,
0460: "JideButton.border",
0461: buttonBorder,
0462: "JideButton.margin",
0463: new InsetsUIResource(3, 3, 3, 3),
0464: "JideButton.textIconGap",
0465: 2,
0466: "JideButton.textShiftOffset",
0467: 0,
0468: "JideButton.focusInputMap",
0469: new UIDefaults.LazyInputMap(new Object[] { "SPACE",
0470: "pressed", "released SPACE", "released",
0471: "ENTER", "pressed", "released ENTER",
0472: "released" // no last two for metal
0473: }),
0474:
0475: "JideSplitPane.dividerSize",
0476: 3,
0477: "JideSplitPaneDivider.border",
0478: new BorderUIResource(BorderFactory.createEmptyBorder()),
0479: "JideSplitPaneDivider.background",
0480: defaultBackgroundColor,
0481: "JideSplitPaneDivider.gripperPainter",
0482: gripperPainter,
0483:
0484: "JideTabbedPane.defaultTabShape",
0485: JideTabbedPane.SHAPE_ROUNDED_VSNET,
0486: "JideTabbedPane.defaultResizeMode",
0487: JideTabbedPane.RESIZE_MODE_NONE,
0488: "JideTabbedPane.defaultTabColorTheme",
0489: JideTabbedPane.COLOR_THEME_OFFICE2003,
0490:
0491: "JideTabbedPane.tabRectPadding",
0492: 2,
0493: "JideTabbedPane.closeButtonMarginHorizonal",
0494: 3,
0495: "JideTabbedPane.closeButtonMarginVertical",
0496: 3,
0497: "JideTabbedPane.textMarginVertical",
0498: 4,
0499: "JideTabbedPane.noIconMargin",
0500: 2,
0501: "JideTabbedPane.iconMargin",
0502: 5,
0503: "JideTabbedPane.textPadding",
0504: 6,
0505: "JideTabbedPane.buttonSize",
0506: 18,
0507: "JideTabbedPane.buttonMargin",
0508: 5,
0509: "JideTabbedPane.fitStyleBoundSize",
0510: 8,
0511: "JideTabbedPane.fitStyleFirstTabMargin",
0512: 4,
0513: "JideTabbedPane.fitStyleIconMinWidth",
0514: 24,
0515: "JideTabbedPane.fitStyleTextMinWidth",
0516: 16,
0517: "JideTabbedPane.compressedStyleNoIconRectSize",
0518: 24,
0519: "JideTabbedPane.compressedStyleIconMargin",
0520: 12,
0521: "JideTabbedPane.compressedStyleCloseButtonMarginHorizontal",
0522: 0,
0523: "JideTabbedPane.compressedStyleCloseButtonMarginVertical",
0524: 0,
0525: "JideTabbedPane.fixedStyleRectSize",
0526: 60,
0527: "JideTabbedPane.closeButtonMargin",
0528: 2,
0529: "JideTabbedPane.gripLeftMargin",
0530: 4,
0531: "JideTabbedPane.closeButtonMarginSize",
0532: 6,
0533: "JideTabbedPane.closeButtonLeftMargin",
0534: 2,
0535: "JideTabbedPane.closeButtonRightMargin",
0536: 2,
0537:
0538: "JideTabbedPane.defaultTabBorderShadowColor",
0539: new ColorUIResource(115, 109, 99),
0540:
0541: "JideTabbedPane.gripperPainter",
0542: gripperPainter,
0543: "JideTabbedPane.border",
0544: new BorderUIResource(BorderFactory.createEmptyBorder(0,
0545: 0, 0, 0)),
0546: "JideTabbedPane.background",
0547: new ColorUIResource(XertoUtils.getControlColor()),
0548: "JideTabbedPane.foreground",
0549: new ColorUIResource(XertoUtils.getTabForgroundColor()),
0550: "JideTabbedPane.light",
0551: defaultHighlightColor,
0552: "JideTabbedPane.highlight",
0553: defaultLtHighlightColor,
0554: "JideTabbedPane.shadow",
0555: defaultShadowColor,
0556: "JideTabbedPane.darkShadow",
0557: new ColorUIResource(Color.GRAY),
0558: "JideTabbedPane.tabInsets",
0559: new InsetsUIResource(1, 4, 1, 4),
0560: "JideTabbedPane.contentBorderInsets",
0561: new InsetsUIResource(1, 1, 1, 1),
0562: "JideTabbedPane.ignoreContentBorderInsetsIfNoTabs",
0563: Boolean.FALSE,
0564: "JideTabbedPane.tabAreaInsets",
0565: new InsetsUIResource(2, 4, 0, 4),
0566: "JideTabbedPane.tabAreaBackground",
0567: new ColorUIResource(XertoUtils
0568: .getApplicationFrameBackgroundColor()),
0569: "JideTabbedPane.tabRunOverlay",
0570: 2,
0571: "JideTabbedPane.font",
0572: controlFont,
0573: "JideTabbedPane.selectedTabFont",
0574: controlFont,
0575: "JideTabbedPane.selectedTabTextForeground",
0576: new ColorUIResource(XertoUtils.getTabForgroundColor()),
0577: "JideTabbedPane.unselectedTabTextForeground",
0578: inactiveTabForground,
0579: "JideTabbedPane.selectedTabBackground",
0580: new ColorUIResource(XertoUtils
0581: .getSelectedTabBackgroundColor()),
0582: "JideTabbedPane.textIconGap",
0583: 4,
0584: "JideTabbedPane.showIconOnTab",
0585: Boolean.TRUE,
0586: "JideTabbedPane.showCloseButtonOnTab",
0587: Boolean.FALSE,
0588: "JideTabbedPane.closeButtonAlignment",
0589: SwingConstants.TRAILING,
0590: "JideTabbedPane.focusInputMap",
0591: new UIDefaults.LazyInputMap(new Object[] { "RIGHT",
0592: "navigateRight", "KP_RIGHT", "navigateRight",
0593: "LEFT", "navigateLeft", "KP_LEFT",
0594: "navigateLeft", "UP", "navigateUp", "KP_UP",
0595: "navigateUp", "DOWN", "navigateDown",
0596: "KP_DOWN", "navigateDown", "ctrl DOWN",
0597: "requestFocusForVisibleComponent",
0598: "ctrl KP_DOWN",
0599: "requestFocusForVisibleComponent", }),
0600: "JideTabbedPane.ancestorInputMap",
0601: new UIDefaults.LazyInputMap(new Object[] {
0602: "ctrl PAGE_DOWN", "navigatePageDown",
0603: "ctrl PAGE_UP", "navigatePageUp", "ctrl UP",
0604: "requestFocus", "ctrl KP_UP", "requestFocus", }),
0605:
0606: "ButtonPanel.order",
0607: "ACO",
0608: "ButtonPanel.oppositeOrder",
0609: "H",
0610: "ButtonPanel.buttonGap",
0611: 6,
0612: "ButtonPanel.groupGap",
0613: 6,
0614: "ButtonPanel.minButtonWidth",
0615: 75,
0616:
0617: "JideSplitButton.font",
0618: controlFont,
0619: "JideSplitButton.margin",
0620: new InsetsUIResource(3, 3, 3, 7),
0621: "JideSplitButton.border",
0622: buttonBorder,
0623: "JideSplitButton.borderPainted",
0624: Boolean.FALSE,
0625: "JideSplitButton.textIconGap",
0626: 3,
0627: "JideSplitButton.selectionForeground",
0628: menuTextColor,
0629: "JideSplitButton.focusInputMap",
0630: new UIDefaults.LazyInputMap(new Object[] { "SPACE",
0631: "pressed", "released SPACE", "released",
0632: "ENTER", "pressed",
0633: "released ENTER",
0634: "released", // no these two for metal
0635: "DOWN", "downPressed", "released DOWN",
0636: "downReleased", }),
0637:
0638: "RangeSlider.lowerIcon",
0639: IconsFactory.getIcon(null, sliderHorizontalImage, 0, 0,
0640: 9, 10),
0641: "RangeSlider.upperIcon",
0642: IconsFactory.getIcon(null, sliderHorizontalImage, 0,
0643: 10, 9, 10),
0644: "RangeSlider.middleIcon",
0645: IconsFactory.getIcon(null, sliderHorizontalImage, 0,
0646: 20, 9, 7),
0647: "RangeSlider.lowerRIcon",
0648: IconsFactory.getIcon(null, sliderHorizontalImage, 9, 0,
0649: 9, 10),
0650: "RangeSlider.upperRIcon",
0651: IconsFactory.getIcon(null, sliderHorizontalImage, 9,
0652: 10, 9, 10),
0653: "RangeSlider.middleRIcon",
0654: IconsFactory.getIcon(null, sliderHorizontalImage, 9,
0655: 20, 9, 7),
0656:
0657: "RangeSlider.lowerVIcon",
0658: IconsFactory.getIcon(null, sliderVerticalalImage, 0, 0,
0659: 10, 9),
0660: "RangeSlider.upperVIcon",
0661: IconsFactory.getIcon(null, sliderVerticalalImage, 10,
0662: 0, 10, 9),
0663: "RangeSlider.middleVIcon",
0664: IconsFactory.getIcon(null, sliderVerticalalImage, 20,
0665: 0, 7, 9),
0666: "RangeSlider.lowerVRIcon",
0667: IconsFactory.getIcon(null, sliderVerticalalImage, 0, 9,
0668: 10, 9),
0669: "RangeSlider.upperVRIcon",
0670: IconsFactory.getIcon(null, sliderVerticalalImage, 10,
0671: 9, 10, 9),
0672: "RangeSlider.middleVRIcon",
0673: IconsFactory.getIcon(null, sliderVerticalalImage, 20,
0674: 9, 7, 9),
0675:
0676: "Cursor.hsplit",
0677: JideIconsFactory
0678: .getImageIcon(JideIconsFactory.Cursor.HSPLIT),
0679: "Cursor.vsplit",
0680: JideIconsFactory
0681: .getImageIcon(JideIconsFactory.Cursor.VSPLIT),
0682:
0683: "Cursor.north",
0684: JideIconsFactory
0685: .getImageIcon(JideIconsFactory.Cursor.NORTH),
0686: "Cursor.south",
0687: JideIconsFactory
0688: .getImageIcon(JideIconsFactory.Cursor.SOUTH),
0689: "Cursor.east",
0690: JideIconsFactory
0691: .getImageIcon(JideIconsFactory.Cursor.EAST),
0692: "Cursor.west",
0693: JideIconsFactory
0694: .getImageIcon(JideIconsFactory.Cursor.WEST),
0695: "Cursor.tab",
0696: JideIconsFactory
0697: .getImageIcon(JideIconsFactory.Cursor.TAB),
0698: "Cursor.float",
0699: JideIconsFactory
0700: .getImageIcon(JideIconsFactory.Cursor.FLOAT),
0701: "Cursor.vertical",
0702: JideIconsFactory
0703: .getImageIcon(JideIconsFactory.Cursor.VERTICAL),
0704: "Cursor.horizontal",
0705: JideIconsFactory
0706: .getImageIcon(JideIconsFactory.Cursor.HORIZONTAL),
0707: "Cursor.delete",
0708: JideIconsFactory
0709: .getImageIcon(JideIconsFactory.Cursor.DELETE),
0710: "Cursor.drag",
0711: JideIconsFactory
0712: .getImageIcon(JideIconsFactory.Cursor.DROP),
0713: "Cursor.dragStop",
0714: JideIconsFactory
0715: .getImageIcon(JideIconsFactory.Cursor.NODROP),
0716: "Cursor.dragText",
0717: JideIconsFactory
0718: .getImageIcon(JideIconsFactory.Cursor.DROP_TEXT),
0719: "Cursor.dragTextStop",
0720: JideIconsFactory
0721: .getImageIcon(JideIconsFactory.Cursor.NODROP_TEXT),
0722:
0723: "Gripper.size", 8, "Gripper.foreground",
0724: gripperForeground, "Gripper.painter", gripperPainter,
0725:
0726: "Icon.floating", Boolean.FALSE,
0727:
0728: "Resizable.resizeBorder", resizeBorder,
0729:
0730: "TextArea.font", controlFont, };
0731: table.putDefaults(uiDefaults);
0732:
0733: int products = LookAndFeelFactory.getProductsUsed();
0734:
0735: if ((products & PRODUCT_DOCK) != 0) {
0736: ImageIcon titleButtonImage = IconsFactory.getImageIcon(
0737: XertoWindowsUtils.class,
0738: "icons/title_buttons_xerto.gif"); // 10 x 10 x 8
0739: final int titleButtonSize = 10;
0740:
0741: FrameBorder frameBorder = new FrameBorder();
0742:
0743: boolean useShadowBorder = "true".equals(SecurityUtils
0744: .getProperty("jide.shadeSlidingBorder", "false"));
0745:
0746: Object slidingEastFrameBorder = new ExtWindowsDesktopProperty(
0747: new String[] { "win.3d.lightColor",
0748: "win.3d.highlightColor",
0749: "win.3d.shadowColor",
0750: "win.3d.darkShadowColor" }, new Object[] {
0751: table.get("control"),
0752: table.get("controlLtHighlight"),
0753: table.get("controlShadow"),
0754: table.get("controlDkShadow") }, toolkit,
0755: new ConvertListener() {
0756: public Object convert(Object[] obj) {
0757: return new SlidingFrameBorder(
0758: (Color) obj[0],
0759: (Color) obj[1],
0760: (Color) obj[2],
0761: (Color) obj[3],
0762: new Insets(
0763: 1,
0764: SlidingFrameBorder.SHADOW_SIZE + 5,
0765: 1, 0));
0766: }
0767: });
0768:
0769: Object slidingWestFrameBorder = new ExtWindowsDesktopProperty(
0770: new String[] { "win.3d.lightColor",
0771: "win.3d.highlightColor",
0772: "win.3d.shadowColor",
0773: "win.3d.darkShadowColor" }, new Object[] {
0774: table.get("control"),
0775: table.get("controlLtHighlight"),
0776: table.get("controlShadow"),
0777: table.get("controlDkShadow") }, toolkit,
0778: new ConvertListener() {
0779: public Object convert(Object[] obj) {
0780: return new SlidingFrameBorder(
0781: (Color) obj[0],
0782: (Color) obj[1],
0783: (Color) obj[2],
0784: (Color) obj[3],
0785: new Insets(
0786: 1,
0787: 0,
0788: 1,
0789: SlidingFrameBorder.SHADOW_SIZE + 5));
0790: }
0791: });
0792:
0793: Object slidingNorthFrameBorder = new ExtWindowsDesktopProperty(
0794: new String[] { "win.3d.lightColor",
0795: "win.3d.highlightColor",
0796: "win.3d.shadowColor",
0797: "win.3d.darkShadowColor" }, new Object[] {
0798: table.get("control"),
0799: table.get("controlLtHighlight"),
0800: table.get("controlShadow"),
0801: table.get("controlDkShadow") }, toolkit,
0802: new ConvertListener() {
0803: public Object convert(Object[] obj) {
0804: return new SlidingFrameBorder(
0805: (Color) obj[0],
0806: (Color) obj[1],
0807: (Color) obj[2],
0808: (Color) obj[3],
0809: new Insets(
0810: 0,
0811: 1,
0812: SlidingFrameBorder.SHADOW_SIZE + 5,
0813: 1));
0814: }
0815: });
0816:
0817: Object slidingSouthFrameBorder = new ExtWindowsDesktopProperty(
0818: new String[] { "win.3d.lightColor",
0819: "win.3d.highlightColor",
0820: "win.3d.shadowColor",
0821: "win.3d.darkShadowColor" }, new Object[] {
0822: table.get("control"),
0823: table.get("controlLtHighlight"),
0824: table.get("controlShadow"),
0825: table.get("controlDkShadow") }, toolkit,
0826: new ConvertListener() {
0827: public Object convert(Object[] obj) {
0828: return new SlidingFrameBorder(
0829: (Color) obj[0],
0830: (Color) obj[1],
0831: (Color) obj[2],
0832: (Color) obj[3],
0833: new Insets(
0834: SlidingFrameBorder.SHADOW_SIZE + 5,
0835: 1, 0, 1));
0836: }
0837: });
0838:
0839: Object slidingEastFrameBorder2 = new ExtWindowsDesktopProperty(
0840: new String[] { "win.3d.lightColor",
0841: "win.3d.highlightColor",
0842: "win.3d.shadowColor",
0843: "win.3d.darkShadowColor" }, new Object[] {
0844: table.get("control"),
0845: table.get("controlLtHighlight"),
0846: table.get("controlShadow"),
0847: table.get("controlDkShadow") }, toolkit,
0848: new ConvertListener() {
0849: public Object convert(Object[] obj) {
0850: return new ResizeFrameBorder(
0851: (Color) obj[0], (Color) obj[1],
0852: (Color) obj[2], (Color) obj[3],
0853: new Insets(0, 4, 0, 0));
0854: }
0855: });
0856:
0857: Object slidingWestFrameBorder2 = new ExtWindowsDesktopProperty(
0858: new String[] { "win.3d.lightColor",
0859: "win.3d.highlightColor",
0860: "win.3d.shadowColor",
0861: "win.3d.darkShadowColor" }, new Object[] {
0862: table.get("control"),
0863: table.get("controlLtHighlight"),
0864: table.get("controlShadow"),
0865: table.get("controlDkShadow") }, toolkit,
0866: new ConvertListener() {
0867: public Object convert(Object[] obj) {
0868: return new ResizeFrameBorder(
0869: (Color) obj[0], (Color) obj[1],
0870: (Color) obj[2], (Color) obj[3],
0871: new Insets(0, 0, 0, 4));
0872: }
0873: });
0874:
0875: Object slidingNorthFrameBorder2 = new ExtWindowsDesktopProperty(
0876: new String[] { "win.3d.lightColor",
0877: "win.3d.highlightColor",
0878: "win.3d.shadowColor",
0879: "win.3d.darkShadowColor" }, new Object[] {
0880: table.get("control"),
0881: table.get("controlLtHighlight"),
0882: table.get("controlShadow"),
0883: table.get("controlDkShadow") }, toolkit,
0884: new ConvertListener() {
0885: public Object convert(Object[] obj) {
0886: return new ResizeFrameBorder(
0887: (Color) obj[0], (Color) obj[1],
0888: (Color) obj[2], (Color) obj[3],
0889: new Insets(0, 0, 4, 0));
0890: }
0891: });
0892:
0893: Object slidingSouthFrameBorder2 = new ExtWindowsDesktopProperty(
0894: new String[] { "win.3d.lightColor",
0895: "win.3d.highlightColor",
0896: "win.3d.shadowColor",
0897: "win.3d.darkShadowColor" }, new Object[] {
0898: table.get("control"),
0899: table.get("controlLtHighlight"),
0900: table.get("controlShadow"),
0901: table.get("controlDkShadow") }, toolkit,
0902: new ConvertListener() {
0903: public Object convert(Object[] obj) {
0904: return new ResizeFrameBorder(
0905: (Color) obj[0], (Color) obj[1],
0906: (Color) obj[2], (Color) obj[3],
0907: new Insets(4, 0, 0, 0));
0908: }
0909: });
0910:
0911: uiDefaults = new Object[] {
0912: // dock
0913: "Workspace.background",
0914: mdiBackgroundColor,
0915:
0916: "SidePane.margin",
0917: new InsetsUIResource(2, 2, 0, 0),
0918: "SidePane.iconTextGap",
0919: 2,
0920: "SidePane.textBorderGap",
0921: 13,
0922: "SidePane.itemGap",
0923: 5,
0924: "SidePane.groupGap",
0925: 13,
0926: "SidePane.foreground",
0927: defaultDarkShadowColor,
0928: "SidePane.background",
0929: new ColorUIResource(XertoUtils
0930: .getApplicationFrameBackgroundColor()),
0931: "SidePane.lineColor",
0932: defaultShadowColor,
0933: "SidePane.buttonBackground",
0934: new ColorUIResource(XertoUtils
0935: .getLightControlColor()),
0936: "SidePane.selectedButtonBackground",
0937: selectedButtonColor,
0938: "SidePane.selectedButtonForeground",
0939: defaultTextColor,
0940: "SidePane.font",
0941: controlFont,
0942: "SidePane.orientation",
0943: 1,
0944: "SidePane.showSelectedTabText",
0945: Boolean.TRUE,
0946: "SidePane.alwaysShowTabText",
0947: Boolean.FALSE,
0948:
0949: "DockableFrame.defaultIcon",
0950: JideIconsFactory
0951: .getImageIcon(JideIconsFactory.DockableFrame.BLANK),
0952: "DockableFrame.background",
0953: defaultBackgroundColor,
0954: "DockableFrame.border",
0955: frameBorder,
0956: "DockableFrame.floatingBorder",
0957: new BorderUIResource(BorderFactory
0958: .createLineBorder(XertoUtils
0959: .getFrameBorderColor())),
0960: "DockableFrame.slidingEastBorder",
0961: useShadowBorder ? slidingEastFrameBorder
0962: : slidingEastFrameBorder2,
0963: "DockableFrame.slidingWestBorder",
0964: useShadowBorder ? slidingWestFrameBorder
0965: : slidingWestFrameBorder2,
0966: "DockableFrame.slidingNorthBorder",
0967: useShadowBorder ? slidingNorthFrameBorder
0968: : slidingNorthFrameBorder2,
0969: "DockableFrame.slidingSouthBorder",
0970: useShadowBorder ? slidingSouthFrameBorder
0971: : slidingSouthFrameBorder2,
0972:
0973: "DockableFrame.activeTitleBackground",
0974: activeTitleBackgroundColor,
0975: "DockableFrame.activeTitleForeground",
0976: new ColorUIResource(Color.WHITE),
0977: "DockableFrame.inactiveTitleBackground",
0978: defaultBackgroundColor,
0979: "DockableFrame.inactiveTitleForeground",
0980: new ColorUIResource(Color.WHITE),
0981: "DockableFrame.titleBorder",
0982: new BorderUIResource(BorderFactory
0983: .createEmptyBorder(1, 0, 1, 0)),
0984: "DockableFrame.activeTitleBorderColor",
0985: activeTitleBackgroundColor,
0986: "DockableFrame.inactiveTitleBorderColor",
0987: defaultShadowColor,
0988: "DockableFrame.font",
0989: controlFont,
0990:
0991: "DockableFrameTitlePane.gripperPainter",
0992: gripperPainter,
0993: "DockableFrameTitlePane.font",
0994: controlFont,
0995: "DockableFrameTitlePane.hideIcon",
0996: IconsFactory.getIcon(null, titleButtonImage, 0, 0,
0997: titleButtonSize, titleButtonSize),
0998: "DockableFrameTitlePane.unfloatIcon",
0999: IconsFactory.getIcon(null, titleButtonImage, 0,
1000: titleButtonSize, titleButtonSize,
1001: titleButtonSize),
1002: "DockableFrameTitlePane.floatIcon",
1003: IconsFactory.getIcon(null, titleButtonImage, 0,
1004: 2 * titleButtonSize, titleButtonSize,
1005: titleButtonSize),
1006: "DockableFrameTitlePane.autohideIcon",
1007: IconsFactory.getIcon(null, titleButtonImage, 0,
1008: 3 * titleButtonSize, titleButtonSize,
1009: titleButtonSize),
1010: "DockableFrameTitlePane.stopAutohideIcon",
1011: IconsFactory.getIcon(null, titleButtonImage, 0,
1012: 4 * titleButtonSize, titleButtonSize,
1013: titleButtonSize),
1014: "DockableFrameTitlePane.hideAutohideIcon",
1015: IconsFactory.getIcon(null, titleButtonImage, 0,
1016: 5 * titleButtonSize, titleButtonSize,
1017: titleButtonSize),
1018: "DockableFrameTitlePane.maximizeIcon",
1019: IconsFactory.getIcon(null, titleButtonImage, 0,
1020: 6 * titleButtonSize, titleButtonSize,
1021: titleButtonSize),
1022: "DockableFrameTitlePane.restoreIcon",
1023: IconsFactory.getIcon(null, titleButtonImage, 0,
1024: 7 * titleButtonSize, titleButtonSize,
1025: titleButtonSize),
1026: "DockableFrameTitlePane.titleBarComponent",
1027: Boolean.FALSE,
1028:
1029: "DockableFrameTitlePane.alwaysShowAllButtons",
1030: Boolean.FALSE, // true if show all three buttons no matter if the buttons is available. false if only show buttons which is available
1031: "DockableFrameTitlePane.buttonsAlignment",
1032: SwingConstants.TRAILING, // trailing or leading
1033: "DockableFrameTitlePane.titleAlignment",
1034: SwingConstants.LEADING, // trailing or leading or center
1035: "DockableFrameTitlePane.buttonGap",
1036: 0, // gap between buttons
1037: "DockableFrameTitlePane.showIcon",
1038: Boolean.TRUE, // show icon or not, the alignment is the same as titleAlignment
1039: "DockableFrameTitlePane.margin",
1040: new InsetsUIResource(0, 3, 0, 3), // gap
1041:
1042: "Contour.color",
1043: new ColorUIResource(136, 136, 136),
1044: "Contour.thickness", 4,
1045:
1046: "ContentContainer.background",
1047: defaultFormBackground, "ContentContainer.vgap", 3,
1048: "ContentContainer.hgap", 3,
1049:
1050: "DockingFramework.changeCursor", Boolean.FALSE,
1051:
1052: "FrameContainer.contentBorderInsets",
1053: new InsetsUIResource(0, 0, 0, 0), };
1054: table.putDefaults(uiDefaults);
1055: }
1056:
1057: if ((products & PRODUCT_COMPONENTS) != 0) {
1058: final int SIZE = 12;
1059: final int MASK_SIZE = 12;
1060: ImageIcon collapsiblePaneImage = IconsFactory.getImageIcon(
1061: XertoWindowsUtils.class,
1062: "icons/collapsible_pane_xerto.png"); // 12 x 12
1063: ImageIcon collapsiblePaneMask = IconsFactory.getImageIcon(
1064: XertoWindowsUtils.class,
1065: "icons/collapsible_pane_mask.png"); // 12 x 12
1066: ImageIcon normalIcon = IconsFactory.getIcon(null,
1067: collapsiblePaneImage, 0, 0, SIZE, SIZE);
1068: ImageIcon emphasizedIcon = IconsFactory.getIcon(null,
1069: collapsiblePaneImage, SIZE, 0, SIZE, SIZE);
1070: ImageIcon upMark = IconsFactory.getIcon(null,
1071: collapsiblePaneMask, 0, 0, MASK_SIZE, MASK_SIZE);
1072: ImageIcon downMark = IconsFactory.getIcon(null,
1073: collapsiblePaneMask, 0, MASK_SIZE, MASK_SIZE,
1074: MASK_SIZE);
1075:
1076: ColorUIResource collapsiblePaneBackground = new ColorUIResource(
1077: 172, 168, 153);
1078:
1079: uiDefaults = new Object[] {
1080: // components
1081: "CollapsiblePanes.border",
1082: new BorderUIResource(BorderFactory
1083: .createEmptyBorder(12, 12, 0, 12)),
1084: "CollapsiblePanes.gap",
1085: 5,
1086:
1087: "CollapsiblePane.background",
1088: collapsiblePaneBackground,
1089: "CollapsiblePane.contentBackground",
1090: defaultLtHighlightColor,
1091: "CollapsiblePane.foreground",
1092: new ColorUIResource(XertoUtils
1093: .getTextColor(collapsiblePaneBackground)),
1094: "CollapsiblePane.emphasizedBackground",
1095: collapsiblePaneBackground,
1096: "CollapsiblePane.emphasizedForeground",
1097: new ColorUIResource(
1098: XertoUtils
1099: .getTextColor(XertoUtils
1100: .getEmBaseColor(collapsiblePaneBackground))),
1101: "CollapsiblePane.border",
1102: new BorderUIResource(BorderFactory
1103: .createEmptyBorder(0, 0, 0, 0)),
1104: // this is for metal
1105: // "CollapsiblePane.border", new BorderUIResource(BorderFactory.createLineBorder(new Color(172, 168, 153))),
1106:
1107: "CollapsiblePane.font",
1108: controlFont,
1109:
1110: "CollapsiblePane.contentBorder",
1111: new BorderUIResource(BorderFactory
1112: .createEmptyBorder(8, 10, 8, 10)),
1113:
1114: "CollapsiblePane.titleBorder",
1115: new BorderUIResource(BorderFactory
1116: .createEmptyBorder()),
1117: "CollapsiblePane.titleFont",
1118: boldFont,
1119:
1120: "CollapsiblePane.downIcon",
1121: IconsFactory.getOverlayIcon(null, normalIcon,
1122: downMark, SwingConstants.CENTER),
1123: "CollapsiblePane.upIcon",
1124: IconsFactory.getOverlayIcon(null, normalIcon,
1125: upMark, SwingConstants.CENTER),
1126: "CollapsiblePane.downIcon.emphasized",
1127: IconsFactory.getOverlayIcon(null, emphasizedIcon,
1128: downMark, SwingConstants.CENTER),
1129: "CollapsiblePane.upIcon.emphasized",
1130: IconsFactory.getOverlayIcon(null, emphasizedIcon,
1131: upMark, SwingConstants.CENTER),
1132: "CollapsiblePane.titleButtonBackground",
1133: normalIcon,
1134: "CollapsiblePane.titleButtonBackground.emphasized",
1135: emphasizedIcon,
1136:
1137: "StatusBarItem.border",
1138: new BorderUIResource(BorderFactory
1139: .createEmptyBorder(0, 1, 0, 1)),
1140:
1141: "StatusBar.border",
1142: new StatusBarBorder(),
1143: "StatusBar.gap",
1144: 2,
1145: "StatusBar.background",
1146: defaultBackgroundColor,
1147: "StatusBar.font",
1148: controlFont,
1149:
1150: "DocumentPane.groupBorder",
1151: new BorderUIResource(BorderFactory
1152: .createLineBorder(Color.gray)),
1153: "DocumentPane.newHorizontalGroupIcon",
1154: JideIconsFactory
1155: .getImageIcon(JideIconsFactory.WindowMenu.NEW_HORIZONTAL_TAB),
1156: "DocumentPane.newVerticalGroupIcon",
1157: JideIconsFactory
1158: .getImageIcon(JideIconsFactory.WindowMenu.NEW_VERTICAL_TAB),
1159: "DocumentPane.boldActiveTab", Boolean.FALSE, };
1160: table.putDefaults(uiDefaults);
1161: }
1162:
1163: if ((products & PRODUCT_ACTION) != 0) {
1164: uiDefaults = new Object[] {
1165: // action
1166: "CommandBar.font",
1167: toolbarFont,
1168: "CommandBar.background",
1169: commandBarBackground,
1170: "CommandBar.foreground",
1171: defaultTextColor,
1172: "CommandBar.shadow",
1173: defaultShadowColor,
1174: "CommandBar.darkShadow",
1175: defaultDarkShadowColor,
1176: "CommandBar.light",
1177: defaultHighlightColor,
1178: "CommandBar.highlight",
1179: defaultLtHighlightColor,
1180: "CommandBar.border",
1181: new BorderUIResource(BorderFactory
1182: .createEmptyBorder(1, 1, 1, 1)),
1183: "CommandBar.borderVert",
1184: new BorderUIResource(BorderFactory
1185: .createEmptyBorder(1, 1, 1, 1)),
1186: "CommandBar.borderFloating",
1187: new BorderUIResource(BorderFactory
1188: .createCompoundBorder(BorderFactory
1189: .createLineBorder(table
1190: .getColor("activeCaption"),
1191: 2), BorderFactory
1192: .createEmptyBorder(1, 1, 1, 1))),
1193: "CommandBar.ancestorInputMap",
1194: new UIDefaults.LazyInputMap(new Object[] { "UP",
1195: "navigateUp", "KP_UP", "navigateUp",
1196: "DOWN", "navigateDown", "KP_DOWN",
1197: "navigateDown", "LEFT", "navigateLeft",
1198: "KP_LEFT", "navigateLeft", "RIGHT",
1199: "navigateRight", "KP_RIGHT",
1200: "navigateRight" }),
1201: "CommandBar.titleBarSize", 17,
1202: "CommandBar.titleBarButtonGap", 1,
1203: "CommandBar.titleBarBackground",
1204: activeTitleBackgroundColor,
1205: "CommandBar.titleBarForeground",
1206: activeTitleTextColor, "CommandBar.titleBarFont",
1207: boldFont,
1208:
1209: "CommandBar.separatorSize",
1210: 5,
1211:
1212: // *** Separator
1213: "CommandBarSeparator.background",
1214: XertoUtils.getControlColor(),
1215: "CommandBarSeparator.foreground",
1216: XertoUtils.getControlMidShadowColor(),
1217:
1218: "Chevron.size", 11, };
1219: table.putDefaults(uiDefaults);
1220: }
1221:
1222: if ((products & PRODUCT_DOCK) != 0) {
1223: uiDefaults = new Object[] {
1224: // grid
1225: "NestedTableHeader.cellBorder",
1226: new HeaderCellBorder(), };
1227: table.putDefaults(uiDefaults);
1228: }
1229:
1230: if (!JideSwingUtilities.shouldUseSystemFont()) {
1231: Object uiDefaultsFont[] = { "TabbedPane.font", controlFont,
1232: "TitledBorder.font", boldFont, "TableHeader.font",
1233: controlFont, "Table.font", controlFont,
1234: "List.font", controlFont, "Tree.font", controlFont,
1235: "ToolTip.font", controlFont, "CheckBox.font",
1236: controlFont, "RadioButton.font", controlFont,
1237: "Label.font", controlFont, "Panel.font",
1238: controlFont, "TextField.font", controlFont,
1239: "ComboBox.font", controlFont, "Button.font",
1240: controlFont };
1241: table.putDefaults(uiDefaultsFont);
1242: }
1243:
1244: table.put("Theme.painter", XertoPainter.getInstance());
1245:
1246: // since it used BasicPainter, make sure it is after Theme.Painter is set first.
1247: Object popupMenuBorder = new ExtWindowsDesktopProperty(
1248: new String[] { "null" },
1249: new Object[] { ((BasicPainter) table
1250: .get("Theme.painter")).getMenuItemBorderColor() },
1251: toolkit, new ConvertListener() {
1252: public Object convert(Object[] obj) {
1253: return new BorderUIResource(
1254: BorderFactory
1255: .createCompoundBorder(
1256: BorderFactory
1257: .createLineBorder((Color) obj[0]),
1258: BorderFactory
1259: .createEmptyBorder(
1260: 1, 1,
1261: 1, 1)));
1262: }
1263: });
1264: table.put("PopupMenu.border", popupMenuBorder);
1265: }
1266: }
|