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