* @param table
*/
public static void initComponentDefaults(UIDefaults table) {
Toolkit toolkit = Toolkit.getDefaultToolkit();
WindowsDesktopProperty defaultTextColor = new WindowsDesktopProperty("win.button.textColor", UIDefaultsLookup.get("controlText"), toolkit);
WindowsDesktopProperty defaultBackgroundColor = new WindowsDesktopProperty("win.3d.backgroundColor", UIDefaultsLookup.get("control"), toolkit);
WindowsDesktopProperty defaultLightColor = new WindowsDesktopProperty("win.3d.lightColor", UIDefaultsLookup.get("controlHighlight"), toolkit);
WindowsDesktopProperty defaultHighlightColor = new WindowsDesktopProperty("win.3d.highlightColor", UIDefaultsLookup.get("controlLtHighlight"), toolkit);
WindowsDesktopProperty defaultShadowColor = new WindowsDesktopProperty("win.3d.shadowColor", UIDefaultsLookup.get("controlShadow"), toolkit);
WindowsDesktopProperty defaultDarkShadowColor = new WindowsDesktopProperty("win.3d.darkShadowColor", UIDefaultsLookup.get("controlDkShadow"), toolkit);
Object toolbarFont = JideSwingUtilities.getMenuFont(toolkit, table);
Object boldFont = JideSwingUtilities.getBoldFont(toolkit, table);
Painter gripperPainter = new Painter() {
public void paint(JComponent c, Graphics g, Rectangle rect, int orientation, int state) {
Object p = UIDefaultsLookup.get("Theme.painter");
if (p instanceof ThemePainter) {
((ThemePainter) p).paintGripper(c, g, rect, orientation, state);
}
else {
Office2003Painter.getInstance().paintGripper(c, g, rect, orientation, state);
}
}
};
Object uiDefaults[] = new Object[]{
"JideTabbedPane.defaultTabShape", JideTabbedPane.SHAPE_OFFICE2003,
"JideTabbedPane.defaultTabColorTheme", JideTabbedPane.COLOR_THEME_OFFICE2003,
"JideTabbedPane.contentBorderInsets", new InsetsUIResource(3, 3, 3, 3),
"JideTabbedPane.gripperPainter", gripperPainter,
"JideTabbedPane.alwaysShowLineBorder", Boolean.FALSE,
"JideTabbedPane.showFocusIndicator", Boolean.TRUE,
"JideSplitPaneDivider.gripperPainter", gripperPainter,
"Gripper.size", 8,
"Gripper.painter", gripperPainter,
"Icon.floating", Boolean.FALSE,
"JideScrollPane.border", UIDefaultsLookup.getBorder("ScrollPane.border"),
"Menu.margin", new InsetsUIResource(2, 7, 3, 7),
"Menu.submenuPopupOffsetX", 1,
"Menu.submenuPopupOffsetY", 0,
"MenuBar.border", new BorderUIResource(BorderFactory.createEmptyBorder(1, 2, 1, 2)),
"PopupMenu.background", new UIDefaults.ActiveValue() {
public Object createValue(UIDefaults table) {
return Office2003Painter.getInstance().getMenuItemBackground();
}
},
};
table.putDefaults(uiDefaults);
int products = LookAndFeelFactory.getProductsUsed();
if ((products & PRODUCT_DOCK) != 0) {
boolean useShadowBorder = "true".equals(SecurityUtils.getProperty("jide.shadeSlidingBorder", "false"));
Object slidingEastFrameBorder = new ExtWindowsDesktopProperty(new String[]{"win.3d.lightColor", "win.3d.highlightColor", "win.3d.shadowColor", "win.3d.darkShadowColor"},
new Object[]{UIDefaultsLookup.get("control"), UIDefaultsLookup.get("controlLtHighlight"), UIDefaultsLookup.get("controlShadow"), UIDefaultsLookup.get("controlDkShadow")}, toolkit, new ConvertListener() {
public Object convert(Object[] obj) {
return new SlidingFrameBorder((Color) obj[0], (Color) obj[1], (Color) obj[2], (Color) obj[3],
new Insets(1, SlidingFrameBorder.SHADOW_SIZE + 5, 1, 1));
}
});
Object slidingWestFrameBorder = new ExtWindowsDesktopProperty(new String[]{"win.3d.lightColor", "win.3d.highlightColor", "win.3d.shadowColor", "win.3d.darkShadowColor"},
new Object[]{UIDefaultsLookup.get("control"), UIDefaultsLookup.get("controlLtHighlight"), UIDefaultsLookup.get("controlShadow"), UIDefaultsLookup.get("controlDkShadow")}, toolkit, new ConvertListener() {
public Object convert(Object[] obj) {
return new SlidingFrameBorder((Color) obj[0], (Color) obj[1], (Color) obj[2], (Color) obj[3],
new Insets(1, 1, 1, SlidingFrameBorder.SHADOW_SIZE + 5));
}
});
Object slidingNorthFrameBorder = new ExtWindowsDesktopProperty(new String[]{"win.3d.lightColor", "win.3d.highlightColor", "win.3d.shadowColor", "win.3d.darkShadowColor"},
new Object[]{UIDefaultsLookup.get("control"), UIDefaultsLookup.get("controlLtHighlight"), UIDefaultsLookup.get("controlShadow"), UIDefaultsLookup.get("controlDkShadow")}, toolkit, new ConvertListener() {
public Object convert(Object[] obj) {
return new SlidingFrameBorder((Color) obj[0], (Color) obj[1], (Color) obj[2], (Color) obj[3],
new Insets(1, 1, SlidingFrameBorder.SHADOW_SIZE + 5, 1));
}
});
Object slidingSouthFrameBorder = new ExtWindowsDesktopProperty(new String[]{"win.3d.lightColor", "win.3d.highlightColor", "win.3d.shadowColor", "win.3d.darkShadowColor"},
new Object[]{UIDefaultsLookup.get("control"), UIDefaultsLookup.get("controlLtHighlight"), UIDefaultsLookup.get("controlShadow"), UIDefaultsLookup.get("controlDkShadow")}, toolkit, new ConvertListener() {
public Object convert(Object[] obj) {
return new SlidingFrameBorder((Color) obj[0], (Color) obj[1], (Color) obj[2], (Color) obj[3],
new Insets(SlidingFrameBorder.SHADOW_SIZE + 5, 1, 1, 1));
}
});
Object slidingEastFrameBorder2 = new ExtWindowsDesktopProperty(new String[]{"win.3d.lightColor", "win.3d.highlightColor", "win.3d.shadowColor", "win.3d.darkShadowColor"},
new Object[]{UIDefaultsLookup.get("control"), UIDefaultsLookup.get("controlLtHighlight"), UIDefaultsLookup.get("controlShadow"), UIDefaultsLookup.get("controlDkShadow")}, toolkit, new ConvertListener() {
public Object convert(Object[] obj) {
return new ResizeFrameBorder((Color) obj[0], (Color) obj[1], (Color) obj[2], (Color) obj[3],
new Insets(0, 4, 0, 0));
}
});
Object slidingWestFrameBorder2 = new ExtWindowsDesktopProperty(new String[]{"win.3d.lightColor", "win.3d.highlightColor", "win.3d.shadowColor", "win.3d.darkShadowColor"},
new Object[]{UIDefaultsLookup.get("control"), UIDefaultsLookup.get("controlLtHighlight"), UIDefaultsLookup.get("controlShadow"), UIDefaultsLookup.get("controlDkShadow")}, toolkit, new ConvertListener() {
public Object convert(Object[] obj) {
return new ResizeFrameBorder((Color) obj[0], (Color) obj[1], (Color) obj[2], (Color) obj[3],
new Insets(0, 0, 0, 4));
}
});
Object slidingNorthFrameBorder2 = new ExtWindowsDesktopProperty(new String[]{"win.3d.lightColor", "win.3d.highlightColor", "win.3d.shadowColor", "win.3d.darkShadowColor"},
new Object[]{UIDefaultsLookup.get("control"), UIDefaultsLookup.get("controlLtHighlight"), UIDefaultsLookup.get("controlShadow"), UIDefaultsLookup.get("controlDkShadow")}, toolkit, new ConvertListener() {
public Object convert(Object[] obj) {
return new ResizeFrameBorder((Color) obj[0], (Color) obj[1], (Color) obj[2], (Color) obj[3],
new Insets(0, 0, 4, 0));
}
});
Object slidingSouthFrameBorder2 = new ExtWindowsDesktopProperty(new String[]{"win.3d.lightColor", "win.3d.highlightColor", "win.3d.shadowColor", "win.3d.darkShadowColor"},
new Object[]{UIDefaultsLookup.get("control"), UIDefaultsLookup.get("controlLtHighlight"), UIDefaultsLookup.get("controlShadow"), UIDefaultsLookup.get("controlDkShadow")}, toolkit, new ConvertListener() {
public Object convert(Object[] obj) {
return new ResizeFrameBorder((Color) obj[0], (Color) obj[1], (Color) obj[2], (Color) obj[3],
new Insets(4, 0, 0, 0));
}
});
uiDefaults = new Object[]{
// dock
"SidePane.foreground", defaultTextColor,
"SidePane.lineColor", new UIDefaults.ActiveValue() {
public Object createValue(UIDefaults table) {
return Office2003Painter.getInstance().getControlShadow();
}
},
"StatusBarItem.border", new BorderUIResource(BorderFactory.createEmptyBorder(0, 1, 0, 1)),
"StatusBar.border", new StatusBarBorder(),
"DockableFrame.titleBorder", new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0)),
"DockableFrameTitlePane.use3dButtons", Boolean.FALSE,
"DockableFrameTitlePane.gripperPainter", gripperPainter,
"DockableFrameTitlePane.margin", new InsetsUIResource(1, 6, 1, 6), // gap
"DockableFrameTitlePane.contentFilledButtons", true,
"DockableFrame.activeTitleForeground", UIDefaultsLookup.getColor("DockableFrame.inactiveTitleForeground"),
"DockableFrame.slidingEastBorder", useShadowBorder ? slidingEastFrameBorder : slidingEastFrameBorder2,
"DockableFrame.slidingWestBorder", useShadowBorder ? slidingWestFrameBorder : slidingWestFrameBorder2,
"DockableFrame.slidingNorthBorder", useShadowBorder ? slidingNorthFrameBorder : slidingNorthFrameBorder2,
"DockableFrame.slidingSouthBorder", useShadowBorder ? slidingSouthFrameBorder : slidingSouthFrameBorder2,
"FrameContainer.contentBorderInsets", new InsetsUIResource(3, 3, 3, 3),
};
table.putDefaults(uiDefaults);
}
if ((products & PRODUCT_ACTION) != 0) {
Object floatingBorder = new ExtWindowsDesktopProperty(new String[]{"win.3d.titleBarColor"},
new Object[]{UIDefaultsLookup.get("controlShadow")}, toolkit, new ConvertListener() {
public Object convert(Object[] obj) {
return new BorderUIResource(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder((Color) obj[0], 2),
BorderFactory.createEmptyBorder(1, 1, 1, 1)));
}
});
WindowsDesktopProperty activeTitleTextColor = new WindowsDesktopProperty("win.frame.captionTextColor", UIDefaultsLookup.get("activeCaptionText"), toolkit);
WindowsDesktopProperty activeTitleBackgroundColor = new WindowsDesktopProperty("win.frame.activeCaptionColor", UIDefaultsLookup.get("activeCaption"), toolkit);
uiDefaults = new Object[]{
// action
"CommandBar.font", toolbarFont,
"CommandBar.background", defaultBackgroundColor,