| 1 |
/* |
| 2 |
* @(#)VsnetWindowsUtils.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.icons.MenuCheckIcon; |
| 11 |
import com.jidesoft.plaf.ExtWindowsDesktopProperty; |
| 12 |
import com.jidesoft.plaf.LookAndFeelFactory; |
| 13 |
import com.jidesoft.plaf.UIDefaultsLookup; |
| 14 |
import com.jidesoft.plaf.WindowsDesktopProperty; |
| 15 |
import com.jidesoft.plaf.basic.BasicPainter; |
| 16 |
import com.jidesoft.plaf.basic.Painter; |
| 17 |
import com.jidesoft.plaf.basic.ThemePainter; |
| 18 |
import com.jidesoft.plaf.windows.WindowsIconFactory; |
| 19 |
import com.jidesoft.swing.JideButton; |
| 20 |
import com.jidesoft.swing.JideSwingUtilities; |
| 21 |
import com.jidesoft.swing.JideTabbedPane; |
| 22 |
|
| 23 |
import javax.swing.*; |
| 24 |
import javax.swing.plaf.BorderUIResource; |
| 25 |
import javax.swing.plaf.ColorUIResource; |
| 26 |
import javax.swing.plaf.DimensionUIResource; |
| 27 |
import javax.swing.plaf.InsetsUIResource; |
| 28 |
import javax.swing.plaf.basic.BasicBorders; |
| 29 |
import java.awt.*; |
| 30 |
import java.beans.Beans; |
| 31 |
|
| 32 |
/** |
| 33 |
* Initialize the uiClassID to BasicComponentUI mapping for JIDE components using Vsnet style for WindowsLookAndFeel. |
| 34 |
*/ |
| 35 |
public class VsnetWindowsUtils extends VsnetLookAndFeelExtension { |
| 36 |
|
| 37 |
/** |
| 38 |
* Initializes class defaults with menu components UIDefaults. |
| 39 |
* |
| 40 |
* @param table UIDefaults table |
| 41 |
*/ |
| 42 |
public static void initClassDefaultsWithMenu(UIDefaults table) { |
| 43 |
VsnetLookAndFeelExtension.initClassDefaultsWithMenu(table); |
| 44 |
initClassDefaults(table); |
| 45 |
} |
| 46 |
|
| 47 |
/** |
| 48 |
* Initializes class defaults. |
| 49 |
* |
| 50 |
* @param table UIDefaults table |
| 51 |
*/ |
| 52 |
public static void initClassDefaults(UIDefaults table) { |
| 53 |
VsnetLookAndFeelExtension.initClassDefaults(table); |
| 54 |
|
| 55 |
final String windowsPackageName = "com.jidesoft.plaf.windows."; |
| 56 |
|
| 57 |
// common |
| 58 |
table.put("JidePopupMenuUI", windowsPackageName + "WindowsJidePopupMenuUI"); |
| 59 |
table.put("RangeSliderUI", windowsPackageName + "WindowsRangeSliderUI"); |
| 60 |
|
| 61 |
int products = LookAndFeelFactory.getProductsUsed(); |
| 62 |
|
| 63 |
if ((products & PRODUCT_GRIDS) != 0) { |
| 64 |
// grids |
| 65 |
table.put("CellStyleTableHeaderUI", windowsPackageName + "WindowsCellStyleTableHeaderUI"); |
| 66 |
table.put("SortableTableHeaderUI", windowsPackageName + "WindowsSortableTableHeaderUI"); |
| 67 |
table.put("NestedTableHeaderUI", windowsPackageName + "WindowsNestedTableHeaderUI"); |
| 68 |
table.put("EditableTableHeaderUI", windowsPackageName + "WindowsEditableTableHeaderUI"); |
| 69 |
table.put("AutoFilterTableHeaderUI", windowsPackageName + "WindowsAutoFilterTableHeaderUI"); |
| 70 |
table.put("GroupTableHeaderUI", windowsPackageName + "WindowsGroupTableHeaderUI"); |
| 71 |
table.put("ExComboBoxUI", windowsPackageName + "WindowsExComboBoxUI"); |
| 72 |
} |
| 73 |
} |
| 74 |
|
| 75 |
/** |
| 76 |
* Initializes components defaults. |
| 77 |
* |
| 78 |
* @param table UIDefaults table |
| 79 |
*/ |
| 80 |
public static void initComponentDefaults(UIDefaults table) { |
| 81 |
Toolkit toolkit = Toolkit.getDefaultToolkit(); |
| 82 |
|
| 83 |
WindowsDesktopProperty defaultTextColor = new WindowsDesktopProperty("win.button.textColor", UIDefaultsLookup.get("controlText"), toolkit); |
| 84 |
WindowsDesktopProperty defaultBackgroundColor = new WindowsDesktopProperty("win.3d.backgroundColor", UIDefaultsLookup.get("control"), toolkit); |
| 85 |
WindowsDesktopProperty defaultHighlightColor = new WindowsDesktopProperty("win.3d.lightColor", UIDefaultsLookup.get("controlHighlight"), toolkit); |
| 86 |
WindowsDesktopProperty defaultLtHighlightColor = new WindowsDesktopProperty("win.3d.highlightColor", UIDefaultsLookup.get("controlLtHighlight"), toolkit); |
| 87 |
WindowsDesktopProperty defaultShadowColor = new WindowsDesktopProperty("win.3d.shadowColor", UIDefaultsLookup.get("controlShadow"), toolkit); |
| 88 |
WindowsDesktopProperty defaultDarkShadowColor = new WindowsDesktopProperty("win.3d.darkShadowColor", UIDefaultsLookup.get("controlDkShadow"), toolkit); |
| 89 |
WindowsDesktopProperty activeTitleTextColor = new WindowsDesktopProperty("win.frame.captionTextColor", UIDefaultsLookup.get("activeCaptionText"), toolkit); |
| 90 |
WindowsDesktopProperty activeTitleBackgroundColor = new WindowsDesktopProperty("win.frame.activeCaptionColor", UIDefaultsLookup.get("activeCaption"), toolkit); |
| 91 |
WindowsDesktopProperty mdiBackgroundColor = new WindowsDesktopProperty("win.mdi.backgroundColor", UIDefaultsLookup.get("controlShadow"), toolkit); |
| 92 |
|
| 93 |
WindowsDesktopProperty menuTextColor = new WindowsDesktopProperty("win.menu.textColor", UIDefaultsLookup.get("control"), toolkit); |
| 94 |
|
| 95 |
WindowsDesktopProperty highContrast = new WindowsDesktopProperty("win.highContrast.on", UIDefaultsLookup.get("highContrast"), toolkit); |
| 96 |
|
| 97 |
Object controlFont = JideSwingUtilities.getControlFont(toolkit, table); |
| 98 |
Object toolbarFont = JideSwingUtilities.getMenuFont(toolkit, table); |
| 99 |
Object boldFont = JideSwingUtilities.getBoldFont(toolkit, table); |
| 100 |
|
| 101 |
Object resizeBorder = new ExtWindowsDesktopProperty(new String[]{"win.3d.lightColor", "win.3d.highlightColor", "win.3d.shadowColor", "win.3d.darkShadowColor"}, |
| 102 |
new Object[]{UIDefaultsLookup.get("control"), UIDefaultsLookup.get("controlLtHighlight"), UIDefaultsLookup.get("controlShadow"), UIDefaultsLookup.get("controlDkShadow")}, toolkit, new ConvertListener() { |
| 103 |
public Object convert(Object[] obj) { |
| 104 |
return new ResizeFrameBorder((Color) obj[0], (Color) obj[1], (Color) obj[2], (Color) obj[3], |
| 105 |
new Insets(4, 4, 4, 4)); |
| 106 |
} |
| 107 |
}); |
| 108 |
|
| 109 |
Object defaultFormBackground = new ExtWindowsDesktopProperty(new String[]{"win.3d.backgroundColor"}, new Object[]{UIDefaultsLookup.get("control")}, toolkit, new ConvertListener() { |
| 110 |
public Object convert(Object[] obj) { |
| 111 |
return VsnetUtils.getDefaultBackgroundColor((Color) obj[0]); |
| 112 |
} |
| 113 |
}); |
| 114 |
|
| 115 |
Object focusedButtonColor = new ExtWindowsDesktopProperty(new String[]{"win.item.highlightColor"}, new Object[]{UIDefaultsLookup.get("textHighlight")}, toolkit, new ConvertListener() { |
| 116 |
public Object convert(Object[] obj) { |
| 117 |
return new ColorUIResource(VsnetUtils.getRolloverButtonColor((Color) obj[0])); |
| 118 |
} |
| 119 |
}); |
| 120 |
|
| 121 |
Object selectedAndFocusedButtonColor = new ExtWindowsDesktopProperty(new String[]{"win.item.highlightColor"}, new Object[]{UIDefaultsLookup.get("textHighlight")}, toolkit, new ConvertListener() { |
| 122 |
public Object convert(Object[] obj) { |
| 123 |
return new ColorUIResource(VsnetUtils.getSelectedAndRolloverButtonColor((Color) obj[0])); |
| 124 |
} |
| 125 |
}); |
| 126 |
|
| 127 |
Object selectedButtonColor = new ExtWindowsDesktopProperty(new String[]{"win.item.highlightColor"}, new Object[]{UIDefaultsLookup.get("textHighlight")}, toolkit, new ConvertListener() { |
| 128 |
public Object convert(Object[] obj) { |
| 129 |
return new ColorUIResource(VsnetUtils.getSelectedButtonColor((Color) obj[0])); |
| 130 |
} |
| 131 |
}); |
| 132 |
|
| 133 |
Object singleLineBorder = new ExtWindowsDesktopProperty(new String[]{"win.3d.shadowColor"}, new Object[]{UIDefaultsLookup.get("controlShadow")}, toolkit, new ConvertListener() { |
| 134 |
public Object convert(Object[] obj) { |
| 135 |
return new BorderUIResource(BorderFactory.createLineBorder((Color) obj[0])); |
| 136 |
} |
| 137 |
}); |
| 138 |
|
| 139 |
Object borderColor = new ExtWindowsDesktopProperty(new String[]{"win.item.highlightColor"}, new Object[]{UIDefaultsLookup.get("controlShadow")}, toolkit, new ConvertListener() { |
| 140 |
public Object convert(Object[] obj) { |
| 141 |
return new ColorUIResource(VsnetUtils.getButtonBorderColor((Color) obj[0])); |
| 142 |
} |
| 143 |
}); |
| 144 |
|
| 145 |
Object gripperForeground = new ExtWindowsDesktopProperty(new String[]{"win.3d.backgroundColor"}, new Object[]{UIDefaultsLookup.get("control")}, toolkit, new ConvertListener() { |
| 146 |
public Object convert(Object[] obj) { |
| 147 |
return new ColorUIResource(VsnetUtils.getGripperForegroundColor((Color) obj[0])); |
| 148 |
} |
| 149 |
}); |
| 150 |
|
| 151 |
Painter gripperPainter = new Painter() { |
| 152 |
public void paint(JComponent c, Graphics g, Rectangle rect, int orientation, int state) { |
| 153 |
Object p = UIDefaultsLookup.get("Theme.painter"); |
| 154 |
if (p instanceof ThemePainter) { |
| 155 |
((ThemePainter) p).paintGripper(c, g, rect, orientation, state); |
| 156 |
} |
| 157 |
else { |
| 158 |
BasicPainter.getInstance().paintGripper(c, g, rect, orientation, state); |
| 159 |
} |
| 160 |
} |
| 161 |
}; |
| 162 |
|
| 163 |
Object buttonBorder = new BasicBorders.MarginBorder(); |
| 164 |
|
| 165 |
Object uiDefaults[] = new Object[]{ |
| 166 |
// common |
| 167 |
"Theme.highContrast", highContrast, |
| 168 |
"Content.background", defaultBackgroundColor, |
| 169 |
|
| 170 |
"JideLabel.font", controlFont, |
| 171 |
"JideLabel.background", defaultBackgroundColor, |
| 172 |
"JideLabel.foreground", defaultTextColor, |
| 173 |
|
| 174 |
"JideButton.selectedAndFocusedBackground", selectedAndFocusedButtonColor, |
| 175 |
"JideButton.focusedBackground", focusedButtonColor, |
| 176 |
"JideButton.selectedBackground", selectedButtonColor, |
| 177 |
"JideButton.borderColor", borderColor, |
| 178 |
|
| 179 |
"JideButton.font", controlFont, |
| 180 |
"JideButton.background", defaultBackgroundColor, |
| 181 |
"JideButton.foreground", defaultTextColor, |
| 182 |
"JideButton.shadow", defaultShadowColor, |
| 183 |
"JideButton.darkShadow", defaultDarkShadowColor, |
| 184 |
"JideButton.light", defaultHighlightColor, |
| 185 |
"JideButton.highlight", defaultLtHighlightColor, |
| 186 |
"JideButton.border", buttonBorder, |
| 187 |
"JideButton.margin", new InsetsUIResource(3, 3, 3, 3), |
| 188 |
"JideButton.textIconGap", 4, |
| 189 |
"JideButton.textShiftOffset", 0, |
| 190 |
"JideButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[]{ |
| 191 |
"SPACE", "pressed", |
| 192 |
"released SPACE", "released", |
| 193 |
"ENTER", "pressed", |
| 194 |
"released ENTER", "released" |
| 195 |
}), |
| 196 |
|
| 197 |
"TristateCheckBox.icon", WindowsIconFactory.getCheckBoxIcon(), |
| 198 |
|
| 199 |
"JideSplitPane.dividerSize", 4, |
| 200 |
"JideSplitPaneDivider.border", new BorderUIResource(BorderFactory.createEmptyBorder()), |
| 201 |
"JideSplitPaneDivider.background", defaultBackgroundColor, |
| 202 |
"JideSplitPaneDivider.gripperPainter", gripperPainter, |
| 203 |
|
| 204 |
"JideTabbedPane.defaultTabShape", JideTabbedPane.SHAPE_VSNET, |
| 205 |
"JideTabbedPane.defaultResizeMode", JideTabbedPane.RESIZE_MODE_NONE, |
| 206 |
"JideTabbedPane.defaultTabColorTheme", JideTabbedPane.COLOR_THEME_VSNET, |
| 207 |
|
| 208 |
"JideTabbedPane.tabRectPadding", 2, |
| 209 |
"JideTabbedPane.closeButtonMarginHorizonal", 3, |
| 210 |
"JideTabbedPane.closeButtonMarginVertical", 3, |
| 211 |
"JideTabbedPane.textMarginVertical", 4, |
| 212 |
"JideTabbedPane.noIconMargin", 2, |
| 213 |
"JideTabbedPane.iconMargin", 5, |
| 214 |
"JideTabbedPane.textPadding", 6, |
| 215 |
"JideTabbedPane.buttonSize", 18, |
| 216 |
"JideTabbedPane.buttonMargin", 5, |
| 217 |
"JideTabbedPane.fitStyleBoundSize", 8, |
| 218 |
"JideTabbedPane.fitStyleFirstTabMargin", 4, |
| 219 |
"JideTabbedPane.fitStyleIconMinWidth", 24, |
| 220 |
"JideTabbedPane.fitStyleTextMinWidth", 16, |
| 221 |
"JideTabbedPane.compressedStyleNoIconRectSize", 24, |
| 222 |
"JideTabbedPane.compressedStyleIconMargin", 12, |
| 223 |
"JideTabbedPane.compressedStyleCloseButtonMarginHorizontal", 0, |
| 224 |
"JideTabbedPane.compressedStyleCloseButtonMarginVertical", 0, |
| 225 |
"JideTabbedPane.fixedStyleRectSize", 60, |
| 226 |
"JideTabbedPane.closeButtonMargin", 2, |
| 227 |
"JideTabbedPane.gripLeftMargin", 4, |
| 228 |
"JideTabbedPane.closeButtonMarginSize", 6, |
| 229 |
"JideTabbedPane.closeButtonLeftMargin", 2, |
| 230 |
"JideTabbedPane.closeButtonRightMargin", 2, |
| 231 |
|
| 232 |
"JideTabbedPane.defaultTabBorderShadowColor", new ColorUIResource(115, 109, 99), |
| 233 |
|
| 234 |
"JideTabbedPane.gripperPainter", gripperPainter, |
| 235 |
"JideTabbedPane.border", new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0)), |
| 236 |
"JideTabbedPane.background", defaultFormBackground, |
| 237 |
"JideTabbedPane.foreground", defaultTextColor, |
| 238 |
"JideTabbedPane.light", Color.BLACK.equals(defaultBackgroundColor.createValue(table)) ? defaultBackgroundColor : defaultHighlightColor, |
| 239 |
"JideTabbedPane.highlight", defaultLtHighlightColor, |
| 240 |
"JideTabbedPane.shadow", defaultShadowColor, |
| 241 |
"JideTabbedPane.darkShadow", defaultTextColor, |
| 242 |
"JideTabbedPane.tabInsets", new InsetsUIResource(1, 4, 1, 4), |
| 243 |
"JideTabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 2, 2), |
| 244 |
"JideTabbedPane.ignoreContentBorderInsetsIfNoTabs", Boolean.FALSE, |
| 245 |
"JideTabbedPane.tabAreaInsets", new InsetsUIResource(2, 4, 0, 4), |
| 246 |
"JideTabbedPane.tabAreaBackground", defaultFormBackground, |
| 247 |
"JideTabbedPane.tabAreaBackgroundLt", defaultLtHighlightColor, |
| 248 |
"JideTabbedPane.tabAreaBackgroundDk", defaultBackgroundColor, |
| 249 |
"JideTabbedPane.tabRunOverlay", 2, |
| 250 |
"JideTabbedPane.font", controlFont, |
| 251 |
"JideTabbedPane.selectedTabFont", controlFont, |
| 252 |
"JideTabbedPane.selectedTabTextForeground", defaultTextColor, |
| 253 |
"JideTabbedPane.unselectedTabTextForeground", defaultTextColor, |
| 254 |
"JideTabbedPane.selectedTabBackground", defaultBackgroundColor, |
| 255 |
"JideTabbedPane.selectedTabBackgroundLt", new ColorUIResource(230, 139, 44), |
| 256 |
"JideTabbedPane.selectedTabBackgroundDk", new ColorUIResource(255, 199, 60), |
| 257 |
"JideTabbedPane.tabListBackground", UIDefaultsLookup.getColor("List.background"), |
| 258 |
"JideTabbedPane.textIconGap", 4, |
| 259 |
"JideTabbedPane.showIconOnTab", Boolean.TRUE, |
| 260 |
"JideTabbedPane.showCloseButtonOnTab", Boolean.FALSE, |
| 261 |
"JideTabbedPane.closeButtonAlignment", SwingConstants.TRAILING, |
| 262 |
"JideTabbedPane.focusInputMap", |
| 263 |
new UIDefaults.LazyInputMap(new Object[]{ |
| 264 |
"RIGHT", "navigateRight", |
| 265 |
"KP_RIGHT", "navigateRight", |
| 266 |
"LEFT", "navigateLeft", |
| 267 |
"KP_LEFT", "navigateLeft", |
| 268 |
"UP", "navigateUp", |
| 269 |
"KP_UP", "navigateUp", |
| 270 |
"DOWN", "navigateDown", |
| 271 |
"KP_DOWN", "navigateDown", |
| 272 |
"ctrl DOWN", "requestFocusForVisibleComponent", |
| 273 |
"ctrl KP_DOWN", "requestFocusForVisibleComponent", |
| 274 |
}), |
| 275 |
"JideTabbedPane.ancestorInputMap", |
| 276 |
new UIDefaults.LazyInputMap(new Object[]{ |
| 277 |
"ctrl PAGE_DOWN", "navigatePageDown", |
| 278 |
"ctrl PAGE_UP", "navigatePageUp", |
| 279 |
"ctrl UP", "requestFocus", |
| 280 |
"ctrl KP_UP", "requestFocus", |
| 281 |
}), |
| 282 |
|
| 283 |
"Gripper.size", 8, |
| 284 |
"Gripper.foreground", gripperForeground, |
| 285 |
"Gripper.painter", gripperPainter, |
| 286 |
|
| 287 |
"Resizable.resizeBorder", resizeBorder, |
| 288 |
|
| 289 |
"ButtonPanel.order", "ACO", |
| 290 |
"ButtonPanel.oppositeOrder", "H", |
| 291 |
"ButtonPanel.buttonGap", 6, |
| 292 |
"ButtonPanel.groupGap", 6, |
| 293 |
"ButtonPanel.minButtonWidth", 75, |
| 294 |
|
| 295 |
"JideSplitButton.font", controlFont, |
| 296 |
"JideSplitButton.margin", new InsetsUIResource(3, 3, 3, 7), |
| 297 |
"JideSplitButton.border", buttonBorder, |
| 298 |
"JideSplitButton.borderPainted", Boolean.FALSE, |
| 299 |
"JideSplitButton.textIconGap", 4, |
| 300 |
"JideSplitButton.selectionForeground", menuTextColor, |
| 301 |
"JideSplitButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[]{ |
| 302 |
"SPACE", "pressed", |
| 303 |
"released SPACE", "released", |
| 304 |
"ENTER", "pressed", |
| 305 |
"released ENTER", "released", |
| 306 |
"DOWN", "downPressed", |
| 307 |
"released DOWN", "downReleased" |
| 308 |
}), |
| 309 |
|
| 310 |
"MeterProgressBar.border", new BorderUIResource(BorderFactory.createLineBorder(Color.BLACK)), |
| 311 |
"MeterProgressBar.background", new ColorUIResource(Color.BLACK), |
| 312 |
"MeterProgressBar.foreground", new ColorUIResource(Color.GREEN), |
| 313 |
"MeterProgressBar.cellForeground", new ColorUIResource(Color.GREEN), |
| 314 |
"MeterProgressBar.cellBackground", new ColorUIResource(0x008000), |
| 315 |
"MeterProgressBar.cellLength", 2, |
| 316 |
"MeterProgressBar.cellSpacing", 2, |
| 317 |
|
| 318 |
"Cursor.hsplit", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.HSPLIT), |
| 319 |
"Cursor.vsplit", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.VSPLIT), |
| 320 |
|
| 321 |
"Cursor.north", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.NORTH), |
| 322 |
"Cursor.south", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.SOUTH), |
| 323 |
"Cursor.east", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.EAST), |
| 324 |
"Cursor.west", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.WEST), |
| 325 |
"Cursor.tab", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.TAB), |
| 326 |
"Cursor.float", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.FLOAT), |
| 327 |
"Cursor.vertical", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.VERTICAL), |
| 328 |
"Cursor.horizontal", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.HORIZONTAL), |
| 329 |
"Cursor.delete", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.DELETE), |
| 330 |
"Cursor.drag", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.DROP), |
| 331 |
"Cursor.dragStop", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.NODROP), |
| 332 |
"Cursor.dragText", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.DROP_TEXT), |
| 333 |
"Cursor.dragTextStop", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.NODROP_TEXT), |
| 334 |
"Cursor.percentage", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.PERCENTAGE), |
| 335 |
"Cursor.moveEast", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.MOVE_EAST), |
| 336 |
"Cursor.moveWest", JideIconsFactory.getImageIcon(JideIconsFactory.Cursor.MOVE_WEST), |
| 337 |
|
| 338 |
"HeaderBox.background", defaultBackgroundColor, |
| 339 |
|
| 340 |
"Icon.floating", Boolean.TRUE, |
| 341 |
|
| 342 |
"JideScrollPane.border", singleLineBorder, |
| 343 |
|
| 344 |
"TextArea.font", controlFont, |
| 345 |
}; |
| 346 |
table.putDefaults(uiDefaults); |
| 347 |
|
| 348 |
int products = LookAndFeelFactory.getProductsUsed(); |
| 349 |
|
| 350 |
if ((products & PRODUCT_DOCK) != 0) { |
| 351 |
Object slidingEastFrameBorder = new ExtWindowsDesktopProperty(new String[]{"win.3d.lightColor", "win.3d.highlightColor", "win.3d.shadowColor", "win.3d.darkShadowColor"}, |
| 352 |
new Object[]{UIDefaultsLookup.get("control"), UIDefaultsLookup.get("controlLtHighlight"), UIDefaultsLookup.get("controlShadow"), UIDefaultsLookup.get("controlDkShadow")}, toolkit, new ConvertListener() { |
| 353 |
public Object convert(Object[] obj) { |
| 354 |
return new ResizeFrameBorder((Color) obj[0], (Color) obj[1], (Color) obj[2], (Color) obj[3], |
| 355 |
new Insets(0, 4, 0, 0)); |
| 356 |
} |
| 357 |
}); |
| 358 |
|
| 359 |
Object slidingWestFrameBorder = new ExtWindowsDesktopProperty(new String[]{"win.3d.lightColor", "win.3d.highlightColor", "win.3d.shadowColor", "win.3d.darkShadowColor"}, |
| 360 |
new Object[]{UIDefaultsLookup.get("control"), UIDefaultsLookup.get("controlLtHighlight"), UIDefaultsLookup.get("controlShadow"), UIDefaultsLookup.get("controlDkShadow")}, toolkit, new ConvertListener() { |
| 361 |
public Object convert(Object[] obj) { |
| 362 |
return new ResizeFrameBorder((Color) obj[0], (Color) obj[1], (Color) obj[2], (Color) obj[3], |
| 363 |
new Insets(0, 0, 0, 4)); |
| 364 |
} |
| 365 |
}); |
| 366 |
|
| 367 |
Object slidingNorthFrameBorder = new ExtWindowsDesktopProperty(new String[]{"win.3d.lightColor", "win.3d.highlightColor", "win.3d.shadowColor", "win.3d.darkShadowColor"}, |
| 368 |
new Object[]{UIDefaultsLookup.get("control"), UIDefaultsLookup.get("controlLtHighlight"), UIDefaultsLookup.get("controlShadow"), UIDefaultsLookup.get("controlDkShadow")}, toolkit, new ConvertListener() { |
| 369 |
public Object convert(Object[] obj) { |
| 370 |
return new ResizeFrameBorder((Color) obj[0], (Color) obj[1], (Color) obj[2], (Color) obj[3], |
| 371 |
new Insets(0, 0, 4, 0)); |
| 372 |
} |
| 373 |
}); |
| 374 |
|
| 375 |
Object slidingSouthFrameBorder = new ExtWindowsDesktopProperty(new String[]{"win.3d.lightColor", "win.3d.highlightColor", "win.3d.shadowColor", "win.3d.darkShadowColor"}, |
| 376 |
new Object[]{UIDefaultsLookup.get("control"), UIDefaultsLookup.get("controlLtHighlight"), UIDefaultsLookup.get("controlShadow"), UIDefaultsLookup.get("controlDkShadow")}, toolkit, new ConvertListener() { |
| 377 |
public Object convert(Object[] obj) { |
| 378 |
return new ResizeFrameBorder((Color) obj[0], (Color) obj[1], (Color) obj[2], (Color) obj[3], |
| 379 |
new Insets(4, 0, 0, 0)); |
| 380 |
} |
| 381 |
}); |
| 382 |
|
| 383 |
ImageIcon titleButtonImage = IconsFactory.getImageIcon(VsnetWindowsUtils.class, "icons/title_buttons_windows.gif"); // 10 x 10 x 8 |
| 384 |
final int titleButtonSize = 10; |
| 385 |
|
| 386 |
uiDefaults = new Object[]{ |
| 387 |
// dock |
| 388 |
"Workspace.background", mdiBackgroundColor, |
| 389 |
|
| 390 |
"SidePane.margin", new InsetsUIResource(1, 1, 1, 1), |
| 391 |
"SidePane.iconTextGap", 2, |
| 392 |
"SidePane.textBorderGap", 13, |
| 393 |
"SidePane.itemGap", 5, |
| 394 |
"SidePane.groupGap", 13, |
| 395 |
"SidePane.foreground", defaultDarkShadowColor, |
| 396 |
"SidePane.background", defaultFormBackground, |
| 397 |
"SidePane.lineColor", defaultShadowColor, |
| 398 |
"SidePane.buttonBackground", defaultBackgroundColor, |
| 399 |
"SidePane.selectedButtonBackground", selectedButtonColor, |
| 400 |
"SidePane.selectedButtonForeground", defaultTextColor, |
| 401 |
"SidePane.font", controlFont, |
| 402 |
"SidePane.orientation", 1, |
| 403 |
"SidePane.showSelectedTabText", Boolean.TRUE, |
| 404 |
"SidePane.alwaysShowTabText", Boolean.FALSE, |
| 405 |
"SidePane.highlighSelectedTab", Boolean.FALSE, |
| 406 |
|
| 407 |
"ContentContainer.background", defaultFormBackground, |
| 408 |
"ContentContainer.vgap", 1, |
| 409 |
"ContentContainer.hgap", 1, |
| 410 |
"MainContainer.border", new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0)), |
| 411 |
|
| 412 |
"DockableFrame.defaultIcon", JideIconsFactory.getImageIcon(JideIconsFactory.DockableFrame.BLANK), |
| 413 |
"DockableFrame.background", defaultBackgroundColor, |
| 414 |
"DockableFrame.border", new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0)), |
| 415 |
"DockableFrame.floatingBorder", new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0)), |
| 416 |
"DockableFrame.slidingEastBorder", slidingEastFrameBorder, |
| 417 |
"DockableFrame.slidingWestBorder", slidingWestFrameBorder, |
| 418 |
"DockableFrame.slidingNorthBorder", slidingNorthFrameBorder, |
| 419 |
"DockableFrame.slidingSouthBorder", slidingSouthFrameBorder, |
| 420 |
|
| 421 |
"DockableFrame.activeTitleBackground", activeTitleBackgroundColor, |
| 422 |
"DockableFrame.activeTitleForeground", activeTitleTextColor, |
| 423 |
"DockableFrame.inactiveTitleBackground", defaultBackgroundColor, |
| 424 |
"DockableFrame.inactiveTitleForeground", defaultTextColor, |
| 425 |
"DockableFrame.titleBorder", new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 3, 0)), |
| 426 |
"DockableFrame.activeTitleBorderColor", activeTitleBackgroundColor, |
| 427 |
"DockableFrame.inactiveTitleBorderColor", defaultShadowColor, |
| 428 |
"DockableFrame.font", controlFont, |
| 429 |
|
| 430 |
"DockableFrameTitlePane.gripperPainter", gripperPainter, |
| 431 |
"DockableFrameTitlePane.font", controlFont, |
| 432 |
"DockableFrameTitlePane.hideIcon", IconsFactory.getIcon(null, titleButtonImage, 0, 0, titleButtonSize, titleButtonSize), |
| 433 |
"DockableFrameTitlePane.unfloatIcon", IconsFactory.getIcon(null, titleButtonImage, 0, titleButtonSize, titleButtonSize, titleButtonSize), |
| 434 |
"DockableFrameTitlePane.floatIcon", IconsFactory.getIcon(null, titleButtonImage, 0, 2 * titleButtonSize, titleButtonSize, titleButtonSize), |
| 435 |
"DockableFrameTitlePane.autohideIcon", IconsFactory.getIcon(null, titleButtonImage, 0, 3 * titleButtonSize, titleButtonSize, titleButtonSize), |
| 436 |
"DockableFrameTitlePane.stopAutohideIcon", IconsFactory.getIcon(null, titleButtonImage, 0, 4 * titleButtonSize, titleButtonSize, titleButtonSize), |
| 437 |
"DockableFrameTitlePane.hideAutohideIcon", IconsFactory.getIcon(null, titleButtonImage, 0, 5 * titleButtonSize, titleButtonSize, titleButtonSize), |
| 438 |
"DockableFrameTitlePane.maximizeIcon", IconsFactory.getIcon(null, titleButtonImage, 0, 6 * titleButtonSize, titleButtonSize, titleButtonSize), |
| 439 |
"DockableFrameTitlePane.restoreIcon", IconsFactory.getIcon(null, titleButtonImage, 0, 7 * titleButtonSize, titleButtonSize, titleButtonSize), |
| 440 |
"DockableFrameTitlePane.titleBarComponent", Boolean.FALSE, |
| 441 |
|
| 442 |
"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 |
| 443 |
"DockableFrameTitlePane.use3dButtons", Boolean.TRUE, |
| 444 |
"DockableFrameTitlePane.buttonsAlignment", SwingConstants.TRAILING, // trailing or leading |
| 445 |
"DockableFrameTitlePane.titleAlignment", SwingConstants.LEADING, // trailing or leading or center |
| 446 |
"DockableFrameTitlePane.buttonGap", 4, // gap between buttons |
| 447 |
"DockableFrameTitlePane.showIcon", Boolean.FALSE, // show icon or not |
| 448 |
"DockableFrameTitlePane.margin", new InsetsUIResource(0, 6, 0, 6), // gap |
| 449 |
|
| 450 |
"Contour.color", activeTitleBackgroundColor, |
| 451 |
"Contour.thickness", 4, |
| 452 |
|
| 453 |
"DockingFramework.changeCursor", Boolean.FALSE, |
| 454 |
|
| 455 |
"FrameContainer.contentBorderInsets", new InsetsUIResource(2, 0, 0, 0), |
| 456 |
}; |
| 457 |
table.putDefaults(uiDefaults); |
| 458 |
} |
| 459 |
|
| 460 |
if ((products & PRODUCT_COMPONENTS) != 0) { |
| 461 |
ImageIcon collapsiblePaneImage = IconsFactory.getImageIcon(VsnetWindowsUtils.class, "icons/collapsible_pane_windows.gif"); // 12 x 12 x 2 |
| 462 |
final int collapsiblePaneSize = 12; |
| 463 |
|
| 464 |
uiDefaults = new Object[]{ |
| 465 |
// components |
| 466 |
"CollapsiblePanes.border", new BorderUIResource(BorderFactory.createEmptyBorder(12, 12, 12, 12)), |
| 467 |
"CollapsiblePanes.gap", 15, |
| 468 |
|
| 469 |
"CollapsiblePane.background", Color.BLACK.equals(defaultBackgroundColor.createValue(table)) ? defaultLtHighlightColor : defaultBackgroundColor, |
| 470 |
"CollapsiblePane.contentBackground", Color.BLACK.equals(defaultBackgroundColor.createValue(table)) ? defaultBackgroundColor : defaultLtHighlightColor, |
| 471 |
"CollapsiblePane.foreground", defaultTextColor, |
| 472 |
"CollapsiblePane.emphasizedBackground", activeTitleBackgroundColor, |
| 473 |
"CollapsiblePane.emphasizedForeground", activeTitleTextColor, |
| 474 |
"CollapsiblePane.border", new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0)), |
| 475 |
"CollapsiblePane.font", controlFont, |
| 476 |
|
| 477 |
"CollapsiblePane.contentBorder", new BorderUIResource(BorderFactory.createEmptyBorder(8, 10, 8, 10)), |
| 478 |
|
| 479 |
"CollapsiblePane.titleBorder", new BorderUIResource(BorderFactory.createEmptyBorder(3, 3, 3, 3)), |
| 480 |
"CollapsiblePane.titleFont", boldFont, |
| 481 |
"CollapsiblePane.downIcon", IconsFactory.getIcon(null, collapsiblePaneImage, 0, 0, collapsiblePaneSize, collapsiblePaneSize), |
| 482 |
"CollapsiblePane.upIcon", IconsFactory.getIcon(null, collapsiblePaneImage, 0, collapsiblePaneSize, collapsiblePaneSize, collapsiblePaneSize), |
| 483 |
|
| 484 |
"StatusBarItem.border", singleLineBorder, |
| 485 |
|
| 486 |
"StatusBar.border", new BorderUIResource(BorderFactory.createEmptyBorder(2, 0, 0, 0)), |
| 487 |
"StatusBar.gap", 2, |
| 488 |
"StatusBar.background", defaultBackgroundColor, |
| 489 |
"StatusBar.font", controlFont, |
| 490 |
"MemoryStatusBarItem.fillColor", new ColorUIResource(236, 233, 176), |
| 491 |
|
| 492 |
"DocumentPane.groupBorder", new BorderUIResource(BorderFactory.createLineBorder(Color.gray)), |
| 493 |
"DocumentPane.newHorizontalGroupIcon", JideIconsFactory.getImageIcon(JideIconsFactory.WindowMenu.NEW_HORIZONTAL_TAB), |
| 494 |
"DocumentPane.newVerticalGroupIcon", JideIconsFactory.getImageIcon(JideIconsFactory.WindowMenu.NEW_VERTICAL_TAB), |
| 495 |
"DocumentPane.boldActiveTab", Boolean.TRUE, |
| 496 |
|
| 497 |
"OutlookTabbedPane.buttonStyle", JideButton.TOOLBOX_STYLE, |
| 498 |
"FloorTabbedPane.buttonStyle", JideButton.TOOLBOX_STYLE, |
| 499 |
}; |
| 500 |
table.putDefaults(uiDefaults); |
| 501 |
} |
| 502 |
|
| 503 |
if ((products & PRODUCT_ACTION) != 0) { |
| 504 |
Object commandBarBackground = new ExtWindowsDesktopProperty(new String[]{"win.3d.backgroundColor"}, new Object[]{UIDefaultsLookup.get("control")}, toolkit, new ConvertListener() { |
| 505 |
public Object convert(Object[] obj) { |
| 506 |
return new ColorUIResource(VsnetUtils.getToolBarBackgroundColor((Color) obj[0])); |
| 507 |
} |
| 508 |
}); |
| 509 |
|
| 510 |
uiDefaults = new Object[]{ |
| 511 |
// action |
| 512 |
"CommandBar.font", toolbarFont, |
| 513 |
"CommandBar.background", commandBarBackground, |
| 514 |
"CommandBar.foreground", defaultTextColor, |
| 515 |
"CommandBar.shadow", defaultShadowColor, |
| 516 |
"CommandBar.darkShadow", defaultDarkShadowColor, |
| 517 |
"CommandBar.light", defaultHighlightColor, |
| 518 |
"CommandBar.highlight", defaultLtHighlightColor, |
| 519 |
"CommandBar.border", new BorderUIResource(BorderFactory.createEmptyBorder(1, 1, 1, 1)), |
| 520 |
"CommandBar.borderVert", new BorderUIResource(BorderFactory.createEmptyBorder(1, 1, 1, 1)), |
| 521 |
"CommandBar.borderFloating", new BorderUIResource(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder((Color) activeTitleBackgroundColor.createValue(table), 2), |
| 522 |
BorderFactory.createEmptyBorder(1, 1, 1, 1))), |
| 523 |
"CommandBar.ancestorInputMap", |
| 524 |
new UIDefaults.LazyInputMap(new Object[]{ |
| 525 |
"UP", "navigateUp", |
| 526 |
"KP_UP", "navigateUp", |
| 527 |
"DOWN", "navigateDown", |
| 528 |
"KP_DOWN", "navigateDown", |
| 529 |
"LEFT", "navigateLeft", |
| 530 |
"KP_LEFT", "navigateLeft", |
| 531 |
"RIGHT", "navigateRight", |
| 532 |
"KP_RIGHT", "navigateRight" |
| 533 |
}), |
| 534 |
"CommandBar.titleBarSize", 17, |
| 535 |
"CommandBar.titleBarButtonGap", 1, |
| 536 |
"CommandBar.titleBarBackground", activeTitleBackgroundColor, |
| 537 |
"CommandBar.titleBarForeground", activeTitleTextColor, |
| 538 |
"CommandBar.titleBarFont", boldFont, |
| 539 |
"CommandBar.minimumSize", new DimensionUIResource(20, 20), |
| 540 |
|
| 541 |
"CommandBar.separatorSize", 5, |
| 542 |
|
| 543 |
// *** Separator |
| 544 |
"CommandBarSeparator.background", new Color(219, 216, 209), |
| 545 |
"CommandBarSeparator.foreground", new Color(166, 166, 166), |
| 546 |
|
| 547 |
"Chevron.size", 11, |
| 548 |
"Chevron.alwaysVisible", Boolean.FALSE, |
| 549 |
}; |
| 550 |
table.putDefaults(uiDefaults); |
| 551 |
} |
| 552 |
|
| 553 |
if ((products & PRODUCT_GRIDS) != 0) { |
| 554 |
uiDefaults = new Object[]{ |
| 555 |
"AbstractComboBox.useJButton", Boolean.FALSE, |
| 556 |
"NestedTableHeader.cellBorder", new HeaderCellBorder(), |
| 557 |
|
| 558 |
"GroupList.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[]{ |
| 559 |
"TAB", "selectNextGroup", |
| 560 |
"shift TAB", "selectPreviousGroup", |
| 561 |
}), |
| 562 |
}; |
| 563 |
table.putDefaults(uiDefaults); |
| 564 |
} |
| 565 |
|
| 566 |
if ((products & PRODUCT_DIFF) != 0) { |
| 567 |
uiDefaults = new Object[]{ |
| 568 |
"DiffMerge.changed", new ColorUIResource(196, 196, 255), |
| 569 |
"DiffMerge.deleted", new ColorUIResource(200, 200, 200), |
| 570 |
"DiffMerge.inserted", new ColorUIResource(196, 255, 196), |
| 571 |
"DiffMerge.conflicted", new ColorUIResource(255, 153, 153), |
| 572 |
}; |
| 573 |
table.putDefaults(uiDefaults); |
| 574 |
} |
| 575 |
|
| 576 |
if (!JideSwingUtilities.shouldUseSystemFont()) { |
| 577 |
Object uiDefaultsFont[] = { |
| 578 |
"TabbedPane.font", controlFont, |
| 579 |
"TitledBorder.font", boldFont, |
| 580 |
"TableHeader.font", controlFont, |
| 581 |
"Table.font", controlFont, |
| 582 |
"List.font", controlFont, |
| 583 |
"Tree.font", controlFont, |
| 584 |
"ToolTip.font", controlFont, |
| 585 |
"CheckBox.font", controlFont, |
| 586 |
"RadioButton.font", controlFont, |
| 587 |
"Label.font", controlFont, |
| 588 |
"Panel.font", controlFont, |
| 589 |
"TextField.font", controlFont, |
| 590 |
"ComboBox.font", controlFont, |
| 591 |
"Button.font", controlFont |
| 592 |
}; |
| 593 |
table.putDefaults(uiDefaultsFont); |
| 594 |
} |
| 595 |
|
| 596 |
// make the spinner has the same font as text field |
| 597 |
table.put("Spinner.font", UIDefaultsLookup.get("TextField.font")); |
| 598 |
table.put("FormattedTextField.font", UIDefaultsLookup.get("TextField.font")); |
| 599 |
|
| 600 |
UIDefaultsLookup.put(table, "Theme.painter", BasicPainter.getInstance()); |
| 601 |
} |
| 602 |
|
| 603 |
/** |
| 604 |
* Initializes components defaults with menu components UIDefaults. |
| 605 |
* |
| 606 |
* @param table UIDefaults table |
| 607 |
*/ |
| 608 |
public static void initComponentDefaultsWithMenu(UIDefaults table) { |
| 609 |
Toolkit toolkit = Toolkit.getDefaultToolkit(); |
| 610 |
|
| 611 |
initComponentDefaults(table); |
| 612 |
|
| 613 |
if (!Beans.isDesignTime()) { |
| 614 |
Object defaultLightColor = new ExtWindowsDesktopProperty( |
| 615 |
new String[]{"win.3d.lightColor"}, new Object[]{UIDefaultsLookup.get("controlHighlight")}, toolkit, new ConvertListener() { |
| 616 |
public Object convert(Object[] obj) { |
| 617 |
return new ColorUIResource(VsnetUtils.getLighterColor((Color) obj[0])); |
| 618 |
} |
| 619 |
}); |
| 620 |
Object borderColor = new ExtWindowsDesktopProperty(new String[]{"win.item.highlightColor"}, new Object[]{UIDefaultsLookup.get("controlShadow")}, toolkit, new ConvertListener() { |
| 621 |
public Object convert(Object[] obj) { |
| 622 |
return new ColorUIResource(VsnetUtils.getButtonBorderColor((Color) obj[0])); |
| 623 |
} |
| 624 |
}); |
| 625 |
WindowsDesktopProperty menuTextColor = new WindowsDesktopProperty("win.menu.textColor", UIDefaultsLookup.get("control"), toolkit); |
| 626 |
|
| 627 |
Object menuFont = JideSwingUtilities.getMenuFont(toolkit, table); |
| 628 |
|
| 629 |
Object menuSelectionBackground = new ExtWindowsDesktopProperty(//Actual color 182, 189, 210 |
| 630 |
new String[]{"win.3d.lightColor"}, new Object[]{UIDefaultsLookup.get("controlShadow")}, toolkit, new ConvertListener() { |
| 631 |
public Object convert(Object[] obj) { |
| 632 |
return new ColorUIResource(VsnetUtils.getMenuSelectionColor((Color) obj[0])); |
| 633 |
} |
| 634 |
}); |
| 635 |
|
| 636 |
Object menuBackground = new ExtWindowsDesktopProperty(//Actual color 249, 248, 247 |
| 637 |
new String[]{"win.3d.backgroundColor"}, new Object[]{UIDefaultsLookup.get("control")}, toolkit, new ConvertListener() { |
| 638 |
public Object convert(Object[] obj) { |
| 639 |
return new ColorUIResource(VsnetUtils.getMenuBackgroundColor((Color) obj[0])); |
| 640 |
} |
| 641 |
}); |
| 642 |
|
| 643 |
Object separatorColor = new ExtWindowsDesktopProperty(// Not exactly right |
| 644 |
new String[]{"win.3d.shadowColor"}, new Object[]{UIDefaultsLookup.get("controlShadow")}, toolkit, new ConvertListener() { |
| 645 |
public Object convert(Object[] obj) { |
| 646 |
return new ColorUIResource(((Color) obj[0]).brighter()); |
| 647 |
} |
| 648 |
}); |
| 649 |
|
| 650 |
Object uiDefaults[] = { |
| 651 |
"PopupMenuSeparator.foreground", separatorColor, |
| 652 |
"PopupMenuSeparator.background", menuBackground, |
| 653 |
|
| 654 |
"CheckBoxMenuItem.checkIcon", new MenuCheckIcon(JideIconsFactory.getImageIcon(JideIconsFactory.MENU_CHECKBOX_VSNET)), |
| 655 |
"CheckBoxMenuItem.selectionBackground", menuSelectionBackground, |
| 656 |
"CheckBoxMenuItem.selectionForeground", menuTextColor, |
| 657 |
"CheckBoxMenuItem.acceleratorSelectionForeground", menuTextColor, |
| 658 |
"CheckBoxMenuItem.mouseHoverBackground", menuSelectionBackground, |
| 659 |
"CheckBoxMenuItem.mouseHoverBorder", new BorderUIResource(BorderFactory.createLineBorder(new Color(10, 36, 106))), |
| 660 |
"CheckBoxMenuItem.margin", new InsetsUIResource(3, 0, 3, 0), |
| 661 |
"CheckBoxMenuItem.font", menuFont, |
| 662 |
"CheckBoxMenuItem.acceleratorFont", menuFont, |
| 663 |
"CheckBoxMenuItem.textIconGap", 8, |
| 664 |
|
| 665 |
"RadioButtonMenuItem.checkIcon", new MenuCheckIcon(JideIconsFactory.getImageIcon(JideIconsFactory.MENU_CHECKBOX_VSNET)), |
| 666 |
"RadioButtonMenuItem.selectionBackground", menuSelectionBackground, |
| 667 |
"RadioButtonMenuItem.selectionForeground", menuTextColor, |
| 668 |
"RadioButtonMenuItem.acceleratorSelectionForeground", menuTextColor, |
| 669 |
"RadioButtonMenuItem.mouseHoverBackground", menuSelectionBackground, |
| 670 |
"RadioButtonMenuItem.mouseHoverBorder", new BorderUIResource(BorderFactory.createLineBorder(new Color(10, 36, 106))), |
| 671 |
"RadioButtonMenuItem.margin", new InsetsUIResource(3, 0, 3, 0), |
| 672 |
"RadioButtonMenuItem.font", menuFont, |
| 673 |
"RadioButtonMenuItem.acceleratorFont", menuFont, |
| 674 |
"RadioButtonMenuItem.textIconGap", 8, |
| 675 |
|
| 676 |
|
| 677 |
"MenuBar.border", new BorderUIResource(BorderFactory.createEmptyBorder(2, 2, 2, 2)), |
| 678 |
|
| 679 |
"Menu.selectionBackground", menuSelectionBackground, |
| 680 |
"Menu.selectionForeground", menuTextColor, |
| 681 |
"Menu.mouseHoverBackground", menuSelectionBackground, |
| 682 |
"Menu.mouseHoverBorder", new BorderUIResource(BorderFactory.createLineBorder(new Color(10, 36, 106))), |
| 683 |
"Menu.margin", new InsetsUIResource(3, 7, 2, 7), |
| 684 |
"Menu.checkIcon", new MenuCheckIcon(JideIconsFactory.getImageIcon(JideIconsFactory.MENU_CHECKBOX_VSNET)), |
| 685 |
"Menu.textIconGap", 2, |
| 686 |
"Menu.font", menuFont, |
| 687 |
"Menu.acceleratorFont", menuFont, |
| 688 |
"Menu.submenuPopupOffsetX", 0, |
| 689 |
"Menu.submenuPopupOffsetY", 0, |
| 690 |
|
| 691 |
"MenuItem.checkIcon", new MenuCheckIcon(JideIconsFactory.getImageIcon(JideIconsFactory.MENU_CHECKBOX_VSNET)), |
| 692 |
"MenuItem.selectionBackground", menuSelectionBackground, |
| 693 |
"MenuItem.selectionForeground", menuTextColor, |
| 694 |
"MenuItem.acceleratorSelectionForeground", menuTextColor, |
| 695 |
"MenuItem.background", menuBackground, |
| 696 |
"MenuItem.selectionBorderColor", borderColor, |
| 697 |
"MenuItem.shadowWidth", 24, |
| 698 |
"MenuItem.shadowColor", defaultLightColor, // TODO: not exactly. The actual one a little bit brighter than it |
| 699 |
"MenuItem.textIconGap", 8, |
| 700 |
"MenuItem.accelEndGap", 18, |
| 701 |
"MenuItem.margin", new InsetsUIResource(3, 0, 3, 0), |
| 702 |
"MenuItem.font", menuFont, |
| 703 |
"MenuItem.acceleratorFont", menuFont, |
| 704 |
}; |
| 705 |
table.putDefaults(uiDefaults); |
| 706 |
} |
| 707 |
|
| 708 |
// since it used BasicPainter, make sure it is after Theme.Painter is set first. |
| 709 |
Object popupMenuBorder = new ExtWindowsDesktopProperty(new String[]{"null"}, new Object[]{((ThemePainter) UIDefaultsLookup.get("Theme.painter")).getMenuItemBorderColor()}, toolkit, new ConvertListener() { |
| 710 |
public Object convert(Object[] obj) { |
| 711 |
return new BorderUIResource(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder((Color) obj[0]), BorderFactory.createEmptyBorder(1, 1, 1, 1))); |
| 712 |
} |
| 713 |
}); |
| 714 |
table.put("PopupMenu.border", popupMenuBorder); |
| 715 |
} |
| 716 |
} |