1 /* 2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package com.apple.laf; 27 28 import java.awt.*; 29 import java.security.PrivilegedAction; 30 import java.util.*; 31 32 import javax.swing.*; 33 import javax.swing.border.Border; 34 import javax.swing.plaf.*; 35 import javax.swing.plaf.basic.BasicLookAndFeel; 36 37 import sun.swing.*; 38 import apple.laf.*; 39 40 import com.apple.resources.MacOSXResourceBundle; 41 42 public class AquaLookAndFeel extends BasicLookAndFeel { 43 static final String sOldPropertyPrefix = "com.apple.macos."; // old prefix for things like 'useScreenMenuBar' 44 static final String sPropertyPrefix = "apple.laf."; // new prefix for things like 'useScreenMenuBar' 45 46 // for lazy initalizers. Following the pattern from metal. 47 private static final String PKG_PREFIX = "com.apple.laf."; 48 private static final String kAquaImageFactoryName = PKG_PREFIX + "AquaImageFactory"; 49 private static final String kAquaFontsName = PKG_PREFIX + "AquaFonts"; 50 51 /** 52 * Return a short string that identifies this look and feel, e.g. 53 * "CDE/Motif". This string should be appropriate for a menu item. 54 * Distinct look and feels should have different names, e.g. 55 * a subclass of MotifLookAndFeel that changes the way a few components 56 * are rendered should be called "CDE/Motif My Way"; something 57 * that would be useful to a user trying to select a L&F from a list 58 * of names. 59 */ 60 public String getName() { 61 return "Mac OS X"; 62 } 63 64 /** 65 * Return a string that identifies this look and feel. This string 66 * will be used by applications/services that want to recognize 67 * well known look and feel implementations. Presently 68 * the well known names are "Motif", "Windows", "Mac", "Metal". Note 69 * that a LookAndFeel derived from a well known superclass 70 * that doesn't make any fundamental changes to the look or feel 71 * shouldn't override this method. 72 */ 73 public String getID() { 74 return "Aqua"; 75 } 76 77 /** 78 * Return a one line description of this look and feel implementation, 79 * e.g. "The CDE/Motif Look and Feel". This string is intended for 80 * the user, e.g. in the title of a window or in a ToolTip message. 81 */ 82 public String getDescription() { 83 return "Aqua Look and Feel for Mac OS X"; 84 } 85 86 /** 87 * Returns true if the <code>LookAndFeel</code> returned 88 * <code>RootPaneUI</code> instances support providing Window decorations 89 * in a <code>JRootPane</code>. 90 * <p> 91 * The default implementation returns false, subclasses that support 92 * Window decorations should override this and return true. 93 * 94 * @return True if the RootPaneUI instances created support client side 95 * decorations 96 * @see JDialog#setDefaultLookAndFeelDecorated 97 * @see JFrame#setDefaultLookAndFeelDecorated 98 * @see JRootPane#setWindowDecorationStyle 99 * @since 1.4 100 */ 101 public boolean getSupportsWindowDecorations() { 102 return false; 103 } 104 105 /** 106 * If the underlying platform has a "native" look and feel, and this 107 * is an implementation of it, return true. 108 */ 109 public boolean isNativeLookAndFeel() { 110 return true; 111 } 112 113 /** 114 * Return true if the underlying platform supports and or permits 115 * this look and feel. This method returns false if the look 116 * and feel depends on special resources or legal agreements that 117 * aren't defined for the current platform. 118 * 119 * @see UIManager#setLookAndFeel 120 */ 121 public boolean isSupportedLookAndFeel() { 122 return true; 123 } 124 125 /** 126 * UIManager.setLookAndFeel calls this method before the first 127 * call (and typically the only call) to getDefaults(). Subclasses 128 * should do any one-time setup they need here, rather than 129 * in a static initializer, because look and feel class objects 130 * may be loaded just to discover that isSupportedLookAndFeel() 131 * returns false. 132 * 133 * @see #uninitialize 134 * @see UIManager#setLookAndFeel 135 */ 136 public void initialize() { 137 java.security.AccessController.doPrivileged((PrivilegedAction<?>)new sun.security.action.LoadLibraryAction("osxui")); 138 java.security.AccessController.doPrivileged(new PrivilegedAction<Object>(){ 139 @Override 140 public Object run() { 141 JRSUIControl.initJRSUI(); 142 return null; 143 } 144 }); 145 146 super.initialize(); 147 final ScreenPopupFactory spf = new ScreenPopupFactory(); 148 spf.setActive(true); 149 PopupFactory.setSharedInstance(spf); 150 151 KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventPostProcessor(AquaMnemonicHandler.getInstance()); 152 } 153 154 /** 155 * UIManager.setLookAndFeel calls this method just before we're 156 * replaced by a new default look and feel. Subclasses may 157 * choose to free up some resources here. 158 * 159 * @see #initialize 160 */ 161 public void uninitialize() { 162 KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventPostProcessor(AquaMnemonicHandler.getInstance()); 163 164 final PopupFactory popupFactory = PopupFactory.getSharedInstance(); 165 if (popupFactory != null && popupFactory instanceof ScreenPopupFactory) { 166 ((ScreenPopupFactory)popupFactory).setActive(false); 167 } 168 169 super.uninitialize(); 170 } 171 172 /** 173 * Returns an <code>ActionMap</code>. 174 * <P> 175 * This <code>ActionMap</code> contains <code>Actions</code> that 176 * embody the ability to render an auditory cue. These auditory 177 * cues map onto user and system activities that may be useful 178 * for an end user to know about (such as a dialog box appearing). 179 * <P> 180 * At the appropriate time in a <code>JComponent</code> UI's lifecycle, 181 * the ComponentUI is responsible for getting the appropriate 182 * <code>Action</code> out of the <code>ActionMap</code> and passing 183 * it on to <code>playSound</code>. 184 * <P> 185 * The <code>Actions</code> in this <code>ActionMap</code> are 186 * created by the <code>createAudioAction</code> method. 187 * 188 * @return an ActionMap containing Actions 189 * responsible for rendering auditory cues 190 * @see #createAudioAction 191 * @see #playSound(Action) 192 * @since 1.4 193 */ 194 protected ActionMap getAudioActionMap() { 195 ActionMap audioActionMap = (ActionMap)UIManager.get("AuditoryCues.actionMap"); 196 if (audioActionMap != null) return audioActionMap; 197 198 final Object[] acList = (Object[])UIManager.get("AuditoryCues.cueList"); 199 if (acList != null) { 200 audioActionMap = new ActionMapUIResource(); 201 for (int counter = acList.length - 1; counter >= 0; counter--) { 202 audioActionMap.put(acList[counter], createAudioAction(acList[counter])); 203 } 204 } 205 UIManager.getLookAndFeelDefaults().put("AuditoryCues.actionMap", audioActionMap); 206 207 return audioActionMap; 208 } 209 210 /** 211 * We override getDefaults() so we can install our own debug defaults 212 * if needed for testing 213 */ 214 public UIDefaults getDefaults() { 215 final UIDefaults table = new UIDefaults(); 216 // use debug defaults if you want to see every query into the defaults object. 217 //UIDefaults table = new DebugDefaults(); 218 try { 219 // PopupFactory.getSharedInstance().setPopupType(2); 220 initClassDefaults(table); 221 222 // Here we install all the Basic defaults in case we missed some in our System color 223 // or component defaults that follow. Eventually we will take this out. 224 // This is a big negative to performance so we want to get it out as soon 225 // as we are comfortable with the Aqua defaults. 226 super.initSystemColorDefaults(table); 227 super.initComponentDefaults(table); 228 229 // Because the last elements added win in precedence we add all of our aqua elements here. 230 initSystemColorDefaults(table); 231 initComponentDefaults(table); 232 } catch(final Exception e) { 233 e.printStackTrace(); 234 } 235 return table; 236 } 237 238 /** 239 * Initialize the defaults table with the name of the ResourceBundle 240 * used for getting localized defaults. Also initialize the default 241 * locale used when no locale is passed into UIDefaults.get(). The 242 * default locale should generally not be relied upon. It is here for 243 * compatability with releases prior to 1.4. 244 */ 245 private void initResourceBundle(final UIDefaults table) { 246 table.setDefaultLocale(Locale.getDefault()); 247 try { 248 final ResourceBundle aquaProperties = MacOSXResourceBundle.getMacResourceBundle(PKG_PREFIX + "resources.aqua"); 249 final Enumeration<String> propertyKeys = aquaProperties.getKeys(); 250 251 while (propertyKeys.hasMoreElements()) { 252 final String key = propertyKeys.nextElement(); 253 table.put(key, aquaProperties.getString(key)); 254 } 255 } catch (final Exception e) { 256 table.addResourceBundle(PKG_PREFIX + "resources.aqua"); 257 } 258 } 259 260 /** 261 * This is the last step in the getDefaults routine usually called from our superclass 262 */ 263 protected void initComponentDefaults(final UIDefaults table) { 264 initResourceBundle(table); 265 266 final InsetsUIResource zeroInsets = new InsetsUIResource(0, 0, 0, 0); 267 final InsetsUIResource menuItemMargin = zeroInsets; 268 269 // <rdar://problem/5189013> Entire Java application window refreshes when moving off Shortcut menu item 270 final Boolean useOpaqueComponents = Boolean.TRUE; 271 272 final Boolean buttonShouldBeOpaque = AquaUtils.shouldUseOpaqueButtons() ? Boolean.TRUE : Boolean.FALSE; 273 274 // *** List value objects 275 final Object listCellRendererActiveValue = new UIDefaults.ActiveValue(){ 276 public Object createValue(UIDefaults defaultsTable) { 277 return new DefaultListCellRenderer.UIResource(); 278 } 279 }; 280 281 // SJA - I'm basing this on what is in the MetalLookAndFeel class, but 282 // without being based on BasicLookAndFeel. We want more flexibility. 283 // The key to doing this well is to use Lazy initializing classes as 284 // much as possible. 285 286 // Here I want to go to native and get all the values we'd need for colors etc. 287 final Border toolTipBorder = new BorderUIResource.EmptyBorderUIResource(2, 0, 2, 0); 288 final ColorUIResource toolTipBackground = new ColorUIResource(255, 255, (int)(255.0 * 0.80)); 289 final ColorUIResource black = new ColorUIResource(Color.black); 290 final ColorUIResource white = new ColorUIResource(Color.white); 291 final ColorUIResource smokyGlass = new ColorUIResource(new Color(0, 0, 0, 152)); 292 final ColorUIResource dockIconRim = new ColorUIResource(new Color(192, 192, 192, 192)); 293 final ColorUIResource mediumTranslucentBlack = new ColorUIResource(new Color(0, 0, 0, 100)); 294 final ColorUIResource translucentWhite = new ColorUIResource(new Color(255, 255, 255, 254)); 295 // final ColorUIResource lightGray = new ColorUIResource(232, 232, 232); 296 final ColorUIResource disabled = new ColorUIResource(0.5f, 0.5f, 0.5f); 297 final ColorUIResource disabledShadow = new ColorUIResource(0.25f, 0.25f, 0.25f); 298 final ColorUIResource selected = new ColorUIResource(1.0f, 0.4f, 0.4f); 299 300 // Contrast tab UI colors 301 302 final ColorUIResource selectedTabTitlePressedColor = new ColorUIResource(240, 240, 240); 303 final ColorUIResource selectedTabTitleDisabledColor = new ColorUIResource(new Color(1, 1, 1, 0.55f)); 304 final ColorUIResource selectedTabTitleNormalColor = white; 305 final ColorUIResource selectedTabTitleShadowDisabledColor = new ColorUIResource(new Color(0, 0, 0, 0.25f)); 306 final ColorUIResource selectedTabTitleShadowNormalColor = mediumTranslucentBlack; 307 final ColorUIResource nonSelectedTabTitleNormalColor = black; 308 309 final ColorUIResource toolbarDragHandleColor = new ColorUIResource(140, 140, 140); 310 311 // sja todo Make these lazy values so we only get them when required - if we deem it necessary 312 // it may be the case that we think the overhead of a proxy lazy value is not worth delaying 313 // creating the object if we think that most swing apps will use this. 314 // the lazy value is useful for delaying initialization until this default value is actually 315 // accessed by the LAF instead of at init time, so making it lazy should speed up 316 // our launch times of Swing apps. 317 318 // *** Text value objects 319 final Object marginBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders$MarginBorder"); 320 321 final Object zero = new Integer(0); 322 final Object editorMargin = zeroInsets; // this is not correct - look at TextEdit to determine the right margin 323 final Object textCaretBlinkRate = new Integer(500); 324 final Object textFieldBorder = new SwingLazyValue(PKG_PREFIX + "AquaTextFieldBorder", "getTextFieldBorder"); 325 final Object textAreaBorder = marginBorder; // text areas have no real border - radar 311073 326 327 final Object scollListBorder = new SwingLazyValue(PKG_PREFIX + "AquaScrollRegionBorder", "getScrollRegionBorder"); 328 final Object aquaTitledBorder = new SwingLazyValue(PKG_PREFIX + "AquaGroupBorder", "getBorderForTitledBorder"); 329 final Object aquaInsetBorder = new SwingLazyValue(PKG_PREFIX + "AquaGroupBorder", "getTitlelessBorder"); 330 331 final Border listHeaderBorder = AquaTableHeaderBorder.getListHeaderBorder(); 332 final Border zeroBorder = new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0); 333 334 // we can't seem to proxy Colors 335 final Color selectionBackground = AquaImageFactory.getSelectionBackgroundColorUIResource(); 336 final Color selectionForeground = AquaImageFactory.getSelectionForegroundColorUIResource(); 337 final Color selectionInactiveBackground = AquaImageFactory.getSelectionInactiveBackgroundColorUIResource(); 338 final Color selectionInactiveForeground = AquaImageFactory.getSelectionInactiveForegroundColorUIResource(); 339 340 final Color textHighlightText = AquaImageFactory.getTextSelectionForegroundColorUIResource(); 341 final Color textHighlight = AquaImageFactory.getTextSelectionBackgroundColorUIResource(); 342 final Color textHighlightInactive = new ColorUIResource(212, 212, 212); 343 344 final Color textInactiveText = disabled; 345 final Color textForeground = black; 346 final Color textBackground = white; 347 final Color textInactiveBackground = white; 348 349 final Color textPasswordFieldCapsLockIconColor = mediumTranslucentBlack; 350 351 final Object internalFrameBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getInternalFrameBorder"); 352 final Color desktopBackgroundColor = new ColorUIResource(new Color(65, 105, 170));//SystemColor.desktop 353 354 final Color focusRingColor = AquaImageFactory.getFocusRingColorUIResource(); 355 final Border focusCellHighlightBorder = new BorderUIResource.LineBorderUIResource(focusRingColor); 356 357 final Color windowBackgroundColor = AquaImageFactory.getWindowBackgroundColorUIResource(); 358 final Color panelBackgroundColor = windowBackgroundColor; 359 final Color tabBackgroundColor = windowBackgroundColor; 360 final Color controlBackgroundColor = windowBackgroundColor; 361 362 final Object controlFont = new SwingLazyValue(kAquaFontsName, "getControlTextFont"); 363 final Object controlSmallFont = new SwingLazyValue(kAquaFontsName, "getControlTextSmallFont"); 364 final Object alertHeaderFont = new SwingLazyValue(kAquaFontsName, "getAlertHeaderFont"); 365 final Object menuFont = new SwingLazyValue(kAquaFontsName, "getMenuFont"); 366 final Object viewFont = new SwingLazyValue(kAquaFontsName, "getViewFont"); 367 368 final Color menuBackgroundColor = new ColorUIResource(Color.white); 369 final Color menuForegroundColor = black; 370 371 final Color menuSelectedForegroundColor = white; 372 final Color menuSelectedBackgroundColor = focusRingColor; 373 374 final Color menuDisabledBackgroundColor = menuBackgroundColor; 375 final Color menuDisabledForegroundColor = disabled; 376 377 final Color menuAccelForegroundColor = black; 378 final Color menuAccelSelectionForegroundColor = black; 379 380 final Border menuBorder = new AquaMenuBorder(); 381 382 final UIDefaults.LazyInputMap controlFocusInputMap = new UIDefaults.LazyInputMap(new Object[]{ 383 "SPACE", "pressed", 384 "released SPACE", "released" 385 }); 386 387 // sja testing 388 final Object confirmIcon = new SwingLazyValue(kAquaImageFactoryName, "getConfirmImageIcon"); // AquaImageFactory.getConfirmImageIcon(); 389 final Object cautionIcon = new SwingLazyValue(kAquaImageFactoryName, "getCautionImageIcon"); // AquaImageFactory.getCautionImageIcon(); 390 final Object stopIcon = new SwingLazyValue(kAquaImageFactoryName, "getStopImageIcon"); // AquaImageFactory.getStopImageIcon(); 391 final Object securityIcon = new SwingLazyValue(kAquaImageFactoryName, "getLockImageIcon"); // AquaImageFactory.getLockImageIcon(); 392 393 final AquaKeyBindings aquaKeyBindings = AquaKeyBindings.instance(); 394 395 final Object[] defaults = { 396 "control", windowBackgroundColor, /* Default color for controls (buttons, sliders, etc) */ 397 398 // Buttons 399 "Button.background", controlBackgroundColor, 400 "Button.foreground", black, 401 "Button.disabledText", disabled, 402 "Button.select", selected, 403 "Button.border", new SwingLazyValue(PKG_PREFIX + "AquaButtonBorder", "getDynamicButtonBorder"), 404 "Button.font", controlFont, 405 "Button.textIconGap", new Integer(4), 406 "Button.textShiftOffset", zero, // radar 3308129 - aqua doesn't move images when pressed. 407 "Button.focusInputMap", controlFocusInputMap, 408 "Button.margin", new InsetsUIResource(0, 2, 0, 2), 409 "Button.opaque", buttonShouldBeOpaque, 410 411 "CheckBox.background", controlBackgroundColor, 412 "CheckBox.foreground", black, 413 "CheckBox.disabledText", disabled, 414 "CheckBox.select", selected, 415 "CheckBox.icon", new SwingLazyValue(PKG_PREFIX + "AquaButtonCheckBoxUI", "getSizingCheckBoxIcon"), 416 "CheckBox.font", controlFont, 417 "CheckBox.border", AquaButtonBorder.getBevelButtonBorder(), 418 "CheckBox.margin", new InsetsUIResource(1, 1, 0, 1), 419 // radar 3583849. This property never gets 420 // used. The border for the Checkbox gets overridden 421 // by AquaRadiButtonUI.setThemeBorder(). Needs refactoring. (vm) 422 // why is button focus commented out? 423 //"CheckBox.focus", getFocusColor(), 424 "CheckBox.focusInputMap", controlFocusInputMap, 425 426 "CheckBoxMenuItem.font", menuFont, 427 "CheckBoxMenuItem.acceleratorFont", menuFont, 428 "CheckBoxMenuItem.background", menuBackgroundColor, 429 "CheckBoxMenuItem.foreground", menuForegroundColor, 430 "CheckBoxMenuItem.selectionBackground", menuSelectedBackgroundColor, 431 "CheckBoxMenuItem.selectionForeground", menuSelectedForegroundColor, 432 "CheckBoxMenuItem.disabledBackground", menuDisabledBackgroundColor, 433 "CheckBoxMenuItem.disabledForeground", menuDisabledForegroundColor, 434 "CheckBoxMenuItem.acceleratorForeground", menuAccelForegroundColor, 435 "CheckBoxMenuItem.acceleratorSelectionForeground", menuAccelSelectionForegroundColor, 436 "CheckBoxMenuItem.acceleratorDelimiter", "", 437 "CheckBoxMenuItem.border", menuBorder, // for inset calculation 438 "CheckBoxMenuItem.margin", menuItemMargin, 439 "CheckBoxMenuItem.borderPainted", Boolean.TRUE, 440 "CheckBoxMenuItem.checkIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuItemCheckIcon"), 441 "CheckBoxMenuItem.dashIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuItemDashIcon"), 442 //"CheckBoxMenuItem.arrowIcon", null, 443 444 "ColorChooser.background", panelBackgroundColor, 445 446 // *** ComboBox 447 "ComboBox.font", controlFont, 448 "ComboBox.background", controlBackgroundColor, //menuBackgroundColor, // "menu" when it has no scrollbar, "listView" when it does 449 "ComboBox.foreground", menuForegroundColor, 450 "ComboBox.selectionBackground", menuSelectedBackgroundColor, 451 "ComboBox.selectionForeground", menuSelectedForegroundColor, 452 "ComboBox.disabledBackground", menuDisabledBackgroundColor, 453 "ComboBox.disabledForeground", menuDisabledForegroundColor, 454 "ComboBox.ancestorInputMap", aquaKeyBindings.getComboBoxInputMap(), 455 456 "DesktopIcon.border", internalFrameBorder, 457 "DesktopIcon.borderColor", smokyGlass, 458 "DesktopIcon.borderRimColor", dockIconRim, 459 "DesktopIcon.labelBackground", mediumTranslucentBlack, 460 "Desktop.background", desktopBackgroundColor, 461 462 "EditorPane.focusInputMap", aquaKeyBindings.getMultiLineTextInputMap(), 463 "EditorPane.font", controlFont, 464 "EditorPane.background", textBackground, 465 "EditorPane.foreground", textForeground, 466 "EditorPane.selectionBackground", textHighlight, 467 "EditorPane.selectionForeground", textHighlightText, 468 "EditorPane.caretForeground", textForeground, 469 "EditorPane.caretBlinkRate", textCaretBlinkRate, 470 "EditorPane.inactiveForeground", textInactiveText, 471 "EditorPane.inactiveBackground", textInactiveBackground, 472 "EditorPane.border", textAreaBorder, 473 "EditorPane.margin", editorMargin, 474 475 "FileChooser.newFolderIcon", AquaIcon.SystemIcon.getFolderIconUIResource(), 476 "FileChooser.upFolderIcon", AquaIcon.SystemIcon.getFolderIconUIResource(), 477 "FileChooser.homeFolderIcon", AquaIcon.SystemIcon.getDesktopIconUIResource(), 478 "FileChooser.detailsViewIcon", AquaIcon.SystemIcon.getComputerIconUIResource(), 479 "FileChooser.listViewIcon", AquaIcon.SystemIcon.getComputerIconUIResource(), 480 481 "FileView.directoryIcon", AquaIcon.SystemIcon.getFolderIconUIResource(), 482 "FileView.fileIcon", AquaIcon.SystemIcon.getDocumentIconUIResource(), 483 "FileView.computerIcon", AquaIcon.SystemIcon.getDesktopIconUIResource(), 484 "FileView.hardDriveIcon", AquaIcon.SystemIcon.getHardDriveIconUIResource(), 485 "FileView.floppyDriveIcon", AquaIcon.SystemIcon.getFloppyIconUIResource(), 486 487 // File View 488 "FileChooser.cancelButtonMnemonic", zero, 489 "FileChooser.saveButtonMnemonic", zero, 490 "FileChooser.openButtonMnemonic", zero, 491 "FileChooser.updateButtonMnemonic", zero, 492 "FileChooser.helpButtonMnemonic", zero, 493 "FileChooser.directoryOpenButtonMnemonic", zero, 494 495 "FileChooser.lookInLabelMnemonic", zero, 496 "FileChooser.fileNameLabelMnemonic", zero, 497 "FileChooser.filesOfTypeLabelMnemonic", zero, 498 499 "Focus.color", focusRingColor, 500 501 "FormattedTextField.focusInputMap", aquaKeyBindings.getFormattedTextFieldInputMap(), 502 "FormattedTextField.font", controlFont, 503 "FormattedTextField.background", textBackground, 504 "FormattedTextField.foreground", textForeground, 505 "FormattedTextField.inactiveForeground", textInactiveText, 506 "FormattedTextField.inactiveBackground", textInactiveBackground, 507 "FormattedTextField.selectionBackground", textHighlight, 508 "FormattedTextField.selectionForeground", textHighlightText, 509 "FormattedTextField.caretForeground", textForeground, 510 "FormattedTextField.caretBlinkRate", textCaretBlinkRate, 511 "FormattedTextField.border", textFieldBorder, 512 "FormattedTextField.margin", zeroInsets, 513 514 "IconButton.font", controlSmallFont, 515 516 "InternalFrame.titleFont", menuFont, 517 "InternalFrame.background", windowBackgroundColor, 518 "InternalFrame.borderColor", windowBackgroundColor, 519 "InternalFrame.borderShadow", Color.red, 520 "InternalFrame.borderDarkShadow", Color.green, 521 "InternalFrame.borderHighlight", Color.blue, 522 "InternalFrame.borderLight", Color.yellow, 523 "InternalFrame.opaque", Boolean.FALSE, 524 "InternalFrame.border", null, //internalFrameBorder, 525 "InternalFrame.icon", null, 526 527 "InternalFrame.paletteBorder", null,//internalFrameBorder, 528 "InternalFrame.paletteTitleFont", menuFont, 529 "InternalFrame.paletteBackground", windowBackgroundColor, 530 531 "InternalFrame.optionDialogBorder", null,//internalFrameBorder, 532 "InternalFrame.optionDialogTitleFont", menuFont, 533 "InternalFrame.optionDialogBackground", windowBackgroundColor, 534 535 /* Default frame icons are undefined for Basic. */ 536 537 "InternalFrame.closeIcon", new SwingLazyValue(PKG_PREFIX + "AquaInternalFrameUI", "exportCloseIcon"), 538 "InternalFrame.maximizeIcon", new SwingLazyValue(PKG_PREFIX + "AquaInternalFrameUI", "exportZoomIcon"), 539 "InternalFrame.iconifyIcon", new SwingLazyValue(PKG_PREFIX + "AquaInternalFrameUI", "exportMinimizeIcon"), 540 "InternalFrame.minimizeIcon", new SwingLazyValue(PKG_PREFIX + "AquaInternalFrameUI", "exportMinimizeIcon"), 541 // this could be either grow or icon 542 // we decided to make it icon so that anyone who uses 543 // these for ui will have different icons for max and min 544 // these icons are pretty crappy to use in Mac OS X since 545 // they really are interactive but we have to return a static 546 // icon for now. 547 548 // InternalFrame Auditory Cue Mappings 549 "InternalFrame.closeSound", null, 550 "InternalFrame.maximizeSound", null, 551 "InternalFrame.minimizeSound", null, 552 "InternalFrame.restoreDownSound", null, 553 "InternalFrame.restoreUpSound", null, 554 555 "InternalFrame.activeTitleBackground", windowBackgroundColor, 556 "InternalFrame.activeTitleForeground", textForeground, 557 "InternalFrame.inactiveTitleBackground", windowBackgroundColor, 558 "InternalFrame.inactiveTitleForeground", textInactiveText, 559 "InternalFrame.windowBindings", new Object[]{ 560 "shift ESCAPE", "showSystemMenu", 561 "ctrl SPACE", "showSystemMenu", 562 "ESCAPE", "hideSystemMenu" 563 }, 564 565 // Radar [3543438]. We now define the TitledBorder properties for font and color. 566 // Aqua HIG doesn't define TitledBorders as Swing does. Eventually, we might want to 567 // re-think TitledBorder to behave more like a Box (NSBox). (vm) 568 "TitledBorder.font", controlFont, 569 "TitledBorder.titleColor", black, 570 // "TitledBorder.border", -- we inherit this property from BasicLookAndFeel (etched border) 571 "TitledBorder.aquaVariant", aquaTitledBorder, // this is the border that matches what aqua really looks like 572 "InsetBorder.aquaVariant", aquaInsetBorder, // this is the title-less variant 573 574 // *** Label 575 "Label.font", controlFont, // themeLabelFont is for small things like ToolbarButtons 576 "Label.background", controlBackgroundColor, 577 "Label.foreground", black, 578 "Label.disabledForeground", disabled, 579 "Label.disabledShadow", disabledShadow, 580 "Label.opaque", useOpaqueComponents, 581 "Label.border", null, 582 583 "List.font", viewFont, // [3577901] Aqua HIG says "default font of text in lists and tables" should be 12 point (vm). 584 "List.background", white, 585 "List.foreground", black, 586 "List.selectionBackground", selectionBackground, 587 "List.selectionForeground", selectionForeground, 588 "List.selectionInactiveBackground", selectionInactiveBackground, 589 "List.selectionInactiveForeground", selectionInactiveForeground, 590 "List.focusCellHighlightBorder", focusCellHighlightBorder, 591 "List.border", null, 592 "List.cellRenderer", listCellRendererActiveValue, 593 594 "List.sourceListBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getSourceListBackgroundPainter"), 595 "List.sourceListSelectionBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getSourceListSelectionBackgroundPainter"), 596 "List.sourceListFocusedSelectionBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getSourceListFocusedSelectionBackgroundPainter"), 597 "List.evenRowBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getListEvenBackgroundPainter"), 598 "List.oddRowBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getListOddBackgroundPainter"), 599 600 // <rdar://Problem/3743210> The modifier for the Mac is meta, not control. 601 "List.focusInputMap", aquaKeyBindings.getListInputMap(), 602 603 //"List.scrollPaneBorder", listBoxBorder, // Not used in Swing1.1 604 //"ListItem.border", ThemeMenu.listItemBorder(), // for inset calculation 605 606 // *** Menus 607 "Menu.font", menuFont, 608 "Menu.acceleratorFont", menuFont, 609 "Menu.background", menuBackgroundColor, 610 "Menu.foreground", menuForegroundColor, 611 "Menu.selectionBackground", menuSelectedBackgroundColor, 612 "Menu.selectionForeground", menuSelectedForegroundColor, 613 "Menu.disabledBackground", menuDisabledBackgroundColor, 614 "Menu.disabledForeground", menuDisabledForegroundColor, 615 "Menu.acceleratorForeground", menuAccelForegroundColor, 616 "Menu.acceleratorSelectionForeground", menuAccelSelectionForegroundColor, 617 //"Menu.border", ThemeMenu.menuItemBorder(), // for inset calculation 618 "Menu.border", menuBorder, 619 "Menu.borderPainted", Boolean.FALSE, 620 "Menu.margin", menuItemMargin, 621 //"Menu.checkIcon", emptyCheckIcon, // A non-drawing GlyphIcon to make the spacing consistent 622 "Menu.arrowIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuArrowIcon"), 623 "Menu.consumesTabs", Boolean.TRUE, 624 "Menu.menuPopupOffsetY", new Integer(1), 625 "Menu.submenuPopupOffsetY", new Integer(-4), 626 627 "MenuBar.font", menuFont, 628 "MenuBar.background", menuBackgroundColor, // not a menu item, not selected 629 "MenuBar.foreground", menuForegroundColor, 630 "MenuBar.border", new AquaMenuBarBorder(), // sja make lazy! 631 "MenuBar.margin", new InsetsUIResource(0, 8, 0, 8), // sja make lazy! 632 "MenuBar.selectionBackground", menuSelectedBackgroundColor, // not a menu item, is selected 633 "MenuBar.selectionForeground", menuSelectedForegroundColor, 634 "MenuBar.disabledBackground", menuDisabledBackgroundColor, //ThemeBrush.GetThemeBrushForMenu(false, false), // not a menu item, not selected 635 "MenuBar.disabledForeground", menuDisabledForegroundColor, 636 "MenuBar.backgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaMenuPainter", "getMenuBarPainter"), 637 "MenuBar.selectedBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaMenuPainter", "getSelectedMenuBarItemPainter"), 638 639 "MenuItem.font", menuFont, 640 "MenuItem.acceleratorFont", menuFont, 641 "MenuItem.background", menuBackgroundColor, 642 "MenuItem.foreground", menuForegroundColor, 643 "MenuItem.selectionBackground", menuSelectedBackgroundColor, 644 "MenuItem.selectionForeground", menuSelectedForegroundColor, 645 "MenuItem.disabledBackground", menuDisabledBackgroundColor, 646 "MenuItem.disabledForeground", menuDisabledForegroundColor, 647 "MenuItem.acceleratorForeground", menuAccelForegroundColor, 648 "MenuItem.acceleratorSelectionForeground", menuAccelSelectionForegroundColor, 649 "MenuItem.acceleratorDelimiter", "", 650 "MenuItem.border", menuBorder, 651 "MenuItem.margin", menuItemMargin, 652 "MenuItem.borderPainted", Boolean.TRUE, 653 //"MenuItem.checkIcon", emptyCheckIcon, // A non-drawing GlyphIcon to make the spacing consistent 654 //"MenuItem.arrowIcon", null, 655 "MenuItem.selectedBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaMenuPainter", "getSelectedMenuItemPainter"), 656 657 // *** OptionPane 658 // You can additionaly define OptionPane.messageFont which will 659 // dictate the fonts used for the message, and 660 // OptionPane.buttonFont, which defines the font for the buttons. 661 "OptionPane.font", alertHeaderFont, 662 "OptionPane.messageFont", controlFont, 663 "OptionPane.buttonFont", controlFont, 664 "OptionPane.background", windowBackgroundColor, 665 "OptionPane.foreground", black, 666 "OptionPane.messageForeground", black, 667 "OptionPane.border", new BorderUIResource.EmptyBorderUIResource(12, 21, 17, 21), 668 "OptionPane.messageAreaBorder", zeroBorder, 669 "OptionPane.buttonAreaBorder", new BorderUIResource.EmptyBorderUIResource(13, 0, 0, 0), 670 "OptionPane.minimumSize", new DimensionUIResource(262, 90), 671 672 "OptionPane.errorIcon", stopIcon, 673 "OptionPane.informationIcon", confirmIcon, 674 "OptionPane.warningIcon", cautionIcon, 675 "OptionPane.questionIcon", confirmIcon, 676 "_SecurityDecisionIcon", securityIcon, 677 "OptionPane.windowBindings", new Object[]{"ESCAPE", "close"}, 678 // OptionPane Auditory Cue Mappings 679 "OptionPane.errorSound", null, 680 "OptionPane.informationSound", null, // Info and Plain 681 "OptionPane.questionSound", null, 682 "OptionPane.warningSound", null, 683 "OptionPane.buttonClickThreshhold", new Integer(500), 684 "OptionPane.yesButtonMnemonic", "", 685 "OptionPane.noButtonMnemonic", "", 686 "OptionPane.okButtonMnemonic", "", 687 "OptionPane.cancelButtonMnemonic", "", 688 689 "Panel.font", controlFont, 690 "Panel.background", panelBackgroundColor, //new ColorUIResource(0.5647f, 0.9957f, 0.5059f), 691 "Panel.foreground", black, 692 "Panel.opaque", useOpaqueComponents, 693 694 "PasswordField.focusInputMap", aquaKeyBindings.getPasswordFieldInputMap(), 695 "PasswordField.font", controlFont, 696 "PasswordField.background", textBackground, 697 "PasswordField.foreground", textForeground, 698 "PasswordField.inactiveForeground", textInactiveText, 699 "PasswordField.inactiveBackground", textInactiveBackground, 700 "PasswordField.selectionBackground", textHighlight, 701 "PasswordField.selectionForeground", textHighlightText, 702 "PasswordField.caretForeground", textForeground, 703 "PasswordField.caretBlinkRate", textCaretBlinkRate, 704 "PasswordField.border", textFieldBorder, 705 "PasswordField.margin", zeroInsets, 706 "PasswordField.echoChar", new Character((char)0x25CF), 707 "PasswordField.capsLockIconColor", textPasswordFieldCapsLockIconColor, 708 709 "PopupMenu.font", menuFont, 710 "PopupMenu.background", menuBackgroundColor, 711 // Fix for 7154516: make popups opaque 712 "PopupMenu.translucentBackground", white, 713 "PopupMenu.foreground", menuForegroundColor, 714 "PopupMenu.selectionBackground", menuSelectedBackgroundColor, 715 "PopupMenu.selectionForeground", menuSelectedForegroundColor, 716 "PopupMenu.border", menuBorder, 717 // "PopupMenu.margin", 718 719 "ProgressBar.font", controlFont, 720 "ProgressBar.foreground", black, 721 "ProgressBar.background", controlBackgroundColor, 722 "ProgressBar.selectionForeground", black, 723 "ProgressBar.selectionBackground", white, 724 "ProgressBar.border", new BorderUIResource(BorderFactory.createEmptyBorder()), 725 "ProgressBar.repaintInterval", new Integer(20), 726 727 "RadioButton.background", controlBackgroundColor, 728 "RadioButton.foreground", black, 729 "RadioButton.disabledText", disabled, 730 "RadioButton.select", selected, 731 "RadioButton.icon", new SwingLazyValue(PKG_PREFIX + "AquaButtonRadioUI", "getSizingRadioButtonIcon"), 732 "RadioButton.font", controlFont, 733 "RadioButton.border", AquaButtonBorder.getBevelButtonBorder(), 734 "RadioButton.margin", new InsetsUIResource(1, 1, 0, 1), 735 "RadioButton.focusInputMap", controlFocusInputMap, 736 737 "RadioButtonMenuItem.font", menuFont, 738 "RadioButtonMenuItem.acceleratorFont", menuFont, 739 "RadioButtonMenuItem.background", menuBackgroundColor, 740 "RadioButtonMenuItem.foreground", menuForegroundColor, 741 "RadioButtonMenuItem.selectionBackground", menuSelectedBackgroundColor, 742 "RadioButtonMenuItem.selectionForeground", menuSelectedForegroundColor, 743 "RadioButtonMenuItem.disabledBackground", menuDisabledBackgroundColor, 744 "RadioButtonMenuItem.disabledForeground", menuDisabledForegroundColor, 745 "RadioButtonMenuItem.acceleratorForeground", menuAccelForegroundColor, 746 "RadioButtonMenuItem.acceleratorSelectionForeground", menuAccelSelectionForegroundColor, 747 "RadioButtonMenuItem.acceleratorDelimiter", "", 748 "RadioButtonMenuItem.border", menuBorder, // for inset calculation 749 "RadioButtonMenuItem.margin", menuItemMargin, 750 "RadioButtonMenuItem.borderPainted", Boolean.TRUE, 751 "RadioButtonMenuItem.checkIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuItemCheckIcon"), 752 "RadioButtonMenuItem.dashIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuItemDashIcon"), 753 //"RadioButtonMenuItem.arrowIcon", null, 754 755 "Separator.background", null, 756 "Separator.foreground", new ColorUIResource(0xD4, 0xD4, 0xD4), 757 758 "ScrollBar.border", null, 759 "ScrollBar.focusInputMap", aquaKeyBindings.getScrollBarInputMap(), 760 "ScrollBar.focusInputMap.RightToLeft", aquaKeyBindings.getScrollBarRightToLeftInputMap(), 761 "ScrollBar.width", new Integer(16), 762 "ScrollBar.background", white, 763 "ScrollBar.foreground", black, 764 765 "ScrollPane.font", controlFont, 766 "ScrollPane.background", white, 767 "ScrollPane.foreground", black, //$ 768 "ScrollPane.border", scollListBorder, 769 "ScrollPane.viewportBorder", null, 770 771 "ScrollPane.ancestorInputMap", aquaKeyBindings.getScrollPaneInputMap(), 772 "ScrollPane.ancestorInputMap.RightToLeft", new UIDefaults.LazyInputMap(new Object[]{}), 773 774 "Viewport.font", controlFont, 775 "Viewport.background", white, // The background for tables, lists, etc 776 "Viewport.foreground", black, 777 778 // *** Slider 779 "Slider.foreground", black, "Slider.background", controlBackgroundColor, 780 "Slider.font", controlSmallFont, 781 //"Slider.highlight", table.get("controlLtHighlight"), 782 //"Slider.shadow", table.get("controlShadow"), 783 //"Slider.focus", table.get("controlDkShadow"), 784 "Slider.tickColor", new ColorUIResource(Color.GRAY), 785 "Slider.border", null, 786 "Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2), 787 "Slider.focusInputMap", aquaKeyBindings.getSliderInputMap(), 788 "Slider.focusInputMap.RightToLeft", aquaKeyBindings.getSliderRightToLeftInputMap(), 789 790 // *** Spinner 791 "Spinner.font", controlFont, 792 "Spinner.background", controlBackgroundColor, 793 "Spinner.foreground", black, 794 "Spinner.border", null, 795 "Spinner.arrowButtonSize", new Dimension(16, 5), 796 "Spinner.ancestorInputMap", aquaKeyBindings.getSpinnerInputMap(), 797 "Spinner.editorBorderPainted", Boolean.TRUE, 798 "Spinner.editorAlignment", SwingConstants.TRAILING, 799 800 // *** SplitPane 801 //"SplitPane.highlight", table.get("controlLtHighlight"), 802 //"SplitPane.shadow", table.get("controlShadow"), 803 "SplitPane.background", panelBackgroundColor, 804 "SplitPane.border", scollListBorder, 805 "SplitPane.dividerSize", new Integer(9), //$ 806 "SplitPaneDivider.border", null, // AquaSplitPaneDividerUI draws it 807 "SplitPaneDivider.horizontalGradientVariant", new SwingLazyValue(PKG_PREFIX + "AquaSplitPaneDividerUI", "getHorizontalSplitDividerGradientVariant"), 808 809 // *** TabbedPane 810 "TabbedPane.font", controlFont, 811 "TabbedPane.smallFont", controlSmallFont, 812 "TabbedPane.useSmallLayout", Boolean.FALSE,//sSmallTabs ? Boolean.TRUE : Boolean.FALSE, 813 "TabbedPane.background", tabBackgroundColor, // for bug [3398277] use a background color so that 814 // tabs on a custom pane get erased when they are removed. 815 "TabbedPane.foreground", black, //ThemeTextColor.GetThemeTextColor(AppearanceConstants.kThemeTextColorTabFrontActive), 816 //"TabbedPane.lightHighlight", table.get("controlLtHighlight"), 817 //"TabbedPane.highlight", table.get("controlHighlight"), 818 //"TabbedPane.shadow", table.get("controlShadow"), 819 //"TabbedPane.darkShadow", table.get("controlDkShadow"), 820 //"TabbedPane.focus", table.get("controlText"), 821 "TabbedPane.opaque", useOpaqueComponents, 822 "TabbedPane.textIconGap", new Integer(4), 823 "TabbedPane.tabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab (top, left, bottom, right) 824 //"TabbedPane.rightTabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab (top, left, bottom, right) 825 "TabbedPane.leftTabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab 826 "TabbedPane.rightTabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab 827 //"TabbedPane.tabAreaInsets", new InsetsUIResource(3, 9, -1, 9), // Tabs relative to edge of pane (negative value for overlapping) 828 "TabbedPane.tabAreaInsets", new InsetsUIResource(3, 9, -1, 9), // Tabs relative to edge of pane (negative value for overlapping) 829 // (top = side opposite pane, left = edge || to pane, bottom = side adjacent to pane, right = left) - see rotateInsets 830 "TabbedPane.contentBorderInsets", new InsetsUIResource(8, 0, 0, 0), // width of border 831 //"TabbedPane.selectedTabPadInsets", new InsetsUIResource(0, 0, 1, 0), // Really outsets, this is where we allow for overlap 832 "TabbedPane.selectedTabPadInsets", new InsetsUIResource(0, 0, 0, 0), // Really outsets, this is where we allow for overlap 833 "TabbedPane.tabsOverlapBorder", Boolean.TRUE, 834 "TabbedPane.selectedTabTitlePressedColor", selectedTabTitlePressedColor, 835 "TabbedPane.selectedTabTitleDisabledColor", selectedTabTitleDisabledColor, 836 "TabbedPane.selectedTabTitleNormalColor", selectedTabTitleNormalColor, 837 "TabbedPane.selectedTabTitleShadowDisabledColor", selectedTabTitleShadowDisabledColor, 838 "TabbedPane.selectedTabTitleShadowNormalColor", selectedTabTitleShadowNormalColor, 839 "TabbedPane.nonSelectedTabTitleNormalColor", nonSelectedTabTitleNormalColor, 840 841 // *** Table 842 "Table.font", viewFont, // [3577901] Aqua HIG says "default font of text in lists and tables" should be 12 point (vm). 843 "Table.foreground", black, // cell text color 844 "Table.background", white, // cell background color 845 "Table.selectionForeground", selectionForeground, 846 "Table.selectionBackground", selectionBackground, 847 "Table.selectionInactiveBackground", selectionInactiveBackground, 848 "Table.selectionInactiveForeground", selectionInactiveForeground, 849 "Table.gridColor", white, // grid line color 850 "Table.focusCellBackground", textHighlightText, 851 "Table.focusCellForeground", textHighlight, 852 "Table.focusCellHighlightBorder", focusCellHighlightBorder, 853 "Table.scrollPaneBorder", scollListBorder, 854 855 "Table.ancestorInputMap", aquaKeyBindings.getTableInputMap(), 856 "Table.ancestorInputMap.RightToLeft", aquaKeyBindings.getTableRightToLeftInputMap(), 857 858 "TableHeader.font", controlSmallFont, 859 "TableHeader.foreground", black, 860 "TableHeader.background", white, // header background 861 "TableHeader.cellBorder", listHeaderBorder, 862 863 // *** Text 864 "TextArea.focusInputMap", aquaKeyBindings.getMultiLineTextInputMap(), 865 "TextArea.font", controlFont, 866 "TextArea.background", textBackground, 867 "TextArea.foreground", textForeground, 868 "TextArea.inactiveForeground", textInactiveText, 869 "TextArea.inactiveBackground", textInactiveBackground, 870 "TextArea.selectionBackground", textHighlight, 871 "TextArea.selectionForeground", textHighlightText, 872 "TextArea.caretForeground", textForeground, 873 "TextArea.caretBlinkRate", textCaretBlinkRate, 874 "TextArea.border", textAreaBorder, 875 "TextArea.margin", zeroInsets, 876 877 "TextComponent.selectionBackgroundInactive", textHighlightInactive, 878 879 "TextField.focusInputMap", aquaKeyBindings.getTextFieldInputMap(), 880 "TextField.font", controlFont, 881 "TextField.background", textBackground, 882 "TextField.foreground", textForeground, 883 "TextField.inactiveForeground", textInactiveText, 884 "TextField.inactiveBackground", textInactiveBackground, 885 "TextField.selectionBackground", textHighlight, 886 "TextField.selectionForeground", textHighlightText, 887 "TextField.caretForeground", textForeground, 888 "TextField.caretBlinkRate", textCaretBlinkRate, 889 "TextField.border", textFieldBorder, 890 "TextField.margin", zeroInsets, 891 892 "TextPane.focusInputMap", aquaKeyBindings.getMultiLineTextInputMap(), 893 "TextPane.font", controlFont, 894 "TextPane.background", textBackground, 895 "TextPane.foreground", textForeground, 896 "TextPane.selectionBackground", textHighlight, 897 "TextPane.selectionForeground", textHighlightText, 898 "TextPane.caretForeground", textForeground, 899 "TextPane.caretBlinkRate", textCaretBlinkRate, 900 "TextPane.inactiveForeground", textInactiveText, 901 "TextPane.inactiveBackground", textInactiveBackground, 902 "TextPane.border", textAreaBorder, 903 "TextPane.margin", editorMargin, 904 905 // *** ToggleButton 906 "ToggleButton.background", controlBackgroundColor, 907 "ToggleButton.foreground", black, 908 "ToggleButton.disabledText", disabled, 909 // we need to go through and find out if these are used, and if not what to set 910 // so that subclasses will get good aqua like colors. 911 // "ToggleButton.select", getControlShadow(), 912 // "ToggleButton.text", getControl(), 913 // "ToggleButton.disabledSelectedText", getControlDarkShadow(), 914 // "ToggleButton.disabledBackground", getControl(), 915 // "ToggleButton.disabledSelectedBackground", getControlShadow(), 916 //"ToggleButton.focus", getFocusColor(), 917 "ToggleButton.border", new SwingLazyValue(PKG_PREFIX + "AquaButtonBorder", "getDynamicButtonBorder"), // sja make this lazy! 918 "ToggleButton.font", controlFont, 919 "ToggleButton.focusInputMap", controlFocusInputMap, 920 "ToggleButton.margin", new InsetsUIResource(2, 2, 2, 2), 921 922 // *** ToolBar 923 "ToolBar.font", controlFont, 924 "ToolBar.background", panelBackgroundColor, 925 "ToolBar.foreground", new ColorUIResource(Color.gray), 926 "ToolBar.dockingBackground", panelBackgroundColor, 927 "ToolBar.dockingForeground", selectionBackground, 928 "ToolBar.floatingBackground", panelBackgroundColor, 929 "ToolBar.floatingForeground", new ColorUIResource(Color.darkGray), 930 "ToolBar.border", new SwingLazyValue(PKG_PREFIX + "AquaToolBarUI", "getToolBarBorder"), 931 "ToolBar.borderHandleColor", toolbarDragHandleColor, 932 //"ToolBar.separatorSize", new DimensionUIResource( 10, 10 ), 933 "ToolBar.separatorSize", null, 934 935 // *** ToolBarButton 936 "ToolBarButton.margin", new InsetsUIResource(3, 3, 3, 3), 937 "ToolBarButton.insets", new InsetsUIResource(1, 1, 1, 1), 938 939 // *** ToolTips 940 "ToolTip.font", controlSmallFont, 941 //$ Tooltips - Same color as help balloons? 942 "ToolTip.background", toolTipBackground, 943 "ToolTip.foreground", black, 944 "ToolTip.border", toolTipBorder, 945 946 // *** Tree 947 "Tree.font", viewFont, // [3577901] Aqua HIG says "default font of text in lists and tables" should be 12 point (vm). 948 "Tree.background", white, 949 "Tree.foreground", black, 950 // for now no lines 951 "Tree.hash", white, //disabled, // Line color 952 "Tree.line", white, //disabled, // Line color 953 "Tree.textForeground", black, 954 "Tree.textBackground", white, 955 "Tree.selectionForeground", selectionForeground, 956 "Tree.selectionBackground", selectionBackground, 957 "Tree.selectionInactiveBackground", selectionInactiveBackground, 958 "Tree.selectionInactiveForeground", selectionInactiveForeground, 959 "Tree.selectionBorderColor", selectionBackground, // match the background so it looks like we don't draw anything 960 "Tree.editorBorderSelectionColor", null, // The EditTextFrame provides its own border 961 // "Tree.editorBorder", textFieldBorder, // If you still have Sun bug 4376328 in DefaultTreeCellEditor, it has to have the same insets as TextField.border 962 "Tree.leftChildIndent", new Integer(7),//$ 963 "Tree.rightChildIndent", new Integer(13),//$ 964 "Tree.rowHeight", new Integer(19),// iconHeight + 3, to match finder - a zero would have the renderer decide, except that leaves the icons touching 965 "Tree.scrollsOnExpand", Boolean.FALSE, 966 "Tree.openIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeOpenFolderIcon"), // Open folder icon 967 "Tree.closedIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeFolderIcon"), // Closed folder icon 968 "Tree.leafIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeDocumentIcon"), // Document icon 969 "Tree.expandedIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeExpandedIcon"), 970 "Tree.collapsedIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeCollapsedIcon"), 971 "Tree.rightToLeftCollapsedIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeRightToLeftCollapsedIcon"), 972 "Tree.changeSelectionWithFocus", Boolean.TRUE, 973 "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE, 974 975 "Tree.focusInputMap", aquaKeyBindings.getTreeInputMap(), 976 "Tree.focusInputMap.RightToLeft", aquaKeyBindings.getTreeRightToLeftInputMap(), 977 "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[]{"ESCAPE", "cancel"}),}; 978 979 table.putDefaults(defaults); 980 981 Object aaTextInfo = SwingUtilities2.AATextInfo.getAATextInfo(true); 982 table.put(SwingUtilities2.AA_TEXT_PROPERTY_KEY, aaTextInfo); 983 } 984 985 protected void initSystemColorDefaults(final UIDefaults table) { 986 // String[] defaultSystemColors = { 987 // "desktop", "#005C5C", /* Color of the desktop background */ 988 // "activeCaption", "#000080", /* Color for captions (title bars) when they are active. */ 989 // "activeCaptionText", "#FFFFFF", /* Text color for text in captions (title bars). */ 990 // "activeCaptionBorder", "#C0C0C0", /* Border color for caption (title bar) window borders. */ 991 // "inactiveCaption", "#808080", /* Color for captions (title bars) when not active. */ 992 // "inactiveCaptionText", "#C0C0C0", /* Text color for text in inactive captions (title bars). */ 993 // "inactiveCaptionBorder", "#C0C0C0", /* Border color for inactive caption (title bar) window borders. */ 994 // "window", "#FFFFFF", /* Default color for the interior of windows */ 995 // "windowBorder", "#000000", /* ??? */ 996 // "windowText", "#000000", /* ??? */ 997 // "menu", "#C0C0C0", /* Background color for menus */ 998 // "menuText", "#000000", /* Text color for menus */ 999 // "text", "#C0C0C0", /* Text background color */ 1000 // "textText", "#000000", /* Text foreground color */ 1001 // "textHighlight", "#000080", /* Text background color when selected */ 1002 // "textHighlightText", "#FFFFFF", /* Text color when selected */ 1003 // "textInactiveText", "#808080", /* Text color when disabled */ 1004 // "control", "#C0C0C0", /* Default color for controls (buttons, sliders, etc) */ 1005 // "controlText", "#000000", /* Default color for text in controls */ 1006 // "controlHighlight", "#C0C0C0", /* Specular highlight (opposite of the shadow) */ 1007 // "controlLtHighlight", "#FFFFFF", /* Highlight color for controls */ 1008 // "controlShadow", "#808080", /* Shadow color for controls */ 1009 // "controlDkShadow", "#000000", /* Dark shadow color for controls */ 1010 // "scrollbar", "#E0E0E0", /* Scrollbar background (usually the "track") */ 1011 // "info", "#FFFFE1", /* ??? */ 1012 // "infoText", "#000000" /* ??? */ 1013 // }; 1014 // 1015 // loadSystemColors(table, defaultSystemColors, isNativeLookAndFeel()); 1016 } 1017 1018 /** 1019 * Initialize the uiClassID to AquaComponentUI mapping. 1020 * The JComponent classes define their own uiClassID constants 1021 * (see AbstractComponent.getUIClassID). This table must 1022 * map those constants to a BasicComponentUI class of the 1023 * appropriate type. 1024 * 1025 * @see #getDefaults 1026 */ 1027 protected void initClassDefaults(final UIDefaults table) { 1028 final String basicPackageName = "javax.swing.plaf.basic."; 1029 1030 final Object[] uiDefaults = { 1031 "ButtonUI", PKG_PREFIX + "AquaButtonUI", 1032 "CheckBoxUI", PKG_PREFIX + "AquaButtonCheckBoxUI", 1033 "CheckBoxMenuItemUI", PKG_PREFIX + "AquaMenuItemUI", 1034 "LabelUI", PKG_PREFIX + "AquaLabelUI", 1035 "ListUI", PKG_PREFIX + "AquaListUI", 1036 "MenuUI", PKG_PREFIX + "AquaMenuUI", 1037 "MenuItemUI", PKG_PREFIX + "AquaMenuItemUI", 1038 "OptionPaneUI", PKG_PREFIX + "AquaOptionPaneUI", 1039 "PanelUI", PKG_PREFIX + "AquaPanelUI", 1040 "RadioButtonMenuItemUI", PKG_PREFIX + "AquaMenuItemUI", 1041 "RadioButtonUI", PKG_PREFIX + "AquaButtonRadioUI", 1042 "ProgressBarUI", PKG_PREFIX + "AquaProgressBarUI", 1043 "RootPaneUI", PKG_PREFIX + "AquaRootPaneUI", 1044 "SliderUI", PKG_PREFIX + "AquaSliderUI", 1045 "ScrollBarUI", PKG_PREFIX + "AquaScrollBarUI", 1046 "TabbedPaneUI", PKG_PREFIX + (JRSUIUtils.TabbedPane.shouldUseTabbedPaneContrastUI() ? "AquaTabbedPaneContrastUI" : "AquaTabbedPaneUI"), 1047 "TableUI", PKG_PREFIX + "AquaTableUI", 1048 "ToggleButtonUI", PKG_PREFIX + "AquaButtonToggleUI", 1049 "ToolBarUI", PKG_PREFIX + "AquaToolBarUI", 1050 "ToolTipUI", PKG_PREFIX + "AquaToolTipUI", 1051 "TreeUI", PKG_PREFIX + "AquaTreeUI", 1052 1053 "InternalFrameUI", PKG_PREFIX + "AquaInternalFrameUI", 1054 "DesktopIconUI", PKG_PREFIX + "AquaInternalFrameDockIconUI", 1055 "DesktopPaneUI", PKG_PREFIX + "AquaInternalFramePaneUI", 1056 "EditorPaneUI", PKG_PREFIX + "AquaEditorPaneUI", 1057 "TextFieldUI", PKG_PREFIX + "AquaTextFieldUI", 1058 "TextPaneUI", PKG_PREFIX + "AquaTextPaneUI", 1059 "ComboBoxUI", PKG_PREFIX + "AquaComboBoxUI", 1060 "PopupMenuUI", PKG_PREFIX + "AquaPopupMenuUI", 1061 "TextAreaUI", PKG_PREFIX + "AquaTextAreaUI", 1062 "MenuBarUI", PKG_PREFIX + "AquaMenuBarUI", 1063 "FileChooserUI", PKG_PREFIX + "AquaFileChooserUI", 1064 "PasswordFieldUI", PKG_PREFIX + "AquaTextPasswordFieldUI", 1065 "TableHeaderUI", PKG_PREFIX + "AquaTableHeaderUI", 1066 1067 "FormattedTextFieldUI", PKG_PREFIX + "AquaTextFieldFormattedUI", 1068 1069 "SpinnerUI", PKG_PREFIX + "AquaSpinnerUI", 1070 "SplitPaneUI", PKG_PREFIX + "AquaSplitPaneUI", 1071 "ScrollPaneUI", PKG_PREFIX + "AquaScrollPaneUI", 1072 1073 "PopupMenuSeparatorUI", PKG_PREFIX + "AquaPopupMenuSeparatorUI", 1074 "SeparatorUI", PKG_PREFIX + "AquaPopupMenuSeparatorUI", 1075 "ToolBarSeparatorUI", PKG_PREFIX + "AquaToolBarSeparatorUI", 1076 1077 // as we implement aqua versions of the swing elements 1078 // we will aad the com.apple.laf.FooUI classes to this table. 1079 1080 "ColorChooserUI", basicPackageName + "BasicColorChooserUI", 1081 1082 // text UIs 1083 "ViewportUI", basicPackageName + "BasicViewportUI", 1084 }; 1085 table.putDefaults(uiDefaults); 1086 } 1087 }