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